diff --git a/bsp/nrf5x/libraries/drivers/drv_gpio.c b/bsp/nrf5x/libraries/drivers/drv_gpio.c index 56297eb785..88385b561f 100644 --- a/bsp/nrf5x/libraries/drivers/drv_gpio.c +++ b/bsp/nrf5x/libraries/drivers/drv_gpio.c @@ -356,7 +356,7 @@ const static struct rt_pin_ops _nrf5x_pin_ops = RT_NULL, }; -rt_err_t rt_hw_pin_init(void) +int rt_hw_pin_init(void) { nrfx_err_t err_code; diff --git a/bsp/nrf5x/libraries/drivers/drv_gpio.h b/bsp/nrf5x/libraries/drivers/drv_gpio.h index 3e4b63c453..0341ad097e 100644 --- a/bsp/nrf5x/libraries/drivers/drv_gpio.h +++ b/bsp/nrf5x/libraries/drivers/drv_gpio.h @@ -38,7 +38,7 @@ struct pin_index rt_base_t pin; }; -rt_err_t rt_hw_pin_init(void); +int rt_hw_pin_init(void); #endif /* __DRV_GPIO_H__ */ diff --git a/bsp/nrf5x/libraries/drivers/drv_rtc.c b/bsp/nrf5x/libraries/drivers/drv_rtc.c index a06bb934b9..357f2e1611 100644 --- a/bsp/nrf5x/libraries/drivers/drv_rtc.c +++ b/bsp/nrf5x/libraries/drivers/drv_rtc.c @@ -35,7 +35,7 @@ #define TICK_FREQUENCE_HZ (RT_TICK_PER_SECOND) // RTC tick frequence, in HZ -static struct rt_device rtc; +static struct rt_rtc_device rtc; static time_t init_time; static uint32_t tick = 0; @@ -112,79 +112,13 @@ const static struct rt_device_ops rtc_ops = }; #endif -#if defined(SOC_NRF5340) -static rt_err_t rt_hw_rtc_register_5340(rt_device_t device, const char *name, rt_uint32_t flag) -{ - struct tm time_new = ONCHIP_RTC_TIME_DEFAULT; - RT_ASSERT(device != RT_NULL); - - init_time = timegm(&time_new); - if (rt_rtc_config(device) != RT_EOK) - { - return -RT_ERROR; - } -#ifdef RT_USING_DEVICE_OPS - device->ops = &rtc_ops; -#else - device->init = RT_NULL; - device->open = RT_NULL; - device->close = RT_NULL; - device->read = RT_NULL; - device->write = RT_NULL; - device->control = rt_rtc_control; -#endif - device->type = RT_Device_Class_RTC; - device->rx_indicate = RT_NULL; - device->tx_complete = RT_NULL; - device->user_data = RT_NULL; - - /* register a character device */ - rt_device_register(device, name, flag); - - return RT_EOK; -} -#else -static rt_err_t rt_hw_rtc_register(rt_device_t device, const char *name, rt_uint32_t flag) -{ - struct tm time_new = ONCHIP_RTC_TIME_DEFAULT; - - RT_ASSERT(device != RT_NULL); - - init_time = timegm(&time_new); - if (rt_rtc_config(device) != RT_EOK) - { - return -RT_ERROR; - } -#ifdef RT_USING_DEVICE_OPS - device->ops = &rtc_ops; -#else - device->init = RT_NULL; - device->open = RT_NULL; - device->close = RT_NULL; - device->read = RT_NULL; - device->write = RT_NULL; - device->control = rt_rtc_control; -#endif - device->type = RT_Device_Class_RTC; - device->rx_indicate = RT_NULL; - device->tx_complete = RT_NULL; - device->user_data = RT_NULL; - - /* register a character device */ - rt_device_register(device, name, flag); - - return RT_EOK; -} -#endif int rt_hw_rtc_init(void) { rt_err_t result; -#if defined(SOC_NRF5340) - result = rt_hw_rtc_register_5340(&rtc, "rtc", RT_DEVICE_FLAG_RDWR); -#else - result = rt_hw_rtc_register(&rtc, "rtc", RT_DEVICE_FLAG_RDWR); -#endif + + result = rt_hw_rtc_register(&rtc, "rtc", RT_DEVICE_FLAG_RDWR,RT_NULL); + if (result != RT_EOK) { LOG_E("rtc register err code: %d", result); diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/adc.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/adc.attach new file mode 100644 index 0000000000..fb17a1d885 --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/adc.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_SAADC=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/flash.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/flash.attach new file mode 100644 index 0000000000..5c49eb48fc --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/flash.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_ON_CHIP_FLASH=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/gpio.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/gpio.attach new file mode 100644 index 0000000000..7b3294cc6f --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/gpio.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_GPIO=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/hwtimer.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/hwtimer.attach new file mode 100644 index 0000000000..40b09d6155 --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/hwtimer.attach @@ -0,0 +1,2 @@ +CONFIG_BSP_USING_TIM=y +CONFIG_BSP_USING_TIM0=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/i2c.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/i2c.attach new file mode 100644 index 0000000000..e7bf5c0635 --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/i2c.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_I2C=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/pwm.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/pwm.attach new file mode 100644 index 0000000000..1ef1911786 --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/pwm.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_PWM=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/qspi_flash.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/qspi_flash.attach new file mode 100644 index 0000000000..68c1ca98d3 --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/qspi_flash.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_QSPI_FLASH=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/rtc.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/rtc.attach new file mode 100644 index 0000000000..fb6acc20cd --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/rtc.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_ONCHIP_RTC=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/spi.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/spi.attach new file mode 100644 index 0000000000..5b37d16468 --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/spi.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_SPI=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/uart.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/uart.attach new file mode 100644 index 0000000000..d8570f657d --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/uart.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_UART=y \ No newline at end of file diff --git a/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/wdt.attach b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/wdt.attach new file mode 100644 index 0000000000..f18527eda9 --- /dev/null +++ b/bsp/nrf5x/nrf52840/.ci/attachconfig/devices/wdt.attach @@ -0,0 +1 @@ +CONFIG_BSP_USING_WDT=y \ No newline at end of file