mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-18 15:53:32 +08:00
fix GPIO and SCI drivers for RZ series (#9908)
fix gpio and sci drivers for RZ series
This commit is contained in:
parent
da6c62c293
commit
37908818a0
@ -1019,7 +1019,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -7,6 +7,7 @@
|
||||
* Date Author Notes
|
||||
* 2021-07-29 KyleChan first version
|
||||
* 2022-01-19 Sherman add PIN2IRQX_TABLE
|
||||
* 2025-01-13 newflydd pin_get for RZ
|
||||
*/
|
||||
|
||||
#include <drv_gpio.h>
|
||||
@ -304,37 +305,31 @@ static rt_err_t ra_pin_dettach_irq(struct rt_device *device, rt_base_t pin)
|
||||
|
||||
static rt_base_t ra_pin_get(const char *name)
|
||||
{
|
||||
int pin_number = -1, port = -1, pin = -1;
|
||||
|
||||
if (rt_strlen(name) != 4)
|
||||
return -1;
|
||||
|
||||
if ((name[0] == 'P' || name[0] == 'p'))
|
||||
#ifdef SOC_FAMILY_RENESAS_RZ
|
||||
/* RZ series: use "PXX_X" format, like "P01_1" */
|
||||
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'))
|
||||
{
|
||||
if ('0' <= name[1] && name[1] <= '9')
|
||||
{
|
||||
port = (name[1] - '0') * 16 * 16;
|
||||
if ('0' <= name[2] && name[2] <= '9' && '0' <= name[3] && name[3] <= '9')
|
||||
{
|
||||
pin = (name[2] - '0') * 10 + (name[3] - '0');
|
||||
pin_number = port + pin;
|
||||
|
||||
return pin_number;
|
||||
}
|
||||
}
|
||||
else if ('A' <= name[1] && name[1] <= 'Z')
|
||||
{
|
||||
port = (name[1] - '0' - 7) * 16 * 16;
|
||||
if ('0' <= name[2] && name[2] <= '9' && '0' <= name[3] && name[3] <= '9')
|
||||
{
|
||||
pin = (name[2] - '0') * 10 + (name[3] - '0');
|
||||
pin_number = port + pin;
|
||||
|
||||
return pin_number;
|
||||
}
|
||||
}
|
||||
return (((int) name[1] - '0') * 10 + ((int) name[2] - '0')) * 0x100 + ((int) name[4] - '0');
|
||||
}
|
||||
return -1;
|
||||
LOG_W("Invalid pin expression, use `PXX_X` format like `P01_1`");
|
||||
#else
|
||||
/* RA series: use "PXXX" format, like "P101"*/
|
||||
if ((rt_strlen(name) == 4) &&
|
||||
(name[0] == 'P' || name[0] == 'p') &&
|
||||
(name[1] >= '0' && name[1] <= '9') &&
|
||||
(name[2] >= '0' && name[1] <= '9') &&
|
||||
(name[3] >= '0' && name[1] <= '9'))
|
||||
{
|
||||
return (name[1] - '0') * 0x100 + (name[2] - '0') * 10 + (name[3] - '0');
|
||||
}
|
||||
LOG_W("Invalid pin expression, use `PXXX` format like `P101`");
|
||||
#endif
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
const static struct rt_pin_ops _ra_pin_ops =
|
||||
|
@ -358,7 +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;
|
||||
}
|
||||
|
@ -1,52 +1,56 @@
|
||||
|
||||
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
|
||||
|
||||
config SOC_SERIES_R7FA6E2
|
||||
bool
|
||||
select ARCH_ARM_CORTEX_M33
|
||||
select SOC_FAMILY_RENESAS
|
||||
select SOC_FAMILY_RENESAS_RA
|
||||
default n
|
@ -657,7 +657,7 @@ CONFIG_SOC_R7FA6M4AF=y
|
||||
#
|
||||
# On-chip Peripheral Drivers
|
||||
#
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
CONFIG_SOC_SERIES_R7FA6M4=y
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
# CONFIG_BSP_USING_ONCHIP_FLASH is not set
|
||||
|
@ -1035,7 +1035,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
CONFIG_SOC_SERIES_R7FA2L1=y
|
||||
|
@ -1036,7 +1036,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -1153,7 +1153,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# end of Arduino libraries
|
||||
# end of RT-Thread online packages
|
||||
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
CONFIG_SOC_SERIES_R7FA6E2=y
|
||||
|
||||
#
|
||||
|
@ -1021,7 +1021,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
CONFIG_SOC_SERIES_R7FA6M3=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -1271,7 +1271,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# end of Arduino libraries
|
||||
# end of RT-Thread online packages
|
||||
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
CONFIG_SOC_SERIES_R7FA6M3=y
|
||||
|
||||
#
|
||||
|
@ -1027,7 +1027,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
CONFIG_SOC_SERIES_R7FA6M4=y
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -1021,7 +1021,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
CONFIG_SOC_SERIES_R7FA6M4=y
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -1022,7 +1022,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -1057,7 +1057,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -1054,7 +1054,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RA=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
@ -1151,7 +1151,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=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
|
||||
|
||||
#
|
||||
|
@ -1054,7 +1054,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# Uncategorized
|
||||
#
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
CONFIG_SOC_FAMILY_RENESAS=y
|
||||
CONFIG_SOC_FAMILY_RENESAS_RZ=y
|
||||
# CONFIG_SOC_SERIES_R7FA6M3 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA6M4 is not set
|
||||
# CONFIG_SOC_SERIES_R7FA2L1 is not set
|
||||
|
Loading…
x
Reference in New Issue
Block a user