Skip to content

Commit

Permalink
Merge pull request #32 from newflydd/master
Browse files Browse the repository at this point in the history
pin and sci drvier, make all projects' board/Kconfig file the same
  • Loading branch information
kurisaW authored Jan 16, 2025
2 parents 8191af1 + f61b990 commit c15a1b6
Show file tree
Hide file tree
Showing 62 changed files with 3,560 additions and 64 deletions.
18 changes: 16 additions & 2 deletions libraries/HAL_Drivers/drv_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,21 @@ static rt_err_t ra_pin_dettach_irq(struct rt_device *device, rt_base_t pin)
#endif
}

static rt_base_t ra_pin_get(const char *name)
static rt_base_t ra_pin_get(const char *name)
{
#if defined(SOC_FAMILY_RENESAS_RZ)
/* USE "PXX_X" or "pXX_X" format, the character 'P'/'p' and '_' are required. */
if ((rt_strlen(name) == 5) &&
((name[0] == 'P') || (name[0] == 'p')) &&
(name[3] == '_') &&
('0' <= (int) name[1] && (int) name[1] <= '1') &&
('0' <= (int) name[2] && (int) name[2] <= '9') &&
('0' <= (int) name[4] && (int) name[4] <= '7')) {
return (((int) name[1] - '0') * 10 + ((int) name[2] - '0')) * 0x100 + ((int) name[4] - '0');
}
LOG_W("Invalid pin expression, use `PXX_X` format");
return -1;
#else
int pin_number = -1, port = -1, pin = -1;
if (rt_strlen(name) != 4)
return -1;
Expand All @@ -380,12 +393,13 @@ static rt_base_t ra_pin_get(const char *name)
pin_number = port + pin;
}
else return -1;
}
}
else return -1;
}
else return -1;
}
return pin_number;
#endif
}

const static struct rt_pin_ops _ra_pin_ops =
Expand Down
5 changes: 4 additions & 1 deletion libraries/HAL_Drivers/drv_sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,11 @@ static int ra_uart_putc(struct rt_serial_device *serial, char c)
sci_uart_instance_ctrl_t *p_ctrl = (sci_uart_instance_ctrl_t *)param->sci_ctrl;

p_ctrl->p_reg->TDR = c;
#ifdef SOC_SERIES_R9A07G0
while ((p_ctrl->p_reg->CSR_b.TEND) == 0);
#else
while ((p_ctrl->p_reg->SSR_b.TEND) == 0);

#endif
return RT_EOK;
}

Expand Down
20 changes: 12 additions & 8 deletions libraries/Kconfig
Original file line number Diff line number Diff line change
@@ -1,46 +1,50 @@

config SOC_FAMILY_RENESAS
config SOC_FAMILY_RENESAS_RA
bool
default n

config SOC_FAMILY_RENESAS_RZ
bool
default n

config SOC_SERIES_R7FA6M3
bool
select ARCH_ARM_CORTEX_M4
select SOC_FAMILY_RENESAS
select SOC_FAMILY_RENESAS_RA
default n

config SOC_SERIES_R7FA6M4
bool
select ARCH_ARM_CORTEX_M4
select SOC_FAMILY_RENESAS
select SOC_FAMILY_RENESAS_RA
default n

config SOC_SERIES_R7FA2L1
bool
select ARCH_ARM_CORTEX_M23
select SOC_FAMILY_RENESAS
select SOC_FAMILY_RENESAS_RA
default n

config SOC_SERIES_R7FA6M5
bool
select ARCH_ARM_CORTEX_M33
select SOC_FAMILY_RENESAS
select SOC_FAMILY_RENESAS_RA
default n

config SOC_SERIES_R7FA4M2
bool
select ARCH_ARM_CORTEX_M4
select SOC_FAMILY_RENESAS
select SOC_FAMILY_RENESAS_RA
default n

config SOC_SERIES_R7FA8M85
bool
select ARCH_ARM_CORTEX_M85
select SOC_FAMILY_RENESAS
select SOC_FAMILY_RENESAS_RA
default n

config SOC_SERIES_R9A07G0
bool
select ARCH_ARM_CORTEX_R52
select SOC_FAMILY_RENESAS
select SOC_FAMILY_RENESAS_RZ
default n
2 changes: 1 addition & 1 deletion projects/etherkit_basic_key_irq/.config
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ CONFIG_RT_USING_PIN=y
# end of Arduino libraries
# end of RT-Thread online packages

CONFIG_SOC_FAMILY_RENESAS=y
CONFIG_SOC_FAMILY_RENESAS_RZ=y
CONFIG_SOC_SERIES_R9A07G0=y

#
Expand Down
10 changes: 10 additions & 0 deletions projects/etherkit_basic_key_irq/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,16 @@ menu "Hardware Drivers Config"
default n
endif

menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
config BSP_USING_PWM5
bool "Enable GPT5 (32-Bits) output PWM"
default n
endif

config BSP_USING_ETH
bool "Enable Ethernet"
select RT_USING_SAL
Expand Down
2 changes: 1 addition & 1 deletion projects/etherkit_basic_key_irq/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@

/* end of Arduino libraries */
/* end of RT-Thread online packages */
#define SOC_FAMILY_RENESAS
#define SOC_FAMILY_RENESAS_RZ
#define SOC_SERIES_R9A07G0

/* Hardware Drivers Config */
Expand Down
2 changes: 1 addition & 1 deletion projects/etherkit_basic_rtc/.config
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ CONFIG_RT_USING_PIN=y
# end of Arduino libraries
# end of RT-Thread online packages

CONFIG_SOC_FAMILY_RENESAS=y
CONFIG_SOC_FAMILY_RENESAS_RZ=y
CONFIG_SOC_SERIES_R9A07G0=y

#
Expand Down
10 changes: 10 additions & 0 deletions projects/etherkit_basic_rtc/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,16 @@ menu "Hardware Drivers Config"
default n
endif

menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
config BSP_USING_PWM5
bool "Enable GPT5 (32-Bits) output PWM"
default n
endif

config BSP_USING_ETH
bool "Enable Ethernet"
select RT_USING_SAL
Expand Down
2 changes: 1 addition & 1 deletion projects/etherkit_basic_rtc/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@

/* end of Arduino libraries */
/* end of RT-Thread online packages */
#define SOC_FAMILY_RENESAS
#define SOC_FAMILY_RENESAS_RZ
#define SOC_SERIES_R9A07G0

/* Hardware Drivers Config */
Expand Down
2 changes: 1 addition & 1 deletion projects/etherkit_blink_led/.config
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ CONFIG_RT_USING_PIN=y
# end of Arduino libraries
# end of RT-Thread online packages

CONFIG_SOC_FAMILY_RENESAS=y
CONFIG_SOC_FAMILY_RENESAS_RZ=y
CONFIG_SOC_SERIES_R9A07G0=y

#
Expand Down
10 changes: 10 additions & 0 deletions projects/etherkit_blink_led/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,16 @@ menu "Hardware Drivers Config"
default n
endif

menuconfig BSP_USING_PWM
bool "Enable PWM"
default n
select RT_USING_PWM
if BSP_USING_PWM
config BSP_USING_PWM5
bool "Enable GPT5 (32-Bits) output PWM"
default n
endif

config BSP_USING_ETH
bool "Enable Ethernet"
select RT_USING_SAL
Expand Down
2 changes: 1 addition & 1 deletion projects/etherkit_blink_led/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@

/* end of Arduino libraries */
/* end of RT-Thread online packages */
#define SOC_FAMILY_RENESAS
#define SOC_FAMILY_RENESAS_RZ
#define SOC_SERIES_R9A07G0

/* Hardware Drivers Config */
Expand Down
2 changes: 1 addition & 1 deletion projects/etherkit_component_mqtt/.config
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ CONFIG_PKG_KAWAII_MQTT_VER="v1.1.0"
# end of Arduino libraries
# end of RT-Thread online packages

CONFIG_SOC_FAMILY_RENESAS=y
CONFIG_SOC_FAMILY_RENESAS_RZ=y
CONFIG_SOC_SERIES_R9A07G0=y

#
Expand Down
Loading

0 comments on commit c15a1b6

Please sign in to comment.