summaryrefslogtreecommitdiff
path: root/bsp/essemi
diff options
context:
space:
mode:
authorliuhy <[email protected]>2021-06-04 18:58:22 +0800
committerwangyq2018 <[email protected]>2021-06-04 18:58:22 +0800
commit66e7465c5a202bf0cc37b3daf2991a4e3edc3b19 (patch)
tree07676271ea7886c64aab09b729459efba3ba3b5e /bsp/essemi
parent2961b37104443b9f63bbd5a6b5b8d84c7797d2c6 (diff)
增加了许可证说明和bsp配置的接口,优化了驱动及用例。
Diffstat (limited to 'bsp/essemi')
-rw-r--r--bsp/essemi/es32f0654/.config49
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/Kconfig160
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_adc.h97
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_can.h73
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_cmu.h87
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_gpio.h5158
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_hwtimer.h103
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_i2c.h95
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_map.h2691
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_pm.h32
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_pwm.h72
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_rtc.h43
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_select.h44
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_spi.h132
-rw-r--r--bsp/essemi/es32f0654/drivers/ES/es_conf_info_uart.h206
-rw-r--r--bsp/essemi/es32f0654/drivers/Kconfig146
-rw-r--r--bsp/essemi/es32f0654/drivers/SConscript48
-rw-r--r--bsp/essemi/es32f0654/drivers/board.c91
-rw-r--r--bsp/essemi/es32f0654/drivers/board.h18
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/adc_vol_sample.c5
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/can_sample.c6
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/hwtimer_sample.c6
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_e2_sample.c109
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_sample.c22
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/pm_sample.c43
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/pwm_led_sample.c8
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/rtc_sample.c4
-rw-r--r--bsp/essemi/es32f0654/drivers/bsp_driver_example/spi_sample.c36
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_adc.c100
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_adc.h15
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_can.c265
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_can.h27
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_gpio.c298
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_gpio.h15
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_hwtimer.c402
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_hwtimer.h16
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_i2c.c93
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_i2c.h19
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_pm.c53
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_pm.h19
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_pwm.c230
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_pwm.h12
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_rtc.c36
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_rtc.h16
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_spi.c180
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_spi.h17
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_spiflash.c10
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_uart.c567
-rw-r--r--bsp/essemi/es32f0654/drivers/drv_uart.h12
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_acmp.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_adc.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_bkpc.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_calc.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_can.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_cmu.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_conf.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crc.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crypt.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dbgc.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dma.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_flash.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_gpio.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_i2c.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_iap.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pis.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pmu.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rmu.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rtc.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_smartcard.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_spi.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_syscfg.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_timer.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_trng.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_tsense.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_uart.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_usart.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_wdt.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/type.h15
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/utils.h14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_acmp.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_adc.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_bkpc.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_calc.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_can.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_cmu.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crc.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crypt.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_dma.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash_ext.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_gpio.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_i2c.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_iap.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pis.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pmu.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rmu.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rtc.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_smartcard.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_spi.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_timer.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_trng.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_tsense.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_uart.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_usart.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_wdt.c14
-rw-r--r--bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/utils.c14
-rw-r--r--bsp/essemi/es32f0654/project.uvprojx355
-rw-r--r--bsp/essemi/es32f0654/rtconfig.h9
-rw-r--r--bsp/essemi/es32f369x/.config90
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/Kconfig197
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_adc.h97
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_can.h73
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_cmu.h89
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_gpio.h5157
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_hwtimer.h102
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_i2c.h95
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_map.h2876
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_pm.h32
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_pwm.h78
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_rtc.h43
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_select.h43
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_spi.h159
-rw-r--r--bsp/essemi/es32f369x/drivers/ES/es_conf_info_uart.h205
-rw-r--r--bsp/essemi/es32f369x/drivers/Kconfig150
-rw-r--r--bsp/essemi/es32f369x/drivers/SConscript26
-rw-r--r--bsp/essemi/es32f369x/drivers/board.c93
-rw-r--r--bsp/essemi/es32f369x/drivers/board.h18
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/adc_vol_sample.c6
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/can_sample.c6
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/hwtimer_sample.c4
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_e2_sample.c109
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_sample.c18
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/pm_sample.c53
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/pwm_led_sample.c9
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/rtc_sample.c6
-rw-r--r--bsp/essemi/es32f369x/drivers/bsp_driver_example/spi_sample.c36
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_adc.c127
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_adc.h17
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_can.c279
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_can.h27
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_gpio.c310
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_gpio.h17
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_hwtimer.c371
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_hwtimer.h16
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_i2c.c88
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_i2c.h19
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_pm.c60
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_pm.h20
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_pwm.c328
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_rtc.c39
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_rtc.h16
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_spi.c212
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_spi.h17
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_spiflash.c34
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_spiflash.h19
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_uart.c448
-rw-r--r--bsp/essemi/es32f369x/drivers/drv_uart.h12
-rw-r--r--bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Include/es32f36xx.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/gcc/startup_es32f36xx.S438
-rw-r--r--bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/keil/startup_es32f36xx.s14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_acmp.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_adc.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_bkpc.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_calc.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_can.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_cmu.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_conf.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crc.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crypt.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dac.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dbgc.h15
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dma.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_ebi.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_flash.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_gpio.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2c.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2s.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_iap.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nand.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nor_lcd.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pis.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pmu.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_qspi.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rmu.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtc.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtchw.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_spi.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_sram.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_syscfg.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_timer.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_trng.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_tsense.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_uart.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_usb.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_wdt.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/type.h16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/utils.h14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_acmp.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_adc.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_bkpc.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_calc.c16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_can.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_cmu.c16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crc.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crypt.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dac.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dma.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_ebi.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash_ext.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_gpio.c16
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2c.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2s.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_iap.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nand.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nor_lcd.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pis.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pmu.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_qspi.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rmu.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtc.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtchw.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_spi.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_sram.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_timer.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_trng.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_tsense.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_uart.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_usb.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_wdt.c14
-rw-r--r--bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/utils.c14
-rw-r--r--bsp/essemi/es32f369x/project.uvoptx558
-rw-r--r--bsp/essemi/es32f369x/project.uvprojx356
-rw-r--r--bsp/essemi/es32f369x/rtconfig.h21
-rw-r--r--bsp/essemi/es32f369x/template.uvoptx8
-rw-r--r--bsp/essemi/es32f369x/template.uvprojx6
236 files changed, 25243 insertions, 2684 deletions
diff --git a/bsp/essemi/es32f0654/.config b/bsp/essemi/es32f0654/.config
index 3a014cefdd..cab1975d8a 100644
--- a/bsp/essemi/es32f0654/.config
+++ b/bsp/essemi/es32f0654/.config
@@ -19,7 +19,7 @@ CONFIG_RT_USING_OVERFLOW_CHECK=y
CONFIG_RT_USING_HOOK=y
CONFIG_RT_USING_IDLE_HOOK=y
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
-CONFIG_IDLE_THREAD_STACK_SIZE=256
+CONFIG_IDLE_THREAD_STACK_SIZE=512
# CONFIG_RT_USING_TIMER_SOFT is not set
CONFIG_RT_DEBUG=y
CONFIG_RT_DEBUG_COLOR=y
@@ -114,26 +114,26 @@ CONFIG_RT_PIPE_BUFSZ=512
CONFIG_RT_USING_SERIAL=y
# CONFIG_RT_SERIAL_USING_DMA is not set
CONFIG_RT_SERIAL_RB_BUFSZ=64
-CONFIG_RT_USING_CAN=y
+# CONFIG_RT_USING_CAN is not set
# CONFIG_RT_CAN_USING_HDR is not set
-CONFIG_RT_USING_HWTIMER=y
+# CONFIG_RT_USING_HWTIMER is not set
# CONFIG_RT_USING_CPUTIME is not set
-CONFIG_RT_USING_I2C=y
+# CONFIG_RT_USING_I2C is not set
# CONFIG_RT_I2C_DEBUG is not set
-CONFIG_RT_USING_I2C_BITOPS=y
+# CONFIG_RT_USING_I2C_BITOPS is not set
# CONFIG_RT_I2C_BITOPS_DEBUG is not set
CONFIG_RT_USING_PIN=y
-CONFIG_RT_USING_ADC=y
+# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set
-CONFIG_RT_USING_PWM=y
+# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
-CONFIG_RT_USING_PM=y
-CONFIG_RT_USING_RTC=y
+# CONFIG_RT_USING_PM is not set
+# CONFIG_RT_USING_RTC is not set
# CONFIG_RT_USING_ALARM is not set
# CONFIG_RT_USING_SOFT_RTC is not set
# CONFIG_RT_USING_SDIO is not set
-CONFIG_RT_USING_SPI=y
+# CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_QSPI is not set
# CONFIG_RT_USING_SPI_MSD is not set
# CONFIG_RT_USING_SFUD is not set
@@ -159,7 +159,8 @@ CONFIG_RT_USING_SPI=y
#
# CONFIG_RT_USING_LIBC is not set
# CONFIG_RT_USING_PTHREADS is not set
-# CONFIG_RT_LIBC_USING_TIME is not set
+CONFIG_RT_LIBC_USING_TIME=y
+CONFIG_RT_LIBC_FIXED_TIMEZONE=8
#
# Network
@@ -468,6 +469,8 @@ CONFIG_BSP_USING_GPIO=y
# CONFIG_BSP_USING_UART1 is not set
CONFIG_BSP_USING_UART2=y
# CONFIG_BSP_USING_UART3 is not set
+# CONFIG_BSP_USING_USART0 is not set
+# CONFIG_BSP_USING_USART1 is not set
#
# SPI Drivers
@@ -484,23 +487,26 @@ CONFIG_BSP_USING_UART2=y
#
# CAN Drivers
#
-# CONFIG_BSP_USING_CAN is not set
+# CONFIG_BSP_USING_CAN0 is not set
#
# PWM Drivers
#
-# CONFIG_BSP_USING_PWM0 is not set
-# CONFIG_BSP_USING_PWM1 is not set
-# CONFIG_BSP_USING_PWM2 is not set
-# CONFIG_BSP_USING_PWM3 is not set
+# CONFIG_BSP_USING_AD16C4T0_PWM is not set
+# CONFIG_BSP_USING_GP16C4T0_PWM is not set
+# CONFIG_BSP_USING_GP16C2T0_PWM is not set
+# CONFIG_BSP_USING_GP16C2T1_PWM is not set
#
# HWtimer Drivers
#
-# CONFIG_BSP_USING_HWTIMER0 is not set
-# CONFIG_BSP_USING_HWTIMER1 is not set
-# CONFIG_BSP_USING_HWTIMER2 is not set
-# CONFIG_BSP_USING_HWTIMER3 is not set
+# CONFIG_BSP_USING_AD16C4T0_HWTIMER is not set
+# CONFIG_BSP_USING_GP16C4T0_HWTIMER is not set
+# CONFIG_BSP_USING_GP16C2T0_HWTIMER is not set
+# CONFIG_BSP_USING_GP16C2T1_HWTIMER is not set
+# CONFIG_BSP_USING_BS16T0_HWTIMER is not set
+# CONFIG_BSP_USING_BS16T2_HWTIMER is not set
+# CONFIG_BSP_USING_BS16T3_HWTIMER is not set
#
# RTC Drivers
@@ -515,7 +521,7 @@ CONFIG_BSP_USING_UART2=y
#
# ADC Drivers
#
-# CONFIG_BSP_USING_ADC is not set
+# CONFIG_BSP_USING_ADC0 is not set
#
# Onboard Peripheral Drivers
@@ -532,6 +538,7 @@ CONFIG_BSP_USING_UART2=y
# CONFIG_BSP_USING_EXAMPLE_ADC_VOL is not set
# CONFIG_BSP_USING_EXAMPLE_HWTIMER is not set
# CONFIG_BSP_USING_EXAMPLE_I2C is not set
+# CONFIG_BSP_USING_EXAMPLE_I2C_E2PROM is not set
# CONFIG_BSP_USING_EXAMPLE_LED_BLINK is not set
# CONFIG_BSP_USING_EXAMPLE_PIN_BEEP is not set
# CONFIG_BSP_USING_EXAMPLE_PWM_LED is not set
diff --git a/bsp/essemi/es32f0654/drivers/ES/Kconfig b/bsp/essemi/es32f0654/drivers/ES/Kconfig
new file mode 100644
index 0000000000..1f3b0a4e96
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/Kconfig
@@ -0,0 +1,160 @@
+menu "UART Drivers"
+
+ config BSP_USING_UART0
+ bool "Register UART0"
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_UART1
+ bool "Register UART1"
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_UART2
+ bool "Register UART2"
+ select RT_USING_SERIAL
+ default y
+
+ config BSP_USING_UART3
+ bool "Register UART3"
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_USART0
+ bool "Register USART0"
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_USART1
+ bool "Register USART1"
+ select RT_USING_SERIAL
+ default n
+endmenu
+
+menu "SPI Drivers"
+
+ config BSP_USING_SPI0
+ bool "Register SPI0"
+ select RT_USING_SPI
+ select RT_USING_PIN
+ default n
+
+ config BSP_USING_SPI1
+ bool "Register SPI1"
+ select RT_USING_SPI
+ select RT_USING_PIN
+ default n
+endmenu
+
+menu "I2C Drivers"
+ config BSP_USING_I2C0
+ bool "Register I2C0"
+ select RT_USING_I2C
+ default n
+
+ config BSP_USING_I2C1
+ bool "Register I2C1"
+ select RT_USING_I2C
+ default n
+endmenu
+
+menu "CAN Drivers"
+ config BSP_USING_CAN0
+ bool "Register CAN0"
+ select RT_USING_CAN
+ select RT_CAN_USING_HDR
+ default n
+endmenu
+
+menu "PWM Drivers"
+ config BSP_USING_AD16C4T0_PWM
+ bool "Register pwm0"
+ select RT_USING_PWM
+ default n
+
+ config BSP_USING_GP16C4T0_PWM
+ bool "Register pwm1"
+ select RT_USING_PWM
+ default n
+
+ config BSP_USING_GP16C2T0_PWM
+ bool "Register pwm2"
+ select RT_USING_PWM
+ default n
+
+ config BSP_USING_GP16C2T1_PWM
+ bool "Register pwm3"
+ select RT_USING_PWM
+ default n
+endmenu
+
+menu "HWtimer Drivers"
+ config BSP_USING_AD16C4T0_HWTIMER
+ bool "Register timer0"
+ select RT_USING_HWTIMER
+ default n
+ depends on !BSP_USING_AD16C4T0_PWM
+
+ config BSP_USING_GP16C4T0_HWTIMER
+ bool "Register timer1"
+ select RT_USING_HWTIMER
+ default n
+ depends on !BSP_USING_GP16C4T0_PWM
+
+ config BSP_USING_GP16C2T0_HWTIMER
+ bool "Register timer2"
+ select RT_USING_HWTIMER
+ default n
+ depends on !BSP_USING_GP16C2T0_PWM
+
+ config BSP_USING_GP16C2T1_HWTIMER
+ bool "Register timer3"
+ select RT_USING_HWTIMER
+ default n
+ depends on !BSP_USING_GP16C2T1_PWM
+
+ config BSP_USING_BS16T0_HWTIMER
+ bool "Register timer4"
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_BS16T1_HWTIMER
+ bool "Register timer5"
+ select RT_USING_HWTIMER
+ default n
+ depends on !BSP_USING_UART2
+
+ config BSP_USING_BS16T2_HWTIMER
+ bool "Register timer6"
+ select RT_USING_HWTIMER
+ default n
+ depends on !BSP_USING_UART3
+
+ config BSP_USING_BS16T3_HWTIMER
+ bool "Register timer7"
+ select RT_USING_HWTIMER
+ default n
+endmenu
+
+menu "RTC Drivers"
+ config BSP_USING_RTC
+ bool "Register RTC"
+ select RT_USING_RTC
+ default n
+endmenu
+
+menu "PM Drivers"
+ config BSP_USING_PM
+ bool "Using PM"
+ select RT_USING_PM
+ default n
+endmenu
+
+menu "ADC Drivers"
+ config BSP_USING_ADC0
+ bool "Using ADC"
+ select RT_USING_ADC
+ select BSP_USING_ADC
+ default n
+endmenu
+
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_adc.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_adc.h
new file mode 100644
index 0000000000..772f7a0df0
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_adc.h
@@ -0,0 +1,97 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_ADC_H__
+#define __ES_CONF_INFO_ADC_H__
+
+#include "es_conf_info_map.h"
+
+#include <ald_adc.h>
+
+
+#define ES_C_ADC_CLK_DIV_1 ADC_CKDIV_1
+#define ES_C_ADC_CLK_DIV_2 ADC_CKDIV_2
+#define ES_C_ADC_CLK_DIV_4 ADC_CKDIV_4
+#define ES_C_ADC_CLK_DIV_8 ADC_CKDIV_8
+#define ES_C_ADC_CLK_DIV_16 ADC_CKDIV_16
+#define ES_C_ADC_CLK_DIV_32 ADC_CKDIV_32
+#define ES_C_ADC_CLK_DIV_64 ADC_CKDIV_64
+#define ES_C_ADC_CLK_DIV_128 ADC_CKDIV_128
+
+#define ES_C_ADC_ALIGN_RIGHT ADC_DATAALIGN_RIGHT
+#define ES_C_ADC_ALIGN_LEFT ADC_DATAALIGN_LEFT
+
+#define ES_C_ADC_CONV_BIT_6 ADC_CONV_BIT_6
+#define ES_C_ADC_CONV_BIT_8 ADC_CONV_BIT_8
+#define ES_C_ADC_CONV_BIT_10 ADC_CONV_BIT_10
+#define ES_C_ADC_CONV_BIT_12 ADC_CONV_BIT_12
+
+#define ES_C_ADC_SAMPLE_TIME_1 ADC_SAMPLETIME_1
+#define ES_C_ADC_SAMPLE_TIME_2 ADC_SAMPLETIME_2
+#define ES_C_ADC_SAMPLE_TIME_4 ADC_SAMPLETIME_4
+#define ES_C_ADC_SAMPLE_TIME_15 ADC_SAMPLETIME_15
+
+/* ADC 配置 */
+
+/* codes_main */
+
+
+#define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
+#define ES_ADC1_ALIGN ES_C_ADC_ALIGN_RIGHT
+#define ES_ADC1_DATA_BIT ES_C_ADC_CONV_BIT_12
+#define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
+
+#ifndef ES_DEVICE_NAME_ADC0
+#define ES_DEVICE_NAME_ADC0 "adc0"
+#endif
+#ifndef ES_DEVICE_NAME_ADC1
+#define ES_DEVICE_NAME_ADC1 "adc1"
+#endif
+
+#ifndef ES_ADC0_CLK_DIV
+#define ES_ADC0_CLK_DIV ES_C_ADC_CLK_DIV_128
+#endif
+#ifndef ES_ADC0_ALIGN
+#define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
+#endif
+#ifndef ES_ADC0_DATA_BIT
+#define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
+#endif
+#ifndef ES_ADC0_NCH_SAMPLETIME
+#define ES_ADC0_NCH_SAMPLETIME ES_C_ADC_SAMPLE_TIME_4
+#endif
+
+#ifndef ES_ADC1_CLK_DIV
+#define ES_ADC1_CLK_DIV ES_C_ADC_CLK_DIV_128
+#endif
+#ifndef ES_ADC1_ALIGN
+#define ES_ADC1_ALIGN ES_C_ADC_ALIGN_RIGHT
+#endif
+#ifndef ES_ADC1_DATA_BIT
+#define ES_ADC1_DATA_BIT ES_C_ADC_CONV_BIT_12
+#endif
+#ifndef ES_ADC1_NCH_SAMPLETIME
+#define ES_ADC1_NCH_SAMPLETIME ES_C_ADC_SAMPLE_TIME_4
+#endif
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_can.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_can.h
new file mode 100644
index 0000000000..46df1ed054
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_can.h
@@ -0,0 +1,73 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_CAN_H__
+#define __ES_CONF_INFO_CAN_H__
+
+#include "es_conf_info_map.h"
+#include <ald_can.h>
+#include <ald_gpio.h>
+
+
+/*默认的CAN硬件过滤器的编号 0 */
+#define ES_C_CAN_DEFAULT_FILTER_NUMBER 0
+
+/*硬件过滤器,过滤帧类型*/
+#define ES_C_CAN_FILTER_FRAME_TYPE 0
+
+
+#define ES_C_CAN_SJW_NUM_1 CAN_SJW_1
+#define ES_C_CAN_SJW_NUM_2 CAN_SJW_2
+#define ES_C_CAN_SJW_NUM_3 CAN_SJW_3
+#define ES_C_CAN_SJW_NUM_4 CAN_SJW_4
+
+
+
+/* CAN 配置 */
+
+/* codes_main */
+
+
+
+#ifndef ES_DEVICE_NAME_CAN0
+#define ES_DEVICE_NAME_CAN0 "can0"
+#endif
+
+#ifndef ES_CAN0_AUTO_BAN_RE_T
+#define ES_CAN0_AUTO_BAN_RE_T ES_C_ENABLE
+#endif
+#ifndef ES_CAN0_SPEED
+#define ES_CAN0_SPEED 1000000
+#endif
+#ifndef ES_CAN0_SJW
+#define ES_CAN0_SJW ES_C_CAN_SJW_NUM_4
+#endif
+
+#define ES_CAN0_CONFIG \
+{ \
+ ES_CAN0_SPEED, \
+ RT_CANMSG_BOX_SZ, \
+ RT_CANSND_BOX_NUM, \
+ RT_CAN_MODE_NORMAL, \
+};
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_cmu.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_cmu.h
new file mode 100644
index 0000000000..f82c1d2b6b
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_cmu.h
@@ -0,0 +1,87 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_CMU_H__
+#define __ES_CONF_INFO_CMU_H__
+
+
+#include <ald_cmu.h>
+
+
+/* 时钟树 配置 */
+
+#define ES_C_MUL_9 CMU_PLL1_OUTPUT_36M
+#define ES_C_MUL_12 CMU_PLL1_OUTPUT_48M
+
+#define ES_C_DIV_1 CMU_DIV_1
+#define ES_C_DIV_2 CMU_DIV_2
+#define ES_C_DIV_4 CMU_DIV_4
+#define ES_C_DIV_8 CMU_DIV_8
+#define ES_C_DIV_16 CMU_DIV_16
+#define ES_C_DIV_32 CMU_DIV_32
+#define ES_C_DIV_64 CMU_DIV_64
+#define ES_C_DIV_128 CMU_DIV_128
+#define ES_C_DIV_256 CMU_DIV_256
+#define ES_C_DIV_512 CMU_DIV_512
+#define ES_C_DIV_1024 CMU_DIV_1024
+#define ES_C_DIV_2048 CMU_DIV_2048
+#define ES_C_DIV_4096 CMU_DIV_4096
+
+#define ES_C_HOSC_DIV_1 CMU_PLL1_INPUT_HOSC
+#define ES_C_HOSC_DIV_2 CMU_PLL1_INPUT_HOSC_2
+#define ES_C_HOSC_DIV_3 CMU_PLL1_INPUT_HOSC_3
+#define ES_C_HOSC_DIV_4 CMU_PLL1_INPUT_HOSC_4
+#define ES_C_HOSC_DIV_5 CMU_PLL1_INPUT_HOSC_5
+#define ES_C_HOSC_DIV_6 CMU_PLL1_INPUT_HOSC_6
+#define ES_C_HRC_DIV_6 CMU_PLL1_INPUT_HRC_6
+
+
+
+
+
+#define ES_PLL1_REFER_CLK ES_C_HOSC_DIV_3
+#define ES_PLL1_OUT_CLK ES_C_MUL_12
+#define ES_CMU_PLL1_EN ES_C_ENABLE
+#define ES_CMU_PLL1_SAFE_EN ES_C_DISABLE
+#define ES_CMU_LOSC_EN ES_C_ENABLE
+#define ES_CMU_LRC_EN ES_C_ENABLE
+#define ES_CMU_HOSC_EN ES_C_ENABLE
+#define ES_CMU_HRC_EN ES_C_ENABLE
+#define ES_CMU_SYS_DIV ES_C_DIV_1
+#define ES_CMU_HCLK_1_DIV ES_C_DIV_1
+#define ES_CMU_PCLK_1_DIV ES_C_DIV_1
+#define ES_CMU_PCLK_2_DIV ES_C_DIV_1
+#define ES_SYS_CLK_SOURSE CMU_CLOCK_PLL1
+#define ES_PLL_CLK 48000000
+#define ES_SYS_SOURCE_CLK 48000000
+#define ES_SYS_CLK 48000000
+#define ES_PCLK1_CLK 48000000
+#define ES_PCLK2_CLK 48000000
+#define ES_HCLK1_CLK 48000000
+#define ES_CMU_EXTERN_CLK_LOSC 32768
+#define ES_CMU_EXTERN_CLK_HOSC 12000000
+
+
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_gpio.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_gpio.h
new file mode 100644
index 0000000000..dc3fde3020
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_gpio.h
@@ -0,0 +1,5158 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_GPIO_H__
+#define __ES_CONF_INFO_GPIO_H__
+
+#include "es_conf_info_map.h"
+
+#include <rthw.h>
+#include <rtdevice.h>
+#include <ald_cmu.h>
+
+/* GPIO 配置 */
+
+typedef struct {
+ uint8_t pin;
+ uint8_t pin_mode;
+ uint8_t pin_level;
+ uint8_t irq_en;
+ uint8_t irq_mode;
+ void (*callback)(void *arg);
+} gpio_conf_t;
+
+/*参数的定义*/
+
+#define ES_C_GPIO_LEVEL_HIGH PIN_HIGH
+#define ES_C_GPIO_LEVEL_LOW PIN_LOW
+
+#define ES_C_GPIO_MODE_OUTPUT PIN_MODE_OUTPUT
+#define ES_C_GPIO_MODE_INPUT PIN_MODE_INPUT
+#define ES_C_GPIO_MODE_INPUT_PULLUP PIN_MODE_INPUT_PULLUP
+#define ES_C_GPIO_MODE_INPUT_PULLDOWN PIN_MODE_INPUT_PULLDOWN
+#define ES_C_GPIO_MODE_OUTPUT_OD PIN_MODE_OUTPUT_OD
+
+#define ES_C_GPIO_IRQ_ENABLE PIN_IRQ_ENABLE
+#define ES_C_GPIO_IRQ_DISABLE PIN_IRQ_DISABLE
+
+#define ES_C_GPIO_IRQ_MODE_FALL PIN_IRQ_MODE_FALLING
+#define ES_C_GPIO_IRQ_MODE_RISE PIN_IRQ_MODE_RISING
+#define ES_C_GPIO_IRQ_MODE_R_F PIN_IRQ_MODE_RISING_FALLING
+
+
+
+
+
+/* codes_main */
+//#define ES_INIT_PIN_GPIO_C_8
+//#define ES_INIT_GPIO_C_8_IRQ_EN ES_C_GPIO_IRQ_ENABLE
+
+
+
+#ifndef ES_DEVICE_NAME_PIN
+#define ES_DEVICE_NAME_PIN "pin"
+#endif
+
+/*GPIO外部中断回调函数控制需要,补充是否中断*/
+#if 11111
+
+#ifndef ES_INIT_GPIO_A_0_IRQ_EN
+#define ES_INIT_GPIO_A_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_1_IRQ_EN
+#define ES_INIT_GPIO_A_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_2_IRQ_EN
+#define ES_INIT_GPIO_A_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_3_IRQ_EN
+#define ES_INIT_GPIO_A_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_4_IRQ_EN
+#define ES_INIT_GPIO_A_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_5_IRQ_EN
+#define ES_INIT_GPIO_A_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_6_IRQ_EN
+#define ES_INIT_GPIO_A_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_7_IRQ_EN
+#define ES_INIT_GPIO_A_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_8_IRQ_EN
+#define ES_INIT_GPIO_A_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_9_IRQ_EN
+#define ES_INIT_GPIO_A_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_10_IRQ_EN
+#define ES_INIT_GPIO_A_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_11_IRQ_EN
+#define ES_INIT_GPIO_A_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_12_IRQ_EN
+#define ES_INIT_GPIO_A_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_13_IRQ_EN
+#define ES_INIT_GPIO_A_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_14_IRQ_EN
+#define ES_INIT_GPIO_A_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_15_IRQ_EN
+#define ES_INIT_GPIO_A_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_0_IRQ_EN
+#define ES_INIT_GPIO_B_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_1_IRQ_EN
+#define ES_INIT_GPIO_B_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_2_IRQ_EN
+#define ES_INIT_GPIO_B_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_3_IRQ_EN
+#define ES_INIT_GPIO_B_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_4_IRQ_EN
+#define ES_INIT_GPIO_B_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_5_IRQ_EN
+#define ES_INIT_GPIO_B_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_6_IRQ_EN
+#define ES_INIT_GPIO_B_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_7_IRQ_EN
+#define ES_INIT_GPIO_B_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_8_IRQ_EN
+#define ES_INIT_GPIO_B_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_9_IRQ_EN
+#define ES_INIT_GPIO_B_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_10_IRQ_EN
+#define ES_INIT_GPIO_B_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_11_IRQ_EN
+#define ES_INIT_GPIO_B_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_12_IRQ_EN
+#define ES_INIT_GPIO_B_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_13_IRQ_EN
+#define ES_INIT_GPIO_B_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_14_IRQ_EN
+#define ES_INIT_GPIO_B_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_15_IRQ_EN
+#define ES_INIT_GPIO_B_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_0_IRQ_EN
+#define ES_INIT_GPIO_C_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_1_IRQ_EN
+#define ES_INIT_GPIO_C_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_2_IRQ_EN
+#define ES_INIT_GPIO_C_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_3_IRQ_EN
+#define ES_INIT_GPIO_C_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_4_IRQ_EN
+#define ES_INIT_GPIO_C_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_5_IRQ_EN
+#define ES_INIT_GPIO_C_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_6_IRQ_EN
+#define ES_INIT_GPIO_C_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_7_IRQ_EN
+#define ES_INIT_GPIO_C_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_8_IRQ_EN
+#define ES_INIT_GPIO_C_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_9_IRQ_EN
+#define ES_INIT_GPIO_C_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_10_IRQ_EN
+#define ES_INIT_GPIO_C_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_11_IRQ_EN
+#define ES_INIT_GPIO_C_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_12_IRQ_EN
+#define ES_INIT_GPIO_C_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_13_IRQ_EN
+#define ES_INIT_GPIO_C_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_14_IRQ_EN
+#define ES_INIT_GPIO_C_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_15_IRQ_EN
+#define ES_INIT_GPIO_C_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_0_IRQ_EN
+#define ES_INIT_GPIO_D_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_1_IRQ_EN
+#define ES_INIT_GPIO_D_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_2_IRQ_EN
+#define ES_INIT_GPIO_D_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_3_IRQ_EN
+#define ES_INIT_GPIO_D_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_4_IRQ_EN
+#define ES_INIT_GPIO_D_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_5_IRQ_EN
+#define ES_INIT_GPIO_D_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_6_IRQ_EN
+#define ES_INIT_GPIO_D_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_7_IRQ_EN
+#define ES_INIT_GPIO_D_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_8_IRQ_EN
+#define ES_INIT_GPIO_D_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_9_IRQ_EN
+#define ES_INIT_GPIO_D_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_10_IRQ_EN
+#define ES_INIT_GPIO_D_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_11_IRQ_EN
+#define ES_INIT_GPIO_D_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_12_IRQ_EN
+#define ES_INIT_GPIO_D_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_13_IRQ_EN
+#define ES_INIT_GPIO_D_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_14_IRQ_EN
+#define ES_INIT_GPIO_D_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_15_IRQ_EN
+#define ES_INIT_GPIO_D_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_0_IRQ_EN
+#define ES_INIT_GPIO_E_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_1_IRQ_EN
+#define ES_INIT_GPIO_E_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_2_IRQ_EN
+#define ES_INIT_GPIO_E_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_3_IRQ_EN
+#define ES_INIT_GPIO_E_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_4_IRQ_EN
+#define ES_INIT_GPIO_E_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_5_IRQ_EN
+#define ES_INIT_GPIO_E_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_6_IRQ_EN
+#define ES_INIT_GPIO_E_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_7_IRQ_EN
+#define ES_INIT_GPIO_E_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_8_IRQ_EN
+#define ES_INIT_GPIO_E_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_9_IRQ_EN
+#define ES_INIT_GPIO_E_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_10_IRQ_EN
+#define ES_INIT_GPIO_E_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_11_IRQ_EN
+#define ES_INIT_GPIO_E_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_12_IRQ_EN
+#define ES_INIT_GPIO_E_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_13_IRQ_EN
+#define ES_INIT_GPIO_E_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_14_IRQ_EN
+#define ES_INIT_GPIO_E_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_15_IRQ_EN
+#define ES_INIT_GPIO_E_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_0_IRQ_EN
+#define ES_INIT_GPIO_F_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_1_IRQ_EN
+#define ES_INIT_GPIO_F_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_2_IRQ_EN
+#define ES_INIT_GPIO_F_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_3_IRQ_EN
+#define ES_INIT_GPIO_F_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_4_IRQ_EN
+#define ES_INIT_GPIO_F_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_5_IRQ_EN
+#define ES_INIT_GPIO_F_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_6_IRQ_EN
+#define ES_INIT_GPIO_F_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_7_IRQ_EN
+#define ES_INIT_GPIO_F_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_8_IRQ_EN
+#define ES_INIT_GPIO_F_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_9_IRQ_EN
+#define ES_INIT_GPIO_F_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_10_IRQ_EN
+#define ES_INIT_GPIO_F_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_11_IRQ_EN
+#define ES_INIT_GPIO_F_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_12_IRQ_EN
+#define ES_INIT_GPIO_F_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_13_IRQ_EN
+#define ES_INIT_GPIO_F_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_14_IRQ_EN
+#define ES_INIT_GPIO_F_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_15_IRQ_EN
+#define ES_INIT_GPIO_F_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_0_IRQ_EN
+#define ES_INIT_GPIO_G_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_1_IRQ_EN
+#define ES_INIT_GPIO_G_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_2_IRQ_EN
+#define ES_INIT_GPIO_G_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_3_IRQ_EN
+#define ES_INIT_GPIO_G_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_4_IRQ_EN
+#define ES_INIT_GPIO_G_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_5_IRQ_EN
+#define ES_INIT_GPIO_G_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_6_IRQ_EN
+#define ES_INIT_GPIO_G_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_7_IRQ_EN
+#define ES_INIT_GPIO_G_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_8_IRQ_EN
+#define ES_INIT_GPIO_G_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_9_IRQ_EN
+#define ES_INIT_GPIO_G_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_10_IRQ_EN
+#define ES_INIT_GPIO_G_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_11_IRQ_EN
+#define ES_INIT_GPIO_G_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_12_IRQ_EN
+#define ES_INIT_GPIO_G_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_13_IRQ_EN
+#define ES_INIT_GPIO_G_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_14_IRQ_EN
+#define ES_INIT_GPIO_G_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_15_IRQ_EN
+#define ES_INIT_GPIO_G_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_0_IRQ_EN
+#define ES_INIT_GPIO_H_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_1_IRQ_EN
+#define ES_INIT_GPIO_H_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_2_IRQ_EN
+#define ES_INIT_GPIO_H_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_3_IRQ_EN
+#define ES_INIT_GPIO_H_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_4_IRQ_EN
+#define ES_INIT_GPIO_H_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_5_IRQ_EN
+#define ES_INIT_GPIO_H_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_6_IRQ_EN
+#define ES_INIT_GPIO_H_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_7_IRQ_EN
+#define ES_INIT_GPIO_H_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_8_IRQ_EN
+#define ES_INIT_GPIO_H_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_9_IRQ_EN
+#define ES_INIT_GPIO_H_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_10_IRQ_EN
+#define ES_INIT_GPIO_H_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_11_IRQ_EN
+#define ES_INIT_GPIO_H_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_12_IRQ_EN
+#define ES_INIT_GPIO_H_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_13_IRQ_EN
+#define ES_INIT_GPIO_H_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_14_IRQ_EN
+#define ES_INIT_GPIO_H_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_15_IRQ_EN
+#define ES_INIT_GPIO_H_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#endif //11111
+
+
+
+/*是否需要 GPIO外部中断回调函数 (控制函数本体+声明)*/
+#if 11111
+
+#if (ES_INIT_GPIO_A_0_IRQ_EN)||(ES_INIT_GPIO_B_0_IRQ_EN)||(ES_INIT_GPIO_C_0_IRQ_EN)||(ES_INIT_GPIO_D_0_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_0_IRQ_EN)||(ES_INIT_GPIO_F_0_IRQ_EN)||(ES_INIT_GPIO_G_0_IRQ_EN)||(ES_INIT_GPIO_H_0_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_0
+#endif
+
+#if (ES_INIT_GPIO_A_1_IRQ_EN)||(ES_INIT_GPIO_B_1_IRQ_EN)||(ES_INIT_GPIO_C_1_IRQ_EN)||(ES_INIT_GPIO_D_1_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_1_IRQ_EN)||(ES_INIT_GPIO_F_1_IRQ_EN)||(ES_INIT_GPIO_G_1_IRQ_EN)||(ES_INIT_GPIO_H_1_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_1
+#endif
+
+#if (ES_INIT_GPIO_A_2_IRQ_EN)||(ES_INIT_GPIO_B_2_IRQ_EN)||(ES_INIT_GPIO_C_2_IRQ_EN)||(ES_INIT_GPIO_D_2_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_2_IRQ_EN)||(ES_INIT_GPIO_F_2_IRQ_EN)||(ES_INIT_GPIO_G_2_IRQ_EN)||(ES_INIT_GPIO_H_2_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_2
+#endif
+
+#if (ES_INIT_GPIO_A_3_IRQ_EN)||(ES_INIT_GPIO_B_3_IRQ_EN)||(ES_INIT_GPIO_C_3_IRQ_EN)||(ES_INIT_GPIO_D_3_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_3_IRQ_EN)||(ES_INIT_GPIO_F_3_IRQ_EN)||(ES_INIT_GPIO_G_3_IRQ_EN)||(ES_INIT_GPIO_H_3_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_3
+#endif
+
+#if (ES_INIT_GPIO_A_4_IRQ_EN)||(ES_INIT_GPIO_B_4_IRQ_EN)||(ES_INIT_GPIO_C_4_IRQ_EN)||(ES_INIT_GPIO_D_4_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_4_IRQ_EN)||(ES_INIT_GPIO_F_4_IRQ_EN)||(ES_INIT_GPIO_G_4_IRQ_EN)||(ES_INIT_GPIO_H_4_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_4
+#endif
+
+#if (ES_INIT_GPIO_A_5_IRQ_EN)||(ES_INIT_GPIO_B_5_IRQ_EN)||(ES_INIT_GPIO_C_5_IRQ_EN)||(ES_INIT_GPIO_D_5_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_5_IRQ_EN)||(ES_INIT_GPIO_F_5_IRQ_EN)||(ES_INIT_GPIO_G_5_IRQ_EN)||(ES_INIT_GPIO_H_5_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_5
+#endif
+
+#if (ES_INIT_GPIO_A_6_IRQ_EN)||(ES_INIT_GPIO_B_6_IRQ_EN)||(ES_INIT_GPIO_C_6_IRQ_EN)||(ES_INIT_GPIO_D_6_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_6_IRQ_EN)||(ES_INIT_GPIO_F_6_IRQ_EN)||(ES_INIT_GPIO_G_6_IRQ_EN)||(ES_INIT_GPIO_H_6_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_6
+#endif
+
+#if (ES_INIT_GPIO_A_7_IRQ_EN)||(ES_INIT_GPIO_B_7_IRQ_EN)||(ES_INIT_GPIO_C_7_IRQ_EN)||(ES_INIT_GPIO_D_7_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_7_IRQ_EN)||(ES_INIT_GPIO_F_7_IRQ_EN)||(ES_INIT_GPIO_G_7_IRQ_EN)||(ES_INIT_GPIO_H_7_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_7
+#endif
+
+#if (ES_INIT_GPIO_A_8_IRQ_EN)||(ES_INIT_GPIO_B_8_IRQ_EN)||(ES_INIT_GPIO_C_8_IRQ_EN)||(ES_INIT_GPIO_D_8_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_8_IRQ_EN)||(ES_INIT_GPIO_F_8_IRQ_EN)||(ES_INIT_GPIO_G_8_IRQ_EN)||(ES_INIT_GPIO_H_8_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_8
+#endif
+
+#if (ES_INIT_GPIO_A_9_IRQ_EN)||(ES_INIT_GPIO_B_9_IRQ_EN)||(ES_INIT_GPIO_C_9_IRQ_EN)||(ES_INIT_GPIO_D_9_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_9_IRQ_EN)||(ES_INIT_GPIO_F_9_IRQ_EN)||(ES_INIT_GPIO_G_9_IRQ_EN)||(ES_INIT_GPIO_H_9_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_9
+#endif
+
+#if (ES_INIT_GPIO_A_10_IRQ_EN)||(ES_INIT_GPIO_B_10_IRQ_EN)||(ES_INIT_GPIO_C_10_IRQ_EN)||(ES_INIT_GPIO_D_10_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_10_IRQ_EN)||(ES_INIT_GPIO_F_10_IRQ_EN)||(ES_INIT_GPIO_G_10_IRQ_EN)||(ES_INIT_GPIO_H_10_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_10
+#endif
+
+#if (ES_INIT_GPIO_A_11_IRQ_EN)||(ES_INIT_GPIO_B_11_IRQ_EN)||(ES_INIT_GPIO_C_11_IRQ_EN)||(ES_INIT_GPIO_D_11_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_11_IRQ_EN)||(ES_INIT_GPIO_F_11_IRQ_EN)||(ES_INIT_GPIO_G_11_IRQ_EN)||(ES_INIT_GPIO_H_11_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_11
+#endif
+
+#if (ES_INIT_GPIO_A_12_IRQ_EN)||(ES_INIT_GPIO_B_12_IRQ_EN)||(ES_INIT_GPIO_C_12_IRQ_EN)||(ES_INIT_GPIO_D_12_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_12_IRQ_EN)||(ES_INIT_GPIO_F_12_IRQ_EN)||(ES_INIT_GPIO_G_12_IRQ_EN)||(ES_INIT_GPIO_H_12_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_12
+#endif
+
+#if (ES_INIT_GPIO_A_13_IRQ_EN)||(ES_INIT_GPIO_B_13_IRQ_EN)||(ES_INIT_GPIO_C_13_IRQ_EN)||(ES_INIT_GPIO_D_13_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_13_IRQ_EN)||(ES_INIT_GPIO_F_13_IRQ_EN)||(ES_INIT_GPIO_G_13_IRQ_EN)||(ES_INIT_GPIO_H_13_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_13
+#endif
+
+#if (ES_INIT_GPIO_A_14_IRQ_EN)||(ES_INIT_GPIO_B_14_IRQ_EN)||(ES_INIT_GPIO_C_14_IRQ_EN)||(ES_INIT_GPIO_D_14_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_14_IRQ_EN)||(ES_INIT_GPIO_F_14_IRQ_EN)||(ES_INIT_GPIO_G_14_IRQ_EN)||(ES_INIT_GPIO_H_14_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_14
+#endif
+
+#if (ES_INIT_GPIO_A_15_IRQ_EN)||(ES_INIT_GPIO_B_15_IRQ_EN)||(ES_INIT_GPIO_C_15_IRQ_EN)||(ES_INIT_GPIO_D_15_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_15_IRQ_EN)||(ES_INIT_GPIO_F_15_IRQ_EN)||(ES_INIT_GPIO_G_15_IRQ_EN)||(ES_INIT_GPIO_H_15_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_15
+#endif
+
+#endif //11111
+
+
+/*GPIO外部中断 声明*/
+#if 11111
+
+#ifdef ES_CONF_EXTI_IRQ_0
+void irq_pin0_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_1
+void irq_pin1_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_2
+void irq_pin2_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_3
+void irq_pin3_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_4
+void irq_pin4_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_5
+void irq_pin5_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_6
+void irq_pin6_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_7
+void irq_pin7_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_8
+void irq_pin8_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_9
+void irq_pin9_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_10
+void irq_pin10_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_11
+void irq_pin11_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_12
+void irq_pin12_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_13
+void irq_pin13_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_14
+void irq_pin14_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_15
+void irq_pin15_callback(void* arg);
+#endif
+
+
+#endif //11111
+
+
+
+
+/*是否有配置的管脚*/
+#if defined(ES_INIT_PIN_GPIO_A_0) || defined(ES_INIT_PIN_GPIO_A_1) || defined(ES_INIT_PIN_GPIO_A_2) || defined(ES_INIT_PIN_GPIO_A_3) || \
+ defined(ES_INIT_PIN_GPIO_A_4) || defined(ES_INIT_PIN_GPIO_A_5) || defined(ES_INIT_PIN_GPIO_A_6) || defined(ES_INIT_PIN_GPIO_A_7) || \
+ defined(ES_INIT_PIN_GPIO_A_8) || defined(ES_INIT_PIN_GPIO_A_9) || defined(ES_INIT_PIN_GPIO_A_10) || defined(ES_INIT_PIN_GPIO_A_11) || \
+ defined(ES_INIT_PIN_GPIO_A_12) || defined(ES_INIT_PIN_GPIO_A_13) || defined(ES_INIT_PIN_GPIO_A_14) || defined(ES_INIT_PIN_GPIO_A_15) || \
+ defined(ES_INIT_PIN_GPIO_B_0) || defined(ES_INIT_PIN_GPIO_B_1) || defined(ES_INIT_PIN_GPIO_B_2) || defined(ES_INIT_PIN_GPIO_B_3) || \
+ defined(ES_INIT_PIN_GPIO_B_4) || defined(ES_INIT_PIN_GPIO_B_5) || defined(ES_INIT_PIN_GPIO_B_6) || defined(ES_INIT_PIN_GPIO_B_7) || \
+ defined(ES_INIT_PIN_GPIO_B_8) || defined(ES_INIT_PIN_GPIO_B_9) || defined(ES_INIT_PIN_GPIO_B_10) || defined(ES_INIT_PIN_GPIO_B_11) || \
+ defined(ES_INIT_PIN_GPIO_B_12) || defined(ES_INIT_PIN_GPIO_B_13) || defined(ES_INIT_PIN_GPIO_B_14) || defined(ES_INIT_PIN_GPIO_B_15) || \
+ defined(ES_INIT_PIN_GPIO_C_0) || defined(ES_INIT_PIN_GPIO_C_1) || defined(ES_INIT_PIN_GPIO_C_2) || defined(ES_INIT_PIN_GPIO_C_3) || \
+ defined(ES_INIT_PIN_GPIO_C_4) || defined(ES_INIT_PIN_GPIO_C_5) || defined(ES_INIT_PIN_GPIO_C_6) || defined(ES_INIT_PIN_GPIO_C_7) || \
+ defined(ES_INIT_PIN_GPIO_C_8) || defined(ES_INIT_PIN_GPIO_C_9) || defined(ES_INIT_PIN_GPIO_C_10) || defined(ES_INIT_PIN_GPIO_C_11) || \
+ defined(ES_INIT_PIN_GPIO_C_12) || defined(ES_INIT_PIN_GPIO_C_13) || defined(ES_INIT_PIN_GPIO_C_14) || defined(ES_INIT_PIN_GPIO_C_15) || \
+ defined(ES_INIT_PIN_GPIO_D_0) || defined(ES_INIT_PIN_GPIO_D_1) || defined(ES_INIT_PIN_GPIO_D_2) || defined(ES_INIT_PIN_GPIO_D_3) || \
+ defined(ES_INIT_PIN_GPIO_D_4) || defined(ES_INIT_PIN_GPIO_D_5) || defined(ES_INIT_PIN_GPIO_D_6) || defined(ES_INIT_PIN_GPIO_D_7) || \
+ defined(ES_INIT_PIN_GPIO_D_8) || defined(ES_INIT_PIN_GPIO_D_9) || defined(ES_INIT_PIN_GPIO_D_10) || defined(ES_INIT_PIN_GPIO_D_11) || \
+ defined(ES_INIT_PIN_GPIO_D_12) || defined(ES_INIT_PIN_GPIO_D_13) || defined(ES_INIT_PIN_GPIO_D_14) || defined(ES_INIT_PIN_GPIO_D_15) || \
+ defined(ES_INIT_PIN_GPIO_E_0) || defined(ES_INIT_PIN_GPIO_E_1) || defined(ES_INIT_PIN_GPIO_E_2) || defined(ES_INIT_PIN_GPIO_E_3) || \
+ defined(ES_INIT_PIN_GPIO_E_4) || defined(ES_INIT_PIN_GPIO_E_5) || defined(ES_INIT_PIN_GPIO_E_6) || defined(ES_INIT_PIN_GPIO_E_7) || \
+ defined(ES_INIT_PIN_GPIO_E_8) || defined(ES_INIT_PIN_GPIO_E_9) || defined(ES_INIT_PIN_GPIO_E_10) || defined(ES_INIT_PIN_GPIO_E_11) || \
+ defined(ES_INIT_PIN_GPIO_E_12) || defined(ES_INIT_PIN_GPIO_E_13) || defined(ES_INIT_PIN_GPIO_E_14) || defined(ES_INIT_PIN_GPIO_E_15) || \
+ defined(ES_INIT_PIN_GPIO_F_0) || defined(ES_INIT_PIN_GPIO_F_1) || defined(ES_INIT_PIN_GPIO_F_2) || defined(ES_INIT_PIN_GPIO_F_3) || \
+ defined(ES_INIT_PIN_GPIO_F_4) || defined(ES_INIT_PIN_GPIO_F_5) || defined(ES_INIT_PIN_GPIO_F_6) || defined(ES_INIT_PIN_GPIO_F_7) || \
+ defined(ES_INIT_PIN_GPIO_F_8) || defined(ES_INIT_PIN_GPIO_F_9) || defined(ES_INIT_PIN_GPIO_F_10) || defined(ES_INIT_PIN_GPIO_F_11) || \
+ defined(ES_INIT_PIN_GPIO_F_12) || defined(ES_INIT_PIN_GPIO_F_13) || defined(ES_INIT_PIN_GPIO_F_14) || defined(ES_INIT_PIN_GPIO_F_15) || \
+ defined(ES_INIT_PIN_GPIO_G_0) || defined(ES_INIT_PIN_GPIO_G_1) || defined(ES_INIT_PIN_GPIO_G_2) || defined(ES_INIT_PIN_GPIO_G_3) || \
+ defined(ES_INIT_PIN_GPIO_G_4) || defined(ES_INIT_PIN_GPIO_G_5) || defined(ES_INIT_PIN_GPIO_G_6) || defined(ES_INIT_PIN_GPIO_G_7) || \
+ defined(ES_INIT_PIN_GPIO_G_8) || defined(ES_INIT_PIN_GPIO_G_9) || defined(ES_INIT_PIN_GPIO_G_10) || defined(ES_INIT_PIN_GPIO_G_11) || \
+ defined(ES_INIT_PIN_GPIO_G_12) || defined(ES_INIT_PIN_GPIO_G_13) || defined(ES_INIT_PIN_GPIO_G_14) || defined(ES_INIT_PIN_GPIO_G_15) || \
+ defined(ES_INIT_PIN_GPIO_H_0) || defined(ES_INIT_PIN_GPIO_H_1) || defined(ES_INIT_PIN_GPIO_H_2) || defined(ES_INIT_PIN_GPIO_H_3) || \
+ defined(ES_INIT_PIN_GPIO_H_4) || defined(ES_INIT_PIN_GPIO_H_5) || defined(ES_INIT_PIN_GPIO_H_6) || defined(ES_INIT_PIN_GPIO_H_7) || \
+ defined(ES_INIT_PIN_GPIO_H_8) || defined(ES_INIT_PIN_GPIO_H_9) || defined(ES_INIT_PIN_GPIO_H_10) || defined(ES_INIT_PIN_GPIO_H_11) || \
+ defined(ES_INIT_PIN_GPIO_H_12) || defined(ES_INIT_PIN_GPIO_H_13) || defined(ES_INIT_PIN_GPIO_H_14) || defined(ES_INIT_PIN_GPIO_H_15)
+
+#define ES_INIT_GPIOS
+
+#endif
+
+
+#ifdef ES_INIT_GPIOS
+
+static gpio_conf_t gpio_conf_all[] =
+{
+
+#ifdef ES_INIT_PIN_GPIO_A_0
+
+ {
+ ES_PIN_GPIO_A_0 ,
+
+#ifdef ES_INIT_GPIO_A_0_MODE
+ ES_INIT_GPIO_A_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_0_LEVEL
+ ES_INIT_GPIO_A_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_0_IRQ_MODE
+ ES_INIT_GPIO_A_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_1
+
+ {
+ ES_PIN_GPIO_A_1 ,
+
+#ifdef ES_INIT_GPIO_A_1_MODE
+ ES_INIT_GPIO_A_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_1_LEVEL
+ ES_INIT_GPIO_A_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_1_IRQ_MODE
+ ES_INIT_GPIO_A_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_2
+
+ {
+ ES_PIN_GPIO_A_2 ,
+
+#ifdef ES_INIT_GPIO_A_2_MODE
+ ES_INIT_GPIO_A_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_2_LEVEL
+ ES_INIT_GPIO_A_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_2_IRQ_MODE
+ ES_INIT_GPIO_A_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_3
+
+ {
+ ES_PIN_GPIO_A_3 ,
+
+#ifdef ES_INIT_GPIO_A_3_MODE
+ ES_INIT_GPIO_A_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_3_LEVEL
+ ES_INIT_GPIO_A_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_3_IRQ_MODE
+ ES_INIT_GPIO_A_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_4
+
+ {
+ ES_PIN_GPIO_A_4 ,
+
+#ifdef ES_INIT_GPIO_A_4_MODE
+ ES_INIT_GPIO_A_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_4_LEVEL
+ ES_INIT_GPIO_A_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_4_IRQ_MODE
+ ES_INIT_GPIO_A_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_5
+
+ {
+ ES_PIN_GPIO_A_5 ,
+
+#ifdef ES_INIT_GPIO_A_5_MODE
+ ES_INIT_GPIO_A_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_5_LEVEL
+ ES_INIT_GPIO_A_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_5_IRQ_MODE
+ ES_INIT_GPIO_A_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_6
+
+ {
+ ES_PIN_GPIO_A_6 ,
+
+#ifdef ES_INIT_GPIO_A_6_MODE
+ ES_INIT_GPIO_A_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_6_LEVEL
+ ES_INIT_GPIO_A_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_6_IRQ_MODE
+ ES_INIT_GPIO_A_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_7
+
+ {
+ ES_PIN_GPIO_A_7 ,
+
+#ifdef ES_INIT_GPIO_A_7_MODE
+ ES_INIT_GPIO_A_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_7_LEVEL
+ ES_INIT_GPIO_A_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_7_IRQ_MODE
+ ES_INIT_GPIO_A_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_8
+
+ {
+ ES_PIN_GPIO_A_8 ,
+
+#ifdef ES_INIT_GPIO_A_8_MODE
+ ES_INIT_GPIO_A_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_8_LEVEL
+ ES_INIT_GPIO_A_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_8_IRQ_MODE
+ ES_INIT_GPIO_A_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_9
+
+ {
+ ES_PIN_GPIO_A_9 ,
+
+#ifdef ES_INIT_GPIO_A_9_MODE
+ ES_INIT_GPIO_A_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_9_LEVEL
+ ES_INIT_GPIO_A_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_9_IRQ_MODE
+ ES_INIT_GPIO_A_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_10
+
+ {
+ ES_PIN_GPIO_A_10 ,
+
+#ifdef ES_INIT_GPIO_A_10_MODE
+ ES_INIT_GPIO_A_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_10_LEVEL
+ ES_INIT_GPIO_A_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_10_IRQ_MODE
+ ES_INIT_GPIO_A_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_11
+
+ {
+ ES_PIN_GPIO_A_11 ,
+
+#ifdef ES_INIT_GPIO_A_11_MODE
+ ES_INIT_GPIO_A_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_11_LEVEL
+ ES_INIT_GPIO_A_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_11_IRQ_MODE
+ ES_INIT_GPIO_A_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_12
+
+ {
+ ES_PIN_GPIO_A_12 ,
+
+#ifdef ES_INIT_GPIO_A_12_MODE
+ ES_INIT_GPIO_A_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_12_LEVEL
+ ES_INIT_GPIO_A_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_12_IRQ_MODE
+ ES_INIT_GPIO_A_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_13
+
+ {
+ ES_PIN_GPIO_A_13 ,
+
+#ifdef ES_INIT_GPIO_A_13_MODE
+ ES_INIT_GPIO_A_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_13_LEVEL
+ ES_INIT_GPIO_A_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_13_IRQ_MODE
+ ES_INIT_GPIO_A_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_14
+
+ {
+ ES_PIN_GPIO_A_14 ,
+
+#ifdef ES_INIT_GPIO_A_14_MODE
+ ES_INIT_GPIO_A_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_14_LEVEL
+ ES_INIT_GPIO_A_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_14_IRQ_MODE
+ ES_INIT_GPIO_A_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_15
+
+ {
+ ES_PIN_GPIO_A_15 ,
+
+#ifdef ES_INIT_GPIO_A_15_MODE
+ ES_INIT_GPIO_A_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_15_LEVEL
+ ES_INIT_GPIO_A_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_15_IRQ_MODE
+ ES_INIT_GPIO_A_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_0
+
+ {
+ ES_PIN_GPIO_B_0 ,
+
+#ifdef ES_INIT_GPIO_B_0_MODE
+ ES_INIT_GPIO_B_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_0_LEVEL
+ ES_INIT_GPIO_B_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_0_IRQ_MODE
+ ES_INIT_GPIO_B_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_1
+
+ {
+ ES_PIN_GPIO_B_1 ,
+
+#ifdef ES_INIT_GPIO_B_1_MODE
+ ES_INIT_GPIO_B_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_1_LEVEL
+ ES_INIT_GPIO_B_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_1_IRQ_MODE
+ ES_INIT_GPIO_B_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_2
+
+ {
+ ES_PIN_GPIO_B_2 ,
+
+#ifdef ES_INIT_GPIO_B_2_MODE
+ ES_INIT_GPIO_B_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_2_LEVEL
+ ES_INIT_GPIO_B_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_2_IRQ_MODE
+ ES_INIT_GPIO_B_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_3
+
+ {
+ ES_PIN_GPIO_B_3 ,
+
+#ifdef ES_INIT_GPIO_B_3_MODE
+ ES_INIT_GPIO_B_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_3_LEVEL
+ ES_INIT_GPIO_B_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_3_IRQ_MODE
+ ES_INIT_GPIO_B_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_4
+
+ {
+ ES_PIN_GPIO_B_4 ,
+
+#ifdef ES_INIT_GPIO_B_4_MODE
+ ES_INIT_GPIO_B_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_4_LEVEL
+ ES_INIT_GPIO_B_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_4_IRQ_MODE
+ ES_INIT_GPIO_B_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_5
+
+ {
+ ES_PIN_GPIO_B_5 ,
+
+#ifdef ES_INIT_GPIO_B_5_MODE
+ ES_INIT_GPIO_B_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_5_LEVEL
+ ES_INIT_GPIO_B_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_5_IRQ_MODE
+ ES_INIT_GPIO_B_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_6
+
+ {
+ ES_PIN_GPIO_B_6 ,
+
+#ifdef ES_INIT_GPIO_B_6_MODE
+ ES_INIT_GPIO_B_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_6_LEVEL
+ ES_INIT_GPIO_B_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_6_IRQ_MODE
+ ES_INIT_GPIO_B_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_7
+
+ {
+ ES_PIN_GPIO_B_7 ,
+
+#ifdef ES_INIT_GPIO_B_7_MODE
+ ES_INIT_GPIO_B_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_7_LEVEL
+ ES_INIT_GPIO_B_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_7_IRQ_MODE
+ ES_INIT_GPIO_B_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_8
+
+ {
+ ES_PIN_GPIO_B_8 ,
+
+#ifdef ES_INIT_GPIO_B_8_MODE
+ ES_INIT_GPIO_B_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_8_LEVEL
+ ES_INIT_GPIO_B_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_8_IRQ_MODE
+ ES_INIT_GPIO_B_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_9
+
+ {
+ ES_PIN_GPIO_B_9 ,
+
+#ifdef ES_INIT_GPIO_B_9_MODE
+ ES_INIT_GPIO_B_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_9_LEVEL
+ ES_INIT_GPIO_B_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_9_IRQ_MODE
+ ES_INIT_GPIO_B_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_10
+
+ {
+ ES_PIN_GPIO_B_10 ,
+
+#ifdef ES_INIT_GPIO_B_10_MODE
+ ES_INIT_GPIO_B_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_10_LEVEL
+ ES_INIT_GPIO_B_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_10_IRQ_MODE
+ ES_INIT_GPIO_B_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_11
+
+ {
+ ES_PIN_GPIO_B_11 ,
+
+#ifdef ES_INIT_GPIO_B_11_MODE
+ ES_INIT_GPIO_B_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_11_LEVEL
+ ES_INIT_GPIO_B_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_11_IRQ_MODE
+ ES_INIT_GPIO_B_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_12
+
+ {
+ ES_PIN_GPIO_B_12 ,
+
+#ifdef ES_INIT_GPIO_B_12_MODE
+ ES_INIT_GPIO_B_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_12_LEVEL
+ ES_INIT_GPIO_B_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_12_IRQ_MODE
+ ES_INIT_GPIO_B_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_13
+
+ {
+ ES_PIN_GPIO_B_13 ,
+
+#ifdef ES_INIT_GPIO_B_13_MODE
+ ES_INIT_GPIO_B_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_13_LEVEL
+ ES_INIT_GPIO_B_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_13_IRQ_MODE
+ ES_INIT_GPIO_B_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_14
+
+ {
+ ES_PIN_GPIO_B_14 ,
+
+#ifdef ES_INIT_GPIO_B_14_MODE
+ ES_INIT_GPIO_B_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_14_LEVEL
+ ES_INIT_GPIO_B_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_14_IRQ_MODE
+ ES_INIT_GPIO_B_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_15
+
+ {
+ ES_PIN_GPIO_B_15 ,
+
+#ifdef ES_INIT_GPIO_B_15_MODE
+ ES_INIT_GPIO_B_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_15_LEVEL
+ ES_INIT_GPIO_B_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_15_IRQ_MODE
+ ES_INIT_GPIO_B_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_0
+
+ {
+ ES_PIN_GPIO_C_0 ,
+
+#ifdef ES_INIT_GPIO_C_0_MODE
+ ES_INIT_GPIO_C_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_0_LEVEL
+ ES_INIT_GPIO_C_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_0_IRQ_MODE
+ ES_INIT_GPIO_C_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_1
+
+ {
+ ES_PIN_GPIO_C_1 ,
+
+#ifdef ES_INIT_GPIO_C_1_MODE
+ ES_INIT_GPIO_C_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_1_LEVEL
+ ES_INIT_GPIO_C_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_1_IRQ_MODE
+ ES_INIT_GPIO_C_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_2
+
+ {
+ ES_PIN_GPIO_C_2 ,
+
+#ifdef ES_INIT_GPIO_C_2_MODE
+ ES_INIT_GPIO_C_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_2_LEVEL
+ ES_INIT_GPIO_C_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_2_IRQ_MODE
+ ES_INIT_GPIO_C_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_3
+
+ {
+ ES_PIN_GPIO_C_3 ,
+
+#ifdef ES_INIT_GPIO_C_3_MODE
+ ES_INIT_GPIO_C_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_3_LEVEL
+ ES_INIT_GPIO_C_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_3_IRQ_MODE
+ ES_INIT_GPIO_C_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_4
+
+ {
+ ES_PIN_GPIO_C_4 ,
+
+#ifdef ES_INIT_GPIO_C_4_MODE
+ ES_INIT_GPIO_C_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_4_LEVEL
+ ES_INIT_GPIO_C_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_4_IRQ_MODE
+ ES_INIT_GPIO_C_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_5
+
+ {
+ ES_PIN_GPIO_C_5 ,
+
+#ifdef ES_INIT_GPIO_C_5_MODE
+ ES_INIT_GPIO_C_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_5_LEVEL
+ ES_INIT_GPIO_C_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_5_IRQ_MODE
+ ES_INIT_GPIO_C_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_6
+
+ {
+ ES_PIN_GPIO_C_6 ,
+
+#ifdef ES_INIT_GPIO_C_6_MODE
+ ES_INIT_GPIO_C_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_6_LEVEL
+ ES_INIT_GPIO_C_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_6_IRQ_MODE
+ ES_INIT_GPIO_C_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_7
+
+ {
+ ES_PIN_GPIO_C_7 ,
+
+#ifdef ES_INIT_GPIO_C_7_MODE
+ ES_INIT_GPIO_C_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_7_LEVEL
+ ES_INIT_GPIO_C_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_7_IRQ_MODE
+ ES_INIT_GPIO_C_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_8
+
+ {
+ ES_PIN_GPIO_C_8 ,
+
+#ifdef ES_INIT_GPIO_C_8_MODE
+ ES_INIT_GPIO_C_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_8_LEVEL
+ ES_INIT_GPIO_C_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_8_IRQ_MODE
+ ES_INIT_GPIO_C_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_9
+
+ {
+ ES_PIN_GPIO_C_9 ,
+
+#ifdef ES_INIT_GPIO_C_9_MODE
+ ES_INIT_GPIO_C_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_9_LEVEL
+ ES_INIT_GPIO_C_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_9_IRQ_MODE
+ ES_INIT_GPIO_C_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_10
+
+ {
+ ES_PIN_GPIO_C_10 ,
+
+#ifdef ES_INIT_GPIO_C_10_MODE
+ ES_INIT_GPIO_C_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_10_LEVEL
+ ES_INIT_GPIO_C_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_10_IRQ_MODE
+ ES_INIT_GPIO_C_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_11
+
+ {
+ ES_PIN_GPIO_C_11 ,
+
+#ifdef ES_INIT_GPIO_C_11_MODE
+ ES_INIT_GPIO_C_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_11_LEVEL
+ ES_INIT_GPIO_C_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_11_IRQ_MODE
+ ES_INIT_GPIO_C_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_12
+
+ {
+ ES_PIN_GPIO_C_12 ,
+
+#ifdef ES_INIT_GPIO_C_12_MODE
+ ES_INIT_GPIO_C_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_12_LEVEL
+ ES_INIT_GPIO_C_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_12_IRQ_MODE
+ ES_INIT_GPIO_C_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_13
+
+ {
+ ES_PIN_GPIO_C_13 ,
+
+#ifdef ES_INIT_GPIO_C_13_MODE
+ ES_INIT_GPIO_C_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_13_LEVEL
+ ES_INIT_GPIO_C_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_13_IRQ_MODE
+ ES_INIT_GPIO_C_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_14
+
+ {
+ ES_PIN_GPIO_C_14 ,
+
+#ifdef ES_INIT_GPIO_C_14_MODE
+ ES_INIT_GPIO_C_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_14_LEVEL
+ ES_INIT_GPIO_C_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_14_IRQ_MODE
+ ES_INIT_GPIO_C_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_15
+
+ {
+ ES_PIN_GPIO_C_15 ,
+
+#ifdef ES_INIT_GPIO_C_15_MODE
+ ES_INIT_GPIO_C_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_15_LEVEL
+ ES_INIT_GPIO_C_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_15_IRQ_MODE
+ ES_INIT_GPIO_C_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_0
+
+ {
+ ES_PIN_GPIO_D_0 ,
+
+#ifdef ES_INIT_GPIO_D_0_MODE
+ ES_INIT_GPIO_D_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_0_LEVEL
+ ES_INIT_GPIO_D_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_0_IRQ_MODE
+ ES_INIT_GPIO_D_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_1
+
+ {
+ ES_PIN_GPIO_D_1 ,
+
+#ifdef ES_INIT_GPIO_D_1_MODE
+ ES_INIT_GPIO_D_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_1_LEVEL
+ ES_INIT_GPIO_D_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_1_IRQ_MODE
+ ES_INIT_GPIO_D_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_2
+
+ {
+ ES_PIN_GPIO_D_2 ,
+
+#ifdef ES_INIT_GPIO_D_2_MODE
+ ES_INIT_GPIO_D_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_2_LEVEL
+ ES_INIT_GPIO_D_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_2_IRQ_MODE
+ ES_INIT_GPIO_D_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_3
+
+ {
+ ES_PIN_GPIO_D_3 ,
+
+#ifdef ES_INIT_GPIO_D_3_MODE
+ ES_INIT_GPIO_D_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_3_LEVEL
+ ES_INIT_GPIO_D_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_3_IRQ_MODE
+ ES_INIT_GPIO_D_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_4
+
+ {
+ ES_PIN_GPIO_D_4 ,
+
+#ifdef ES_INIT_GPIO_D_4_MODE
+ ES_INIT_GPIO_D_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_4_LEVEL
+ ES_INIT_GPIO_D_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_4_IRQ_MODE
+ ES_INIT_GPIO_D_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_5
+
+ {
+ ES_PIN_GPIO_D_5 ,
+
+#ifdef ES_INIT_GPIO_D_5_MODE
+ ES_INIT_GPIO_D_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_5_LEVEL
+ ES_INIT_GPIO_D_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_5_IRQ_MODE
+ ES_INIT_GPIO_D_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_6
+
+ {
+ ES_PIN_GPIO_D_6 ,
+
+#ifdef ES_INIT_GPIO_D_6_MODE
+ ES_INIT_GPIO_D_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_6_LEVEL
+ ES_INIT_GPIO_D_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_6_IRQ_MODE
+ ES_INIT_GPIO_D_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_7
+
+ {
+ ES_PIN_GPIO_D_7 ,
+
+#ifdef ES_INIT_GPIO_D_7_MODE
+ ES_INIT_GPIO_D_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_7_LEVEL
+ ES_INIT_GPIO_D_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_7_IRQ_MODE
+ ES_INIT_GPIO_D_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_8
+
+ {
+ ES_PIN_GPIO_D_8 ,
+
+#ifdef ES_INIT_GPIO_D_8_MODE
+ ES_INIT_GPIO_D_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_8_LEVEL
+ ES_INIT_GPIO_D_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_8_IRQ_MODE
+ ES_INIT_GPIO_D_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_9
+
+ {
+ ES_PIN_GPIO_D_9 ,
+
+#ifdef ES_INIT_GPIO_D_9_MODE
+ ES_INIT_GPIO_D_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_9_LEVEL
+ ES_INIT_GPIO_D_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_9_IRQ_MODE
+ ES_INIT_GPIO_D_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_10
+
+ {
+ ES_PIN_GPIO_D_10 ,
+
+#ifdef ES_INIT_GPIO_D_10_MODE
+ ES_INIT_GPIO_D_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_10_LEVEL
+ ES_INIT_GPIO_D_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_10_IRQ_MODE
+ ES_INIT_GPIO_D_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_11
+
+ {
+ ES_PIN_GPIO_D_11 ,
+
+#ifdef ES_INIT_GPIO_D_11_MODE
+ ES_INIT_GPIO_D_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_11_LEVEL
+ ES_INIT_GPIO_D_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_11_IRQ_MODE
+ ES_INIT_GPIO_D_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_12
+
+ {
+ ES_PIN_GPIO_D_12 ,
+
+#ifdef ES_INIT_GPIO_D_12_MODE
+ ES_INIT_GPIO_D_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_12_LEVEL
+ ES_INIT_GPIO_D_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_12_IRQ_MODE
+ ES_INIT_GPIO_D_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_13
+
+ {
+ ES_PIN_GPIO_D_13 ,
+
+#ifdef ES_INIT_GPIO_D_13_MODE
+ ES_INIT_GPIO_D_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_13_LEVEL
+ ES_INIT_GPIO_D_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_13_IRQ_MODE
+ ES_INIT_GPIO_D_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_14
+
+ {
+ ES_PIN_GPIO_D_14 ,
+
+#ifdef ES_INIT_GPIO_D_14_MODE
+ ES_INIT_GPIO_D_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_14_LEVEL
+ ES_INIT_GPIO_D_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_14_IRQ_MODE
+ ES_INIT_GPIO_D_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_15
+
+ {
+ ES_PIN_GPIO_D_15 ,
+
+#ifdef ES_INIT_GPIO_D_15_MODE
+ ES_INIT_GPIO_D_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_15_LEVEL
+ ES_INIT_GPIO_D_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_15_IRQ_MODE
+ ES_INIT_GPIO_D_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_0
+
+ {
+ ES_PIN_GPIO_E_0 ,
+
+#ifdef ES_INIT_GPIO_E_0_MODE
+ ES_INIT_GPIO_E_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_0_LEVEL
+ ES_INIT_GPIO_E_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_0_IRQ_MODE
+ ES_INIT_GPIO_E_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_1
+
+ {
+ ES_PIN_GPIO_E_1 ,
+
+#ifdef ES_INIT_GPIO_E_1_MODE
+ ES_INIT_GPIO_E_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_1_LEVEL
+ ES_INIT_GPIO_E_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_1_IRQ_MODE
+ ES_INIT_GPIO_E_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_2
+
+ {
+ ES_PIN_GPIO_E_2 ,
+
+#ifdef ES_INIT_GPIO_E_2_MODE
+ ES_INIT_GPIO_E_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_2_LEVEL
+ ES_INIT_GPIO_E_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_2_IRQ_MODE
+ ES_INIT_GPIO_E_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_3
+
+ {
+ ES_PIN_GPIO_E_3 ,
+
+#ifdef ES_INIT_GPIO_E_3_MODE
+ ES_INIT_GPIO_E_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_3_LEVEL
+ ES_INIT_GPIO_E_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_3_IRQ_MODE
+ ES_INIT_GPIO_E_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_4
+
+ {
+ ES_PIN_GPIO_E_4 ,
+
+#ifdef ES_INIT_GPIO_E_4_MODE
+ ES_INIT_GPIO_E_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_4_LEVEL
+ ES_INIT_GPIO_E_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_4_IRQ_MODE
+ ES_INIT_GPIO_E_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_5
+
+ {
+ ES_PIN_GPIO_E_5 ,
+
+#ifdef ES_INIT_GPIO_E_5_MODE
+ ES_INIT_GPIO_E_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_5_LEVEL
+ ES_INIT_GPIO_E_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_5_IRQ_MODE
+ ES_INIT_GPIO_E_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_6
+
+ {
+ ES_PIN_GPIO_E_6 ,
+
+#ifdef ES_INIT_GPIO_E_6_MODE
+ ES_INIT_GPIO_E_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_6_LEVEL
+ ES_INIT_GPIO_E_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_6_IRQ_MODE
+ ES_INIT_GPIO_E_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_7
+
+ {
+ ES_PIN_GPIO_E_7 ,
+
+#ifdef ES_INIT_GPIO_E_7_MODE
+ ES_INIT_GPIO_E_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_7_LEVEL
+ ES_INIT_GPIO_E_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_7_IRQ_MODE
+ ES_INIT_GPIO_E_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_8
+
+ {
+ ES_PIN_GPIO_E_8 ,
+
+#ifdef ES_INIT_GPIO_E_8_MODE
+ ES_INIT_GPIO_E_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_8_LEVEL
+ ES_INIT_GPIO_E_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_8_IRQ_MODE
+ ES_INIT_GPIO_E_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_9
+
+ {
+ ES_PIN_GPIO_E_9 ,
+
+#ifdef ES_INIT_GPIO_E_9_MODE
+ ES_INIT_GPIO_E_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_9_LEVEL
+ ES_INIT_GPIO_E_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_9_IRQ_MODE
+ ES_INIT_GPIO_E_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_10
+
+ {
+ ES_PIN_GPIO_E_10 ,
+
+#ifdef ES_INIT_GPIO_E_10_MODE
+ ES_INIT_GPIO_E_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_10_LEVEL
+ ES_INIT_GPIO_E_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_10_IRQ_MODE
+ ES_INIT_GPIO_E_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_11
+
+ {
+ ES_PIN_GPIO_E_11 ,
+
+#ifdef ES_INIT_GPIO_E_11_MODE
+ ES_INIT_GPIO_E_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_11_LEVEL
+ ES_INIT_GPIO_E_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_11_IRQ_MODE
+ ES_INIT_GPIO_E_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_12
+
+ {
+ ES_PIN_GPIO_E_12 ,
+
+#ifdef ES_INIT_GPIO_E_12_MODE
+ ES_INIT_GPIO_E_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_12_LEVEL
+ ES_INIT_GPIO_E_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_12_IRQ_MODE
+ ES_INIT_GPIO_E_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_13
+
+ {
+ ES_PIN_GPIO_E_13 ,
+
+#ifdef ES_INIT_GPIO_E_13_MODE
+ ES_INIT_GPIO_E_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_13_LEVEL
+ ES_INIT_GPIO_E_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_13_IRQ_MODE
+ ES_INIT_GPIO_E_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_14
+
+ {
+ ES_PIN_GPIO_E_14 ,
+
+#ifdef ES_INIT_GPIO_E_14_MODE
+ ES_INIT_GPIO_E_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_14_LEVEL
+ ES_INIT_GPIO_E_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_14_IRQ_MODE
+ ES_INIT_GPIO_E_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_15
+
+ {
+ ES_PIN_GPIO_E_15 ,
+
+#ifdef ES_INIT_GPIO_E_15_MODE
+ ES_INIT_GPIO_E_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_15_LEVEL
+ ES_INIT_GPIO_E_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_15_IRQ_MODE
+ ES_INIT_GPIO_E_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_0
+
+ {
+ ES_PIN_GPIO_F_0 ,
+
+#ifdef ES_INIT_GPIO_F_0_MODE
+ ES_INIT_GPIO_F_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_0_LEVEL
+ ES_INIT_GPIO_F_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_0_IRQ_MODE
+ ES_INIT_GPIO_F_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_1
+
+ {
+ ES_PIN_GPIO_F_1 ,
+
+#ifdef ES_INIT_GPIO_F_1_MODE
+ ES_INIT_GPIO_F_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_1_LEVEL
+ ES_INIT_GPIO_F_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_1_IRQ_MODE
+ ES_INIT_GPIO_F_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_2
+
+ {
+ ES_PIN_GPIO_F_2 ,
+
+#ifdef ES_INIT_GPIO_F_2_MODE
+ ES_INIT_GPIO_F_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_2_LEVEL
+ ES_INIT_GPIO_F_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_2_IRQ_MODE
+ ES_INIT_GPIO_F_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_3
+
+ {
+ ES_PIN_GPIO_F_3 ,
+
+#ifdef ES_INIT_GPIO_F_3_MODE
+ ES_INIT_GPIO_F_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_3_LEVEL
+ ES_INIT_GPIO_F_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_3_IRQ_MODE
+ ES_INIT_GPIO_F_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_4
+
+ {
+ ES_PIN_GPIO_F_4 ,
+
+#ifdef ES_INIT_GPIO_F_4_MODE
+ ES_INIT_GPIO_F_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_4_LEVEL
+ ES_INIT_GPIO_F_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_4_IRQ_MODE
+ ES_INIT_GPIO_F_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_5
+
+ {
+ ES_PIN_GPIO_F_5 ,
+
+#ifdef ES_INIT_GPIO_F_5_MODE
+ ES_INIT_GPIO_F_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_5_LEVEL
+ ES_INIT_GPIO_F_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_5_IRQ_MODE
+ ES_INIT_GPIO_F_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_6
+
+ {
+ ES_PIN_GPIO_F_6 ,
+
+#ifdef ES_INIT_GPIO_F_6_MODE
+ ES_INIT_GPIO_F_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_6_LEVEL
+ ES_INIT_GPIO_F_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_6_IRQ_MODE
+ ES_INIT_GPIO_F_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_7
+
+ {
+ ES_PIN_GPIO_F_7 ,
+
+#ifdef ES_INIT_GPIO_F_7_MODE
+ ES_INIT_GPIO_F_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_7_LEVEL
+ ES_INIT_GPIO_F_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_7_IRQ_MODE
+ ES_INIT_GPIO_F_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_8
+
+ {
+ ES_PIN_GPIO_F_8 ,
+
+#ifdef ES_INIT_GPIO_F_8_MODE
+ ES_INIT_GPIO_F_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_8_LEVEL
+ ES_INIT_GPIO_F_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_8_IRQ_MODE
+ ES_INIT_GPIO_F_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_9
+
+ {
+ ES_PIN_GPIO_F_9 ,
+
+#ifdef ES_INIT_GPIO_F_9_MODE
+ ES_INIT_GPIO_F_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_9_LEVEL
+ ES_INIT_GPIO_F_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_9_IRQ_MODE
+ ES_INIT_GPIO_F_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_10
+
+ {
+ ES_PIN_GPIO_F_10 ,
+
+#ifdef ES_INIT_GPIO_F_10_MODE
+ ES_INIT_GPIO_F_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_10_LEVEL
+ ES_INIT_GPIO_F_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_10_IRQ_MODE
+ ES_INIT_GPIO_F_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_11
+
+ {
+ ES_PIN_GPIO_F_11 ,
+
+#ifdef ES_INIT_GPIO_F_11_MODE
+ ES_INIT_GPIO_F_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_11_LEVEL
+ ES_INIT_GPIO_F_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_11_IRQ_MODE
+ ES_INIT_GPIO_F_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_12
+
+ {
+ ES_PIN_GPIO_F_12 ,
+
+#ifdef ES_INIT_GPIO_F_12_MODE
+ ES_INIT_GPIO_F_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_12_LEVEL
+ ES_INIT_GPIO_F_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_12_IRQ_MODE
+ ES_INIT_GPIO_F_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_13
+
+ {
+ ES_PIN_GPIO_F_13 ,
+
+#ifdef ES_INIT_GPIO_F_13_MODE
+ ES_INIT_GPIO_F_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_13_LEVEL
+ ES_INIT_GPIO_F_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_13_IRQ_MODE
+ ES_INIT_GPIO_F_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_14
+
+ {
+ ES_PIN_GPIO_F_14 ,
+
+#ifdef ES_INIT_GPIO_F_14_MODE
+ ES_INIT_GPIO_F_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_14_LEVEL
+ ES_INIT_GPIO_F_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_14_IRQ_MODE
+ ES_INIT_GPIO_F_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_15
+
+ {
+ ES_PIN_GPIO_F_15 ,
+
+#ifdef ES_INIT_GPIO_F_15_MODE
+ ES_INIT_GPIO_F_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_15_LEVEL
+ ES_INIT_GPIO_F_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_15_IRQ_MODE
+ ES_INIT_GPIO_F_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_0
+
+ {
+ ES_PIN_GPIO_G_0 ,
+
+#ifdef ES_INIT_GPIO_G_0_MODE
+ ES_INIT_GPIO_G_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_0_LEVEL
+ ES_INIT_GPIO_G_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_0_IRQ_MODE
+ ES_INIT_GPIO_G_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_1
+
+ {
+ ES_PIN_GPIO_G_1 ,
+
+#ifdef ES_INIT_GPIO_G_1_MODE
+ ES_INIT_GPIO_G_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_1_LEVEL
+ ES_INIT_GPIO_G_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_1_IRQ_MODE
+ ES_INIT_GPIO_G_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_2
+
+ {
+ ES_PIN_GPIO_G_2 ,
+
+#ifdef ES_INIT_GPIO_G_2_MODE
+ ES_INIT_GPIO_G_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_2_LEVEL
+ ES_INIT_GPIO_G_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_2_IRQ_MODE
+ ES_INIT_GPIO_G_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_3
+
+ {
+ ES_PIN_GPIO_G_3 ,
+
+#ifdef ES_INIT_GPIO_G_3_MODE
+ ES_INIT_GPIO_G_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_3_LEVEL
+ ES_INIT_GPIO_G_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_3_IRQ_MODE
+ ES_INIT_GPIO_G_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_4
+
+ {
+ ES_PIN_GPIO_G_4 ,
+
+#ifdef ES_INIT_GPIO_G_4_MODE
+ ES_INIT_GPIO_G_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_4_LEVEL
+ ES_INIT_GPIO_G_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_4_IRQ_MODE
+ ES_INIT_GPIO_G_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_5
+
+ {
+ ES_PIN_GPIO_G_5 ,
+
+#ifdef ES_INIT_GPIO_G_5_MODE
+ ES_INIT_GPIO_G_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_5_LEVEL
+ ES_INIT_GPIO_G_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_5_IRQ_MODE
+ ES_INIT_GPIO_G_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_6
+
+ {
+ ES_PIN_GPIO_G_6 ,
+
+#ifdef ES_INIT_GPIO_G_6_MODE
+ ES_INIT_GPIO_G_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_6_LEVEL
+ ES_INIT_GPIO_G_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_6_IRQ_MODE
+ ES_INIT_GPIO_G_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_7
+
+ {
+ ES_PIN_GPIO_G_7 ,
+
+#ifdef ES_INIT_GPIO_G_7_MODE
+ ES_INIT_GPIO_G_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_7_LEVEL
+ ES_INIT_GPIO_G_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_7_IRQ_MODE
+ ES_INIT_GPIO_G_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_8
+
+ {
+ ES_PIN_GPIO_G_8 ,
+
+#ifdef ES_INIT_GPIO_G_8_MODE
+ ES_INIT_GPIO_G_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_8_LEVEL
+ ES_INIT_GPIO_G_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_8_IRQ_MODE
+ ES_INIT_GPIO_G_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_9
+
+ {
+ ES_PIN_GPIO_G_9 ,
+
+#ifdef ES_INIT_GPIO_G_9_MODE
+ ES_INIT_GPIO_G_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_9_LEVEL
+ ES_INIT_GPIO_G_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_9_IRQ_MODE
+ ES_INIT_GPIO_G_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_10
+
+ {
+ ES_PIN_GPIO_G_10 ,
+
+#ifdef ES_INIT_GPIO_G_10_MODE
+ ES_INIT_GPIO_G_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_10_LEVEL
+ ES_INIT_GPIO_G_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_10_IRQ_MODE
+ ES_INIT_GPIO_G_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_11
+
+ {
+ ES_PIN_GPIO_G_11 ,
+
+#ifdef ES_INIT_GPIO_G_11_MODE
+ ES_INIT_GPIO_G_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_11_LEVEL
+ ES_INIT_GPIO_G_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_11_IRQ_MODE
+ ES_INIT_GPIO_G_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_12
+
+ {
+ ES_PIN_GPIO_G_12 ,
+
+#ifdef ES_INIT_GPIO_G_12_MODE
+ ES_INIT_GPIO_G_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_12_LEVEL
+ ES_INIT_GPIO_G_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_12_IRQ_MODE
+ ES_INIT_GPIO_G_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_13
+
+ {
+ ES_PIN_GPIO_G_13 ,
+
+#ifdef ES_INIT_GPIO_G_13_MODE
+ ES_INIT_GPIO_G_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_13_LEVEL
+ ES_INIT_GPIO_G_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_13_IRQ_MODE
+ ES_INIT_GPIO_G_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_14
+
+ {
+ ES_PIN_GPIO_G_14 ,
+
+#ifdef ES_INIT_GPIO_G_14_MODE
+ ES_INIT_GPIO_G_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_14_LEVEL
+ ES_INIT_GPIO_G_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_14_IRQ_MODE
+ ES_INIT_GPIO_G_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_15
+
+ {
+ ES_PIN_GPIO_G_15 ,
+
+#ifdef ES_INIT_GPIO_G_15_MODE
+ ES_INIT_GPIO_G_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_15_LEVEL
+ ES_INIT_GPIO_G_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_15_IRQ_MODE
+ ES_INIT_GPIO_G_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_0
+
+ {
+ ES_PIN_GPIO_H_0 ,
+
+#ifdef ES_INIT_GPIO_H_0_MODE
+ ES_INIT_GPIO_H_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_0_LEVEL
+ ES_INIT_GPIO_H_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_0_IRQ_MODE
+ ES_INIT_GPIO_H_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_1
+
+ {
+ ES_PIN_GPIO_H_1 ,
+
+#ifdef ES_INIT_GPIO_H_1_MODE
+ ES_INIT_GPIO_H_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_1_LEVEL
+ ES_INIT_GPIO_H_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_1_IRQ_MODE
+ ES_INIT_GPIO_H_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_2
+
+ {
+ ES_PIN_GPIO_H_2 ,
+
+#ifdef ES_INIT_GPIO_H_2_MODE
+ ES_INIT_GPIO_H_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_2_LEVEL
+ ES_INIT_GPIO_H_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_2_IRQ_MODE
+ ES_INIT_GPIO_H_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_3
+
+ {
+ ES_PIN_GPIO_H_3 ,
+
+#ifdef ES_INIT_GPIO_H_3_MODE
+ ES_INIT_GPIO_H_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_3_LEVEL
+ ES_INIT_GPIO_H_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_3_IRQ_MODE
+ ES_INIT_GPIO_H_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_4
+
+ {
+ ES_PIN_GPIO_H_4 ,
+
+#ifdef ES_INIT_GPIO_H_4_MODE
+ ES_INIT_GPIO_H_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_4_LEVEL
+ ES_INIT_GPIO_H_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_4_IRQ_MODE
+ ES_INIT_GPIO_H_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_5
+
+ {
+ ES_PIN_GPIO_H_5 ,
+
+#ifdef ES_INIT_GPIO_H_5_MODE
+ ES_INIT_GPIO_H_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_5_LEVEL
+ ES_INIT_GPIO_H_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_5_IRQ_MODE
+ ES_INIT_GPIO_H_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_6
+
+ {
+ ES_PIN_GPIO_H_6 ,
+
+#ifdef ES_INIT_GPIO_H_6_MODE
+ ES_INIT_GPIO_H_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_6_LEVEL
+ ES_INIT_GPIO_H_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_6_IRQ_MODE
+ ES_INIT_GPIO_H_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_7
+
+ {
+ ES_PIN_GPIO_H_7 ,
+
+#ifdef ES_INIT_GPIO_H_7_MODE
+ ES_INIT_GPIO_H_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_7_LEVEL
+ ES_INIT_GPIO_H_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_7_IRQ_MODE
+ ES_INIT_GPIO_H_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_8
+
+ {
+ ES_PIN_GPIO_H_8 ,
+
+#ifdef ES_INIT_GPIO_H_8_MODE
+ ES_INIT_GPIO_H_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_8_LEVEL
+ ES_INIT_GPIO_H_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_8_IRQ_MODE
+ ES_INIT_GPIO_H_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_9
+
+ {
+ ES_PIN_GPIO_H_9 ,
+
+#ifdef ES_INIT_GPIO_H_9_MODE
+ ES_INIT_GPIO_H_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_9_LEVEL
+ ES_INIT_GPIO_H_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_9_IRQ_MODE
+ ES_INIT_GPIO_H_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_10
+
+ {
+ ES_PIN_GPIO_H_10 ,
+
+#ifdef ES_INIT_GPIO_H_10_MODE
+ ES_INIT_GPIO_H_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_10_LEVEL
+ ES_INIT_GPIO_H_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_10_IRQ_MODE
+ ES_INIT_GPIO_H_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_11
+
+ {
+ ES_PIN_GPIO_H_11 ,
+
+#ifdef ES_INIT_GPIO_H_11_MODE
+ ES_INIT_GPIO_H_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_11_LEVEL
+ ES_INIT_GPIO_H_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_11_IRQ_MODE
+ ES_INIT_GPIO_H_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_12
+
+ {
+ ES_PIN_GPIO_H_12 ,
+
+#ifdef ES_INIT_GPIO_H_12_MODE
+ ES_INIT_GPIO_H_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_12_LEVEL
+ ES_INIT_GPIO_H_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_12_IRQ_MODE
+ ES_INIT_GPIO_H_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_13
+
+ {
+ ES_PIN_GPIO_H_13 ,
+
+#ifdef ES_INIT_GPIO_H_13_MODE
+ ES_INIT_GPIO_H_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_13_LEVEL
+ ES_INIT_GPIO_H_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_13_IRQ_MODE
+ ES_INIT_GPIO_H_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_14
+
+ {
+ ES_PIN_GPIO_H_14 ,
+
+#ifdef ES_INIT_GPIO_H_14_MODE
+ ES_INIT_GPIO_H_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_14_LEVEL
+ ES_INIT_GPIO_H_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_14_IRQ_MODE
+ ES_INIT_GPIO_H_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_15
+
+ {
+ ES_PIN_GPIO_H_15 ,
+
+#ifdef ES_INIT_GPIO_H_15_MODE
+ ES_INIT_GPIO_H_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_15_LEVEL
+ ES_INIT_GPIO_H_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_15_IRQ_MODE
+ ES_INIT_GPIO_H_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+
+
+};
+
+#endif
+
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_hwtimer.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_hwtimer.h
new file mode 100644
index 0000000000..d829c68f93
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_hwtimer.h
@@ -0,0 +1,103 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_HWTIMER_H__
+#define __ES_CONF_INFO_HWTIMER_H__
+
+#include <ald_cmu.h>
+#include <ald_timer.h>
+
+#define ES_C_HWTIMER_MODE_UP HWTIMER_CNTMODE_UP
+#define ES_C_HWTIMER_MODE_DOWN HWTIMER_CNTMODE_DW
+
+/* HWTIMER 配置 */
+
+/* codes_main */
+
+
+
+#ifndef ES_AD16C4T0_HWTIMER_MODE
+#define ES_AD16C4T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+
+#ifndef ES_GP16C4T0_HWTIMER_MODE
+#define ES_GP16C4T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_GP16C2T0_HWTIMER_MODE
+#define ES_GP16C2T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_GP1624T1_HWTIMER_MODE
+#define ES_GP16C2T1_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_BS16T0_HWTIMER_MODE
+#define ES_BS16T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_BS16T1_HWTIMER_MODE
+#define ES_BS16T1_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_BS16T2_HWTIMER_MODE
+#define ES_BS16T2_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_BS16T3_HWTIMER_MODE
+#define ES_BS16T3_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+
+
+
+
+#define ES_AD16C4T0_HWTIMER_PRES 1
+#define ES_GP16C4T0_HWTIMER_PRES 1
+#define ES_GP16C2T0_HWTIMER_PRES 1
+#define ES_GP16C2T1_HWTIMER_PRES 1
+#define ES_BS16T0_HWTIMER_PRES 1
+#define ES_BS16T1_HWTIMER_PRES 1
+#define ES_BS16T2_HWTIMER_PRES 1
+#define ES_BS16T3_HWTIMER_PRES 1
+
+#ifndef ES_DEVICE_NAME_AD16C4T0_HWTIMER
+#define ES_DEVICE_NAME_AD16C4T0_HWTIMER "timer0"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C4T0_HWTIMER
+#define ES_DEVICE_NAME_GP16C4T0_HWTIMER "timer1"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C2T0_HWTIMER
+#define ES_DEVICE_NAME_GP16C2T0_HWTIMER "timer2"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C2T1_HWTIMER
+#define ES_DEVICE_NAME_GP16C2T1_HWTIMER "timer3"
+#endif
+#ifndef ES_DEVICE_NAME_BS16T0_HWTIMER
+#define ES_DEVICE_NAME_BS16T0_HWTIMER "timer4"
+#endif
+#ifndef ES_DEVICE_NAME_BS16T1_HWTIMER
+#define ES_DEVICE_NAME_BS16T1_HWTIMER "timer5"
+#endif
+#ifndef ES_DEVICE_NAME_BS16T2_HWTIMER
+#define ES_DEVICE_NAME_BS16T2_HWTIMER "timer6"
+#endif
+#ifndef ES_DEVICE_NAME_BS16T3_HWTIMER
+#define ES_DEVICE_NAME_BS16T3_HWTIMER "timer7"
+#endif
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_i2c.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_i2c.h
new file mode 100644
index 0000000000..65310fce01
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_i2c.h
@@ -0,0 +1,95 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_I2C_H__
+#define __ES_CONF_INFO_I2C_H__
+
+#include "es_conf_info_map.h"
+#include <ald_i2c.h>
+#include <ald_gpio.h>
+#include <rtdbg.h>
+
+#define ES_C_I2C_STRETCH I2C_NOSTRETCH_DISABLE
+#define ES_C_I2C_NO_STRETCH I2C_NOSTRETCH_ENABLE
+
+#define ES_C_I2C_GENERALCALL I2C_GENERALCALL_ENABLE
+#define ES_C_I2C_NO_GENERALCALL I2C_GENERALCALL_DISABLE
+
+
+#define ES_C_I2C_ADDR_7_MODE I2C_ADDR_7BIT
+#define ES_C_I2C_ADDR_10_MODE I2C_ADDR_10BIT
+
+
+/* I2C 配置 */
+
+
+
+/* codes_main */
+
+
+
+
+
+#ifndef ES_DEVICE_NAME_I2C0
+#define ES_DEVICE_NAME_I2C0 "i2c0"
+#endif
+
+#ifndef ES_DEVICE_NAME_I2C1
+#define ES_DEVICE_NAME_I2C1 "i2c1"
+#endif
+
+#ifndef ES_I2C0_CLK_SPEED
+#define ES_I2C0_CLK_SPEED 100000
+#endif
+#ifndef ES_I2C0_OWN_ADDR1
+#define ES_I2C0_OWN_ADDR1 0x20
+#endif
+#ifndef ES_I2C0_GENERAL_CALL
+#define ES_I2C0_GENERAL_CALL ES_C_I2C_NO_GENERALCALL
+#endif
+#ifndef ES_I2C0_STRETCH
+#define ES_I2C0_STRETCH ES_C_I2C_STRETCH
+#endif
+#ifndef ES_I2C0_ADDR_MODE
+#define ES_I2C0_ADDR_MODE ES_C_I2C_ADDR_7_MODE
+#endif
+
+#ifndef ES_I2C1_CLK_SPEED
+#define ES_I2C1_CLK_SPEED 100000
+#endif
+#ifndef ES_I2C1_OWN_ADDR1
+#define ES_I2C1_OWN_ADDR1 0x20
+#endif
+#ifndef ES_I2C1_GENERAL_CALL
+#define ES_I2C1_GENERAL_CALL ES_C_I2C_NO_GENERALCALL
+#endif
+#ifndef ES_I2C1_STRETCH
+#define ES_I2C1_STRETCH ES_C_I2C_STRETCH
+#endif
+#ifndef ES_I2C1_ADDR_MODE
+#define ES_I2C1_ADDR_MODE ES_C_I2C_ADDR_7_MODE
+#endif
+
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_map.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_map.h
new file mode 100644
index 0000000000..62274d122f
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_map.h
@@ -0,0 +1,2691 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __es_conf_info_map_H__
+#define __es_conf_info_map_H__
+
+#include <ald_gpio.h>
+
+
+#define __ES_PIN(index, gpio, gpio_index) {index, GPIO##gpio, GPIO_PIN_##gpio_index}
+#define __ES_PIN_DEFAULT {-1, 0, 0}
+
+struct pin_index
+{
+ int index;
+ GPIO_TypeDef *gpio;
+ uint32_t pin;
+};
+
+static const struct pin_index pins[] =
+{
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN(2, C, 13),
+ __ES_PIN(3, C, 14),
+ __ES_PIN(4, C, 15),
+ __ES_PIN(5, H, 0),
+ __ES_PIN(6, H, 1),
+ __ES_PIN_DEFAULT,
+ __ES_PIN(8, C, 0),
+ __ES_PIN(9, C, 1),
+ __ES_PIN(10, C, 2),
+ __ES_PIN(11, C, 3),
+ __ES_PIN(12, H, 3),
+ __ES_PIN(13, H, 4),
+ __ES_PIN(14, A, 0),
+ __ES_PIN(15, A, 1),
+ __ES_PIN(16, A, 2),
+ __ES_PIN(17, A, 3),
+ __ES_PIN(18, F, 0),
+ __ES_PIN(19, F, 1),
+ __ES_PIN(20, A, 4),
+ __ES_PIN(21, A, 5),
+ __ES_PIN(22, A, 6),
+ __ES_PIN(23, A, 7),
+ __ES_PIN(24, C, 4),
+ __ES_PIN(25, C, 5),
+ __ES_PIN(26, B, 0),
+ __ES_PIN(27, B, 1),
+ __ES_PIN(28, B, 2),
+ __ES_PIN(29, B, 10),
+ __ES_PIN(30, B, 11),
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN(33, B, 12),
+ __ES_PIN(34, B, 13),
+ __ES_PIN(35, B, 14),
+ __ES_PIN(36, B, 15),
+ __ES_PIN(37, C, 6),
+ __ES_PIN(38, C, 7),
+ __ES_PIN(39, C, 8),
+ __ES_PIN(40, C, 9),
+ __ES_PIN(41, A, 8),
+ __ES_PIN(42, A, 9),
+ __ES_PIN(43, A, 10),
+ __ES_PIN(44, A, 11),
+ __ES_PIN(45, A, 12),
+ __ES_PIN(46, A, 13),
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN(49, A, 14),
+ __ES_PIN(50, A, 15),
+ __ES_PIN(51, C, 10),
+ __ES_PIN(52, C, 11),
+ __ES_PIN(53, C, 12),
+ __ES_PIN(54, D, 2),
+ __ES_PIN(55, B, 3),
+ __ES_PIN(56, B, 4),
+ __ES_PIN(57, B, 5),
+ __ES_PIN(58, B, 6),
+ __ES_PIN(59, B, 7),
+ __ES_PIN(60, H, 2),
+ __ES_PIN(61, B, 8),
+ __ES_PIN(62, B, 9),
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+};
+
+#define ES_GPIO_ADC_CH0_GPIO GPIOC
+#define ES_GPIO_ADC_CH1_GPIO GPIOC
+#define ES_GPIO_ADC_CH2_GPIO GPIOC
+#define ES_GPIO_ADC_CH3_GPIO GPIOC
+#define ES_GPIO_ADC_CH4_GPIO GPIOA
+#define ES_GPIO_ADC_CH5_GPIO GPIOA
+#define ES_GPIO_ADC_CH6_GPIO GPIOA
+#define ES_GPIO_ADC_CH7_GPIO GPIOA
+#define ES_GPIO_ADC_CH8_GPIO GPIOA
+#define ES_GPIO_ADC_CH9_GPIO GPIOA
+#define ES_GPIO_ADC_CH10_GPIO GPIOA
+#define ES_GPIO_ADC_CH11_GPIO GPIOA
+#define ES_GPIO_ADC_CH12_GPIO GPIOC
+#define ES_GPIO_ADC_CH13_GPIO GPIOC
+#define ES_GPIO_ADC_CH14_GPIO GPIOB
+#define ES_GPIO_ADC_CH15_GPIO GPIOB
+
+#define ES_GPIO_ADC_CH0_PIN GPIO_PIN_0
+#define ES_GPIO_ADC_CH1_PIN GPIO_PIN_1
+#define ES_GPIO_ADC_CH2_PIN GPIO_PIN_2
+#define ES_GPIO_ADC_CH3_PIN GPIO_PIN_3
+#define ES_GPIO_ADC_CH4_PIN GPIO_PIN_0
+#define ES_GPIO_ADC_CH5_PIN GPIO_PIN_1
+#define ES_GPIO_ADC_CH6_PIN GPIO_PIN_2
+#define ES_GPIO_ADC_CH7_PIN GPIO_PIN_3
+#define ES_GPIO_ADC_CH8_PIN GPIO_PIN_4
+#define ES_GPIO_ADC_CH9_PIN GPIO_PIN_5
+#define ES_GPIO_ADC_CH10_PIN GPIO_PIN_6
+#define ES_GPIO_ADC_CH11_PIN GPIO_PIN_7
+#define ES_GPIO_ADC_CH12_PIN GPIO_PIN_4
+#define ES_GPIO_ADC_CH13_PIN GPIO_PIN_5
+#define ES_GPIO_ADC_CH14_PIN GPIO_PIN_0
+#define ES_GPIO_ADC_CH15_PIN GPIO_PIN_1
+
+
+
+
+#define ES_PIN_GPIO_C_13 2
+#define ES_PIN_GPIO_C_14 3
+#define ES_PIN_GPIO_C_15 4
+#define ES_PIN_GPIO_H_0 5
+#define ES_PIN_GPIO_H_1 6
+#define ES_PIN_GPIO_C_0 8
+#define ES_PIN_GPIO_C_1 9
+#define ES_PIN_GPIO_C_2 10
+#define ES_PIN_GPIO_C_3 11
+#define ES_PIN_GPIO_H_3 12
+#define ES_PIN_GPIO_H_4 13
+#define ES_PIN_GPIO_A_0 14
+#define ES_PIN_GPIO_A_1 15
+#define ES_PIN_GPIO_A_2 16
+#define ES_PIN_GPIO_A_3 17
+#define ES_PIN_GPIO_F_0 18
+#define ES_PIN_GPIO_F_1 19
+#define ES_PIN_GPIO_A_4 20
+#define ES_PIN_GPIO_A_5 21
+#define ES_PIN_GPIO_A_6 22
+#define ES_PIN_GPIO_A_7 23
+#define ES_PIN_GPIO_C_4 24
+#define ES_PIN_GPIO_C_5 25
+#define ES_PIN_GPIO_B_0 26
+#define ES_PIN_GPIO_B_1 27
+#define ES_PIN_GPIO_B_2 28
+#define ES_PIN_GPIO_B_10 29
+#define ES_PIN_GPIO_B_11 30
+#define ES_PIN_GPIO_B_12 33
+#define ES_PIN_GPIO_B_13 34
+#define ES_PIN_GPIO_B_14 35
+#define ES_PIN_GPIO_B_15 36
+#define ES_PIN_GPIO_C_6 37
+#define ES_PIN_GPIO_C_7 38
+#define ES_PIN_GPIO_C_8 39
+#define ES_PIN_GPIO_C_9 40
+#define ES_PIN_GPIO_A_8 41
+#define ES_PIN_GPIO_A_9 42
+#define ES_PIN_GPIO_A_10 43
+#define ES_PIN_GPIO_A_11 44
+#define ES_PIN_GPIO_A_12 45
+#define ES_PIN_GPIO_A_13 46
+#define ES_PIN_GPIO_A_14 49
+#define ES_PIN_GPIO_A_15 50
+#define ES_PIN_GPIO_C_10 51
+#define ES_PIN_GPIO_C_11 52
+#define ES_PIN_GPIO_C_12 53
+#define ES_PIN_GPIO_D_2 54
+#define ES_PIN_GPIO_B_3 55
+#define ES_PIN_GPIO_B_4 56
+#define ES_PIN_GPIO_B_5 57
+#define ES_PIN_GPIO_B_6 58
+#define ES_PIN_GPIO_B_7 59
+#define ES_PIN_GPIO_H_2 60
+#define ES_PIN_GPIO_B_8 61
+#define ES_PIN_GPIO_B_9 62
+
+
+
+/* UART_TX */
+
+
+#ifndef ES_UART0_TX_GPIO_FUNC
+#define ES_UART0_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_TX_GPIO_PORT
+#define ES_UART0_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_TX_GPIO_PIN
+#define ES_UART0_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART0_TX_PIN
+#ifdef ES_PIN_GPIO_B_10
+#define ES_UART0_TX_PIN ES_PIN_GPIO_B_10
+#endif
+#endif
+
+#ifndef ES_UART0_TX_GPIO_FUNC
+#define ES_UART0_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_TX_GPIO_PORT
+#define ES_UART0_TX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART0_TX_GPIO_PIN
+#define ES_UART0_TX_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_UART0_TX_PIN
+#ifdef ES_PIN_GPIO_A_9
+#define ES_UART0_TX_PIN ES_PIN_GPIO_A_9
+#endif
+#endif
+
+#ifndef ES_UART0_TX_GPIO_FUNC
+#define ES_UART0_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_TX_GPIO_PORT
+#define ES_UART0_TX_GPIO_PORT GPIOH
+#endif
+#ifndef ES_UART0_TX_GPIO_PIN
+#define ES_UART0_TX_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART0_TX_PIN
+#ifdef ES_PIN_GPIO_H_0
+#define ES_UART0_TX_PIN ES_PIN_GPIO_H_0
+#endif
+#endif
+
+#ifndef ES_UART0_TX_GPIO_FUNC
+#define ES_UART0_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_TX_GPIO_PORT
+#define ES_UART0_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_TX_GPIO_PIN
+#define ES_UART0_TX_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_UART0_TX_PIN
+#ifdef ES_PIN_GPIO_D_8
+#define ES_UART0_TX_PIN ES_PIN_GPIO_D_8
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_C_0
+#define ES_UART1_TX_PIN ES_PIN_GPIO_C_0
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_C_10
+#define ES_UART1_TX_PIN ES_PIN_GPIO_C_10
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_A_13
+#define ES_UART1_TX_PIN ES_PIN_GPIO_A_13
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_D_5
+#define ES_UART1_TX_PIN ES_PIN_GPIO_D_5
+#endif
+#endif
+
+#ifndef ES_UART2_TX_GPIO_FUNC
+#define ES_UART2_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_TX_GPIO_PORT
+#define ES_UART2_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART2_TX_GPIO_PIN
+#define ES_UART2_TX_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART2_TX_PIN
+#ifdef ES_PIN_GPIO_C_12
+#define ES_UART2_TX_PIN ES_PIN_GPIO_C_12
+#endif
+#endif
+
+#ifndef ES_UART2_TX_GPIO_FUNC
+#define ES_UART2_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_TX_GPIO_PORT
+#define ES_UART2_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART2_TX_GPIO_PIN
+#define ES_UART2_TX_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART2_TX_PIN
+#ifdef ES_PIN_GPIO_B_3
+#define ES_UART2_TX_PIN ES_PIN_GPIO_B_3
+#endif
+#endif
+
+#ifndef ES_UART2_TX_GPIO_FUNC
+#define ES_UART2_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_TX_GPIO_PORT
+#define ES_UART2_TX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_TX_GPIO_PIN
+#define ES_UART2_TX_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART2_TX_PIN
+#ifdef ES_PIN_GPIO_E_2
+#define ES_UART2_TX_PIN ES_PIN_GPIO_E_2
+#endif
+#endif
+
+#ifndef ES_UART3_TX_GPIO_FUNC
+#define ES_UART3_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_TX_GPIO_PORT
+#define ES_UART3_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART3_TX_GPIO_PIN
+#define ES_UART3_TX_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART3_TX_PIN
+#ifdef ES_PIN_GPIO_C_4
+#define ES_UART3_TX_PIN ES_PIN_GPIO_C_4
+#endif
+#endif
+
+#ifndef ES_UART3_TX_GPIO_FUNC
+#define ES_UART3_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_TX_GPIO_PORT
+#define ES_UART3_TX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_TX_GPIO_PIN
+#define ES_UART3_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART3_TX_PIN
+#ifdef ES_PIN_GPIO_E_10
+#define ES_UART3_TX_PIN ES_PIN_GPIO_E_10
+#endif
+#endif
+
+#ifndef ES_UART3_TX_GPIO_FUNC
+#define ES_UART3_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_TX_GPIO_PORT
+#define ES_UART3_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART3_TX_GPIO_PIN
+#define ES_UART3_TX_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_UART3_TX_PIN
+#ifdef ES_PIN_GPIO_D_14
+#define ES_UART3_TX_PIN ES_PIN_GPIO_D_14
+#endif
+#endif
+
+
+/* UART_RX */
+
+
+#ifndef ES_UART0_RX_GPIO_FUNC
+#define ES_UART0_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_RX_GPIO_PORT
+#define ES_UART0_RX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART0_RX_GPIO_PIN
+#define ES_UART0_RX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART0_RX_PIN
+#ifdef ES_PIN_GPIO_A_10
+#define ES_UART0_RX_PIN ES_PIN_GPIO_A_10
+#endif
+#endif
+
+#ifndef ES_UART0_RX_GPIO_FUNC
+#define ES_UART0_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_RX_GPIO_PORT
+#define ES_UART0_RX_GPIO_PORT GPIOH
+#endif
+#ifndef ES_UART0_RX_GPIO_PIN
+#define ES_UART0_RX_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART0_RX_PIN
+#ifdef ES_PIN_GPIO_H_1
+#define ES_UART0_RX_PIN ES_PIN_GPIO_H_1
+#endif
+#endif
+
+#ifndef ES_UART0_RX_GPIO_FUNC
+#define ES_UART0_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_RX_GPIO_PORT
+#define ES_UART0_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_RX_GPIO_PIN
+#define ES_UART0_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART0_RX_PIN
+#ifdef ES_PIN_GPIO_B_11
+#define ES_UART0_RX_PIN ES_PIN_GPIO_B_11
+#endif
+#endif
+
+#ifndef ES_UART0_RX_GPIO_FUNC
+#define ES_UART0_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_RX_GPIO_PORT
+#define ES_UART0_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_RX_GPIO_PIN
+#define ES_UART0_RX_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_UART0_RX_PIN
+#ifdef ES_PIN_GPIO_D_9
+#define ES_UART0_RX_PIN ES_PIN_GPIO_D_9
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_C_11
+#define ES_UART1_RX_PIN ES_PIN_GPIO_C_11
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_C_1
+#define ES_UART1_RX_PIN ES_PIN_GPIO_C_1
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_A_14
+#define ES_UART1_RX_PIN ES_PIN_GPIO_A_14
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_D_6
+#define ES_UART1_RX_PIN ES_PIN_GPIO_D_6
+#endif
+#endif
+
+#ifndef ES_UART2_RX_GPIO_FUNC
+#define ES_UART2_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_RX_GPIO_PORT
+#define ES_UART2_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART2_RX_GPIO_PIN
+#define ES_UART2_RX_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART2_RX_PIN
+#ifdef ES_PIN_GPIO_D_2
+#define ES_UART2_RX_PIN ES_PIN_GPIO_D_2
+#endif
+#endif
+
+#ifndef ES_UART2_RX_GPIO_FUNC
+#define ES_UART2_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_RX_GPIO_PORT
+#define ES_UART2_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART2_RX_GPIO_PIN
+#define ES_UART2_RX_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART2_RX_PIN
+#ifdef ES_PIN_GPIO_B_4
+#define ES_UART2_RX_PIN ES_PIN_GPIO_B_4
+#endif
+#endif
+
+#ifndef ES_UART2_RX_GPIO_FUNC
+#define ES_UART2_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_RX_GPIO_PORT
+#define ES_UART2_RX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_RX_GPIO_PIN
+#define ES_UART2_RX_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART2_RX_PIN
+#ifdef ES_PIN_GPIO_E_3
+#define ES_UART2_RX_PIN ES_PIN_GPIO_E_3
+#endif
+#endif
+
+#ifndef ES_UART3_RX_GPIO_FUNC
+#define ES_UART3_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_RX_GPIO_PORT
+#define ES_UART3_RX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART3_RX_GPIO_PIN
+#define ES_UART3_RX_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_UART3_RX_PIN
+#ifdef ES_PIN_GPIO_C_5
+#define ES_UART3_RX_PIN ES_PIN_GPIO_C_5
+#endif
+#endif
+
+#ifndef ES_UART3_RX_GPIO_FUNC
+#define ES_UART3_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_RX_GPIO_PORT
+#define ES_UART3_RX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_RX_GPIO_PIN
+#define ES_UART3_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART3_RX_PIN
+#ifdef ES_PIN_GPIO_E_11
+#define ES_UART3_RX_PIN ES_PIN_GPIO_E_11
+#endif
+#endif
+
+#ifndef ES_UART3_RX_GPIO_FUNC
+#define ES_UART3_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_RX_GPIO_PORT
+#define ES_UART3_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART3_RX_GPIO_PIN
+#define ES_UART3_RX_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART3_RX_PIN
+#ifdef ES_PIN_GPIO_D_13
+#define ES_UART3_RX_PIN ES_PIN_GPIO_D_13
+#endif
+#endif
+
+
+/* UART_RTS */
+
+
+#ifndef ES_UART0_RTS_GPIO_FUNC
+#define ES_UART0_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_RTS_GPIO_PORT
+#define ES_UART0_RTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_RTS_GPIO_PIN
+#define ES_UART0_RTS_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_UART0_RTS_PIN
+#ifdef ES_PIN_GPIO_B_14
+#define ES_UART0_RTS_PIN ES_PIN_GPIO_B_14
+#endif
+#endif
+
+#ifndef ES_UART0_RTS_GPIO_FUNC
+#define ES_UART0_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_RTS_GPIO_PORT
+#define ES_UART0_RTS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART0_RTS_GPIO_PIN
+#define ES_UART0_RTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART0_RTS_PIN
+#ifdef ES_PIN_GPIO_A_12
+#define ES_UART0_RTS_PIN ES_PIN_GPIO_A_12
+#endif
+#endif
+
+#ifndef ES_UART0_RTS_GPIO_FUNC
+#define ES_UART0_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_RTS_GPIO_PORT
+#define ES_UART0_RTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_RTS_GPIO_PIN
+#define ES_UART0_RTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART0_RTS_PIN
+#ifdef ES_PIN_GPIO_D_12
+#define ES_UART0_RTS_PIN ES_PIN_GPIO_D_12
+#endif
+#endif
+
+#ifndef ES_UART1_RTS_GPIO_FUNC
+#define ES_UART1_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RTS_GPIO_PORT
+#define ES_UART1_RTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RTS_GPIO_PIN
+#define ES_UART1_RTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART1_RTS_PIN
+#ifdef ES_PIN_GPIO_C_12
+#define ES_UART1_RTS_PIN ES_PIN_GPIO_C_12
+#endif
+#endif
+
+#ifndef ES_UART1_RTS_GPIO_FUNC
+#define ES_UART1_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RTS_GPIO_PORT
+#define ES_UART1_RTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RTS_GPIO_PIN
+#define ES_UART1_RTS_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART1_RTS_PIN
+#ifdef ES_PIN_GPIO_C_3
+#define ES_UART1_RTS_PIN ES_PIN_GPIO_C_3
+#endif
+#endif
+
+#ifndef ES_UART2_RTS_GPIO_FUNC
+#define ES_UART2_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_RTS_GPIO_PORT
+#define ES_UART2_RTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART2_RTS_GPIO_PIN
+#define ES_UART2_RTS_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART2_RTS_PIN
+#ifdef ES_PIN_GPIO_C_10
+#define ES_UART2_RTS_PIN ES_PIN_GPIO_C_10
+#endif
+#endif
+
+#ifndef ES_UART2_RTS_GPIO_FUNC
+#define ES_UART2_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_RTS_GPIO_PORT
+#define ES_UART2_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_RTS_GPIO_PIN
+#define ES_UART2_RTS_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_UART2_RTS_PIN
+#ifdef ES_PIN_GPIO_E_5
+#define ES_UART2_RTS_PIN ES_PIN_GPIO_E_5
+#endif
+#endif
+
+#ifndef ES_UART3_RTS_GPIO_FUNC
+#define ES_UART3_RTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_RTS_GPIO_PORT
+#define ES_UART3_RTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART3_RTS_GPIO_PIN
+#define ES_UART3_RTS_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART3_RTS_PIN
+#ifdef ES_PIN_GPIO_B_1
+#define ES_UART3_RTS_PIN ES_PIN_GPIO_B_1
+#endif
+#endif
+
+#ifndef ES_UART3_RTS_GPIO_FUNC
+#define ES_UART3_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_RTS_GPIO_PORT
+#define ES_UART3_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_RTS_GPIO_PIN
+#define ES_UART3_RTS_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART3_RTS_PIN
+#ifdef ES_PIN_GPIO_E_13
+#define ES_UART3_RTS_PIN ES_PIN_GPIO_E_13
+#endif
+#endif
+
+
+/* UART_CTS */
+
+
+#ifndef ES_UART0_CTS_GPIO_FUNC
+#define ES_UART0_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_CTS_GPIO_PORT
+#define ES_UART0_CTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_CTS_GPIO_PIN
+#define ES_UART0_CTS_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART0_CTS_PIN
+#ifdef ES_PIN_GPIO_B_13
+#define ES_UART0_CTS_PIN ES_PIN_GPIO_B_13
+#endif
+#endif
+
+#ifndef ES_UART0_CTS_GPIO_FUNC
+#define ES_UART0_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_CTS_GPIO_PORT
+#define ES_UART0_CTS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART0_CTS_GPIO_PIN
+#define ES_UART0_CTS_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART0_CTS_PIN
+#ifdef ES_PIN_GPIO_A_11
+#define ES_UART0_CTS_PIN ES_PIN_GPIO_A_11
+#endif
+#endif
+
+#ifndef ES_UART0_CTS_GPIO_FUNC
+#define ES_UART0_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_CTS_GPIO_PORT
+#define ES_UART0_CTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_CTS_GPIO_PIN
+#define ES_UART0_CTS_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART0_CTS_PIN
+#ifdef ES_PIN_GPIO_D_11
+#define ES_UART0_CTS_PIN ES_PIN_GPIO_D_11
+#endif
+#endif
+
+#ifndef ES_UART1_CTS_GPIO_FUNC
+#define ES_UART1_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_CTS_GPIO_PORT
+#define ES_UART1_CTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_CTS_GPIO_PIN
+#define ES_UART1_CTS_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART1_CTS_PIN
+#ifdef ES_PIN_GPIO_C_2
+#define ES_UART1_CTS_PIN ES_PIN_GPIO_C_2
+#endif
+#endif
+
+#ifndef ES_UART1_CTS_GPIO_FUNC
+#define ES_UART1_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_CTS_GPIO_PORT
+#define ES_UART1_CTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART1_CTS_GPIO_PIN
+#define ES_UART1_CTS_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART1_CTS_PIN
+#ifdef ES_PIN_GPIO_D_2
+#define ES_UART1_CTS_PIN ES_PIN_GPIO_D_2
+#endif
+#endif
+
+#ifndef ES_UART2_CTS_GPIO_FUNC
+#define ES_UART2_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_CTS_GPIO_PORT
+#define ES_UART2_CTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART2_CTS_GPIO_PIN
+#define ES_UART2_CTS_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART2_CTS_PIN
+#ifdef ES_PIN_GPIO_C_11
+#define ES_UART2_CTS_PIN ES_PIN_GPIO_C_11
+#endif
+#endif
+
+#ifndef ES_UART2_CTS_GPIO_FUNC
+#define ES_UART2_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_CTS_GPIO_PORT
+#define ES_UART2_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_CTS_GPIO_PIN
+#define ES_UART2_CTS_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART2_CTS_PIN
+#ifdef ES_PIN_GPIO_E_4
+#define ES_UART2_CTS_PIN ES_PIN_GPIO_E_4
+#endif
+#endif
+
+#ifndef ES_UART3_CTS_GPIO_FUNC
+#define ES_UART3_CTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_CTS_GPIO_PORT
+#define ES_UART3_CTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART3_CTS_GPIO_PIN
+#define ES_UART3_CTS_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART3_CTS_PIN
+#ifdef ES_PIN_GPIO_B_0
+#define ES_UART3_CTS_PIN ES_PIN_GPIO_B_0
+#endif
+#endif
+
+#ifndef ES_UART3_CTS_GPIO_FUNC
+#define ES_UART3_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_CTS_GPIO_PORT
+#define ES_UART3_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_CTS_GPIO_PIN
+#define ES_UART3_CTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART3_CTS_PIN
+#ifdef ES_PIN_GPIO_E_12
+#define ES_UART3_CTS_PIN ES_PIN_GPIO_E_12
+#endif
+#endif
+
+
+/* UART_CK */
+
+
+
+/* USART_TX */
+
+
+#ifndef ES_USART0_TX_GPIO_FUNC
+#define ES_USART0_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART0_TX_GPIO_PORT
+#define ES_USART0_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_USART0_TX_GPIO_PIN
+#define ES_USART0_TX_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_USART0_TX_PIN
+#ifdef ES_PIN_GPIO_B_6
+#define ES_USART0_TX_PIN ES_PIN_GPIO_B_6
+#endif
+#endif
+
+#ifndef ES_USART0_TX_GPIO_FUNC
+#define ES_USART0_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART0_TX_GPIO_PORT
+#define ES_USART0_TX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_TX_GPIO_PIN
+#define ES_USART0_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_USART0_TX_PIN
+#ifdef ES_PIN_GPIO_E_10
+#define ES_USART0_TX_PIN ES_PIN_GPIO_E_10
+#endif
+#endif
+
+#ifndef ES_USART1_TX_GPIO_FUNC
+#define ES_USART1_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART1_TX_GPIO_PORT
+#define ES_USART1_TX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_USART1_TX_GPIO_PIN
+#define ES_USART1_TX_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_USART1_TX_PIN
+#ifdef ES_PIN_GPIO_A_2
+#define ES_USART1_TX_PIN ES_PIN_GPIO_A_2
+#endif
+#endif
+
+#ifndef ES_USART1_TX_GPIO_FUNC
+#define ES_USART1_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART1_TX_GPIO_PORT
+#define ES_USART1_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_USART1_TX_GPIO_PIN
+#define ES_USART1_TX_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_USART1_TX_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_USART1_TX_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+#ifndef ES_USART1_TX_GPIO_FUNC
+#define ES_USART1_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_USART1_TX_GPIO_PORT
+#define ES_USART1_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_USART1_TX_GPIO_PIN
+#define ES_USART1_TX_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_USART1_TX_PIN
+#ifdef ES_PIN_GPIO_D_5
+#define ES_USART1_TX_PIN ES_PIN_GPIO_D_5
+#endif
+#endif
+
+
+/* USART_RX */
+
+
+#ifndef ES_USART0_RX_GPIO_FUNC
+#define ES_USART0_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART0_RX_GPIO_PORT
+#define ES_USART0_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_USART0_RX_GPIO_PIN
+#define ES_USART0_RX_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_USART0_RX_PIN
+#ifdef ES_PIN_GPIO_B_7
+#define ES_USART0_RX_PIN ES_PIN_GPIO_B_7
+#endif
+#endif
+
+#ifndef ES_USART0_RX_GPIO_FUNC
+#define ES_USART0_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART0_RX_GPIO_PORT
+#define ES_USART0_RX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_RX_GPIO_PIN
+#define ES_USART0_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_USART0_RX_PIN
+#ifdef ES_PIN_GPIO_E_11
+#define ES_USART0_RX_PIN ES_PIN_GPIO_E_11
+#endif
+#endif
+
+#ifndef ES_USART1_RX_GPIO_FUNC
+#define ES_USART1_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART1_RX_GPIO_PORT
+#define ES_USART1_RX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_USART1_RX_GPIO_PIN
+#define ES_USART1_RX_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_USART1_RX_PIN
+#ifdef ES_PIN_GPIO_A_3
+#define ES_USART1_RX_PIN ES_PIN_GPIO_A_3
+#endif
+#endif
+
+#ifndef ES_USART1_RX_GPIO_FUNC
+#define ES_USART1_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_USART1_RX_GPIO_PORT
+#define ES_USART1_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_USART1_RX_GPIO_PIN
+#define ES_USART1_RX_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_USART1_RX_PIN
+#ifdef ES_PIN_GPIO_D_6
+#define ES_USART1_RX_PIN ES_PIN_GPIO_D_6
+#endif
+#endif
+
+#ifndef ES_USART1_RX_GPIO_FUNC
+#define ES_USART1_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART1_RX_GPIO_PORT
+#define ES_USART1_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_USART1_RX_GPIO_PIN
+#define ES_USART1_RX_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_USART1_RX_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_USART1_RX_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+
+/* USART_RTS */
+
+
+#ifndef ES_USART0_RTS_GPIO_FUNC
+#define ES_USART0_RTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART0_RTS_GPIO_PORT
+#define ES_USART0_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_RTS_GPIO_PIN
+#define ES_USART0_RTS_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_USART0_RTS_PIN
+#ifdef ES_PIN_GPIO_E_13
+#define ES_USART0_RTS_PIN ES_PIN_GPIO_E_13
+#endif
+#endif
+
+#ifndef ES_USART0_RTS_GPIO_FUNC
+#define ES_USART0_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART0_RTS_GPIO_PORT
+#define ES_USART0_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_RTS_GPIO_PIN
+#define ES_USART0_RTS_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_USART0_RTS_PIN
+#ifdef ES_PIN_GPIO_E_1
+#define ES_USART0_RTS_PIN ES_PIN_GPIO_E_1
+#endif
+#endif
+
+#ifndef ES_USART1_RTS_GPIO_FUNC
+#define ES_USART1_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART1_RTS_GPIO_PORT
+#define ES_USART1_RTS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_USART1_RTS_GPIO_PIN
+#define ES_USART1_RTS_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_USART1_RTS_PIN
+#ifdef ES_PIN_GPIO_A_1
+#define ES_USART1_RTS_PIN ES_PIN_GPIO_A_1
+#endif
+#endif
+
+#ifndef ES_USART1_RTS_GPIO_FUNC
+#define ES_USART1_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_USART1_RTS_GPIO_PORT
+#define ES_USART1_RTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_USART1_RTS_GPIO_PIN
+#define ES_USART1_RTS_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_USART1_RTS_PIN
+#ifdef ES_PIN_GPIO_D_4
+#define ES_USART1_RTS_PIN ES_PIN_GPIO_D_4
+#endif
+#endif
+
+
+/* USART_CTS */
+
+
+#ifndef ES_USART0_CTS_GPIO_FUNC
+#define ES_USART0_CTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART0_CTS_GPIO_PORT
+#define ES_USART0_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_CTS_GPIO_PIN
+#define ES_USART0_CTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_USART0_CTS_PIN
+#ifdef ES_PIN_GPIO_E_12
+#define ES_USART0_CTS_PIN ES_PIN_GPIO_E_12
+#endif
+#endif
+
+#ifndef ES_USART0_CTS_GPIO_FUNC
+#define ES_USART0_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART0_CTS_GPIO_PORT
+#define ES_USART0_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_CTS_GPIO_PIN
+#define ES_USART0_CTS_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_USART0_CTS_PIN
+#ifdef ES_PIN_GPIO_E_0
+#define ES_USART0_CTS_PIN ES_PIN_GPIO_E_0
+#endif
+#endif
+
+#ifndef ES_USART1_CTS_GPIO_FUNC
+#define ES_USART1_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART1_CTS_GPIO_PORT
+#define ES_USART1_CTS_GPIO_PORT GPIOF
+#endif
+#ifndef ES_USART1_CTS_GPIO_PIN
+#define ES_USART1_CTS_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_USART1_CTS_PIN
+#ifdef ES_PIN_GPIO_F_7
+#define ES_USART1_CTS_PIN ES_PIN_GPIO_F_7
+#endif
+#endif
+
+#ifndef ES_USART1_CTS_GPIO_FUNC
+#define ES_USART1_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_USART1_CTS_GPIO_PORT
+#define ES_USART1_CTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_USART1_CTS_GPIO_PIN
+#define ES_USART1_CTS_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_USART1_CTS_PIN
+#ifdef ES_PIN_GPIO_D_3
+#define ES_USART1_CTS_PIN ES_PIN_GPIO_D_3
+#endif
+#endif
+
+
+/* USART_CK */
+
+
+#ifndef ES_USART0_CK_GPIO_FUNC
+#define ES_USART0_CK_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_USART0_CK_GPIO_PORT
+#define ES_USART0_CK_GPIO_PORT GPIOA
+#endif
+#ifndef ES_USART0_CK_GPIO_PIN
+#define ES_USART0_CK_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_USART0_CK_PIN
+#ifdef ES_PIN_GPIO_A_8
+#define ES_USART0_CK_PIN ES_PIN_GPIO_A_8
+#endif
+#endif
+
+#ifndef ES_USART0_CK_GPIO_FUNC
+#define ES_USART0_CK_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART0_CK_GPIO_PORT
+#define ES_USART0_CK_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_CK_GPIO_PIN
+#define ES_USART0_CK_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_USART0_CK_PIN
+#ifdef ES_PIN_GPIO_E_6
+#define ES_USART0_CK_PIN ES_PIN_GPIO_E_6
+#endif
+#endif
+
+#ifndef ES_USART0_CK_GPIO_FUNC
+#define ES_USART0_CK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART0_CK_GPIO_PORT
+#define ES_USART0_CK_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART0_CK_GPIO_PIN
+#define ES_USART0_CK_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_USART0_CK_PIN
+#ifdef ES_PIN_GPIO_E_7
+#define ES_USART0_CK_PIN ES_PIN_GPIO_E_7
+#endif
+#endif
+
+#ifndef ES_USART1_CK_GPIO_FUNC
+#define ES_USART1_CK_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_USART1_CK_GPIO_PORT
+#define ES_USART1_CK_GPIO_PORT GPIOA
+#endif
+#ifndef ES_USART1_CK_GPIO_PIN
+#define ES_USART1_CK_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_USART1_CK_PIN
+#ifdef ES_PIN_GPIO_A_4
+#define ES_USART1_CK_PIN ES_PIN_GPIO_A_4
+#endif
+#endif
+
+#ifndef ES_USART1_CK_GPIO_FUNC
+#define ES_USART1_CK_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_USART1_CK_GPIO_PORT
+#define ES_USART1_CK_GPIO_PORT GPIOD
+#endif
+#ifndef ES_USART1_CK_GPIO_PIN
+#define ES_USART1_CK_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_USART1_CK_PIN
+#ifdef ES_PIN_GPIO_D_7
+#define ES_USART1_CK_PIN ES_PIN_GPIO_D_7
+#endif
+#endif
+
+#ifndef ES_USART1_CK_GPIO_FUNC
+#define ES_USART1_CK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_USART1_CK_GPIO_PORT
+#define ES_USART1_CK_GPIO_PORT GPIOE
+#endif
+#ifndef ES_USART1_CK_GPIO_PIN
+#define ES_USART1_CK_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_USART1_CK_PIN
+#ifdef ES_PIN_GPIO_E_0
+#define ES_USART1_CK_PIN ES_PIN_GPIO_E_0
+#endif
+#endif
+
+
+/* I2C_SCL */
+
+
+#ifndef ES_I2C0_SCL_GPIO_FUNC
+#define ES_I2C0_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PORT
+#define ES_I2C0_SCL_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PIN
+#define ES_I2C0_SCL_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_I2C0_SCL_PIN
+#ifdef ES_PIN_GPIO_B_6
+#define ES_I2C0_SCL_PIN ES_PIN_GPIO_B_6
+#endif
+#endif
+
+#ifndef ES_I2C0_SCL_GPIO_FUNC
+#define ES_I2C0_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PORT
+#define ES_I2C0_SCL_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PIN
+#define ES_I2C0_SCL_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_I2C0_SCL_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_I2C0_SCL_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+#ifndef ES_I2C1_SCL_GPIO_FUNC
+#define ES_I2C1_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PORT
+#define ES_I2C1_SCL_GPIO_PORT GPIOA
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PIN
+#define ES_I2C1_SCL_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_I2C1_SCL_PIN
+#ifdef ES_PIN_GPIO_A_5
+#define ES_I2C1_SCL_PIN ES_PIN_GPIO_A_5
+#endif
+#endif
+
+#ifndef ES_I2C1_SCL_GPIO_FUNC
+#define ES_I2C1_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PORT
+#define ES_I2C1_SCL_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PIN
+#define ES_I2C1_SCL_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_I2C1_SCL_PIN
+#ifdef ES_PIN_GPIO_B_10
+#define ES_I2C1_SCL_PIN ES_PIN_GPIO_B_10
+#endif
+#endif
+
+#ifndef ES_I2C1_SCL_GPIO_FUNC
+#define ES_I2C1_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PORT
+#define ES_I2C1_SCL_GPIO_PORT GPIOH
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PIN
+#define ES_I2C1_SCL_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_I2C1_SCL_PIN
+#ifdef ES_PIN_GPIO_H_0
+#define ES_I2C1_SCL_PIN ES_PIN_GPIO_H_0
+#endif
+#endif
+
+
+/* I2C_SDA */
+
+
+#ifndef ES_I2C0_SDA_GPIO_FUNC
+#define ES_I2C0_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PORT
+#define ES_I2C0_SDA_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PIN
+#define ES_I2C0_SDA_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_I2C0_SDA_PIN
+#ifdef ES_PIN_GPIO_B_7
+#define ES_I2C0_SDA_PIN ES_PIN_GPIO_B_7
+#endif
+#endif
+
+#ifndef ES_I2C0_SDA_GPIO_FUNC
+#define ES_I2C0_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PORT
+#define ES_I2C0_SDA_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PIN
+#define ES_I2C0_SDA_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_I2C0_SDA_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_I2C0_SDA_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+#ifndef ES_I2C1_SDA_GPIO_FUNC
+#define ES_I2C1_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PORT
+#define ES_I2C1_SDA_GPIO_PORT GPIOA
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PIN
+#define ES_I2C1_SDA_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_I2C1_SDA_PIN
+#ifdef ES_PIN_GPIO_A_6
+#define ES_I2C1_SDA_PIN ES_PIN_GPIO_A_6
+#endif
+#endif
+
+#ifndef ES_I2C1_SDA_GPIO_FUNC
+#define ES_I2C1_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PORT
+#define ES_I2C1_SDA_GPIO_PORT GPIOH
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PIN
+#define ES_I2C1_SDA_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_I2C1_SDA_PIN
+#ifdef ES_PIN_GPIO_H_1
+#define ES_I2C1_SDA_PIN ES_PIN_GPIO_H_1
+#endif
+#endif
+
+#ifndef ES_I2C1_SDA_GPIO_FUNC
+#define ES_I2C1_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PORT
+#define ES_I2C1_SDA_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PIN
+#define ES_I2C1_SDA_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_I2C1_SDA_PIN
+#ifdef ES_PIN_GPIO_B_11
+#define ES_I2C1_SDA_PIN ES_PIN_GPIO_B_11
+#endif
+#endif
+
+
+/* SPI_MISO */
+
+
+#ifndef ES_SPI0_MISO_GPIO_FUNC
+#define ES_SPI0_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PORT
+#define ES_SPI0_MISO_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PIN
+#define ES_SPI0_MISO_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI0_MISO_PIN
+#ifdef ES_PIN_GPIO_B_4
+#define ES_SPI0_MISO_PIN ES_PIN_GPIO_B_4
+#endif
+#endif
+
+#ifndef ES_SPI0_MISO_GPIO_FUNC
+#define ES_SPI0_MISO_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PORT
+#define ES_SPI0_MISO_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PIN
+#define ES_SPI0_MISO_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_SPI0_MISO_PIN
+#ifdef ES_PIN_GPIO_A_6
+#define ES_SPI0_MISO_PIN ES_PIN_GPIO_A_6
+#endif
+#endif
+
+#ifndef ES_SPI0_MISO_GPIO_FUNC
+#define ES_SPI0_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PORT
+#define ES_SPI0_MISO_GPIO_PORT GPIOD
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PIN
+#define ES_SPI0_MISO_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI0_MISO_PIN
+#ifdef ES_PIN_GPIO_D_4
+#define ES_SPI0_MISO_PIN ES_PIN_GPIO_D_4
+#endif
+#endif
+
+#ifndef ES_SPI1_MISO_GPIO_FUNC
+#define ES_SPI1_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PORT
+#define ES_SPI1_MISO_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PIN
+#define ES_SPI1_MISO_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_SPI1_MISO_PIN
+#ifdef ES_PIN_GPIO_C_2
+#define ES_SPI1_MISO_PIN ES_PIN_GPIO_C_2
+#endif
+#endif
+
+#ifndef ES_SPI1_MISO_GPIO_FUNC
+#define ES_SPI1_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PORT
+#define ES_SPI1_MISO_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PIN
+#define ES_SPI1_MISO_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_SPI1_MISO_PIN
+#ifdef ES_PIN_GPIO_B_14
+#define ES_SPI1_MISO_PIN ES_PIN_GPIO_B_14
+#endif
+#endif
+
+
+/* SPI_MOSI */
+
+
+#ifndef ES_SPI0_MOSI_GPIO_FUNC
+#define ES_SPI0_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PORT
+#define ES_SPI0_MOSI_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PIN
+#define ES_SPI0_MOSI_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_SPI0_MOSI_PIN
+#ifdef ES_PIN_GPIO_B_5
+#define ES_SPI0_MOSI_PIN ES_PIN_GPIO_B_5
+#endif
+#endif
+
+#ifndef ES_SPI0_MOSI_GPIO_FUNC
+#define ES_SPI0_MOSI_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PORT
+#define ES_SPI0_MOSI_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PIN
+#define ES_SPI0_MOSI_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_SPI0_MOSI_PIN
+#ifdef ES_PIN_GPIO_A_7
+#define ES_SPI0_MOSI_PIN ES_PIN_GPIO_A_7
+#endif
+#endif
+
+
+#ifndef ES_SPI0_MOSI_GPIO_FUNC
+#define ES_SPI0_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PORT
+#define ES_SPI0_MOSI_GPIO_PORT GPIOD
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PIN
+#define ES_SPI0_MOSI_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_SPI0_MOSI_PIN
+#ifdef ES_PIN_GPIO_D_7
+#define ES_SPI0_MOSI_PIN ES_PIN_GPIO_D_7
+#endif
+#endif
+
+#ifndef ES_SPI1_MOSI_GPIO_FUNC
+#define ES_SPI1_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PORT
+#define ES_SPI1_MOSI_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PIN
+#define ES_SPI1_MOSI_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_SPI1_MOSI_PIN
+#ifdef ES_PIN_GPIO_B_15
+#define ES_SPI1_MOSI_PIN ES_PIN_GPIO_B_15
+#endif
+#endif
+
+#ifndef ES_SPI1_MOSI_GPIO_FUNC
+#define ES_SPI1_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PORT
+#define ES_SPI1_MOSI_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PIN
+#define ES_SPI1_MOSI_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_SPI1_MOSI_PIN
+#ifdef ES_PIN_GPIO_C_3
+#define ES_SPI1_MOSI_PIN ES_PIN_GPIO_C_3
+#endif
+#endif
+
+
+/* SPI_SCK */
+
+
+#ifndef ES_SPI0_SCK_GPIO_FUNC
+#define ES_SPI0_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PORT
+#define ES_SPI0_SCK_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PIN
+#define ES_SPI0_SCK_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_SPI0_SCK_PIN
+#ifdef ES_PIN_GPIO_B_3
+#define ES_SPI0_SCK_PIN ES_PIN_GPIO_B_3
+#endif
+#endif
+
+#ifndef ES_SPI0_SCK_GPIO_FUNC
+#define ES_SPI0_SCK_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PORT
+#define ES_SPI0_SCK_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PIN
+#define ES_SPI0_SCK_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_SPI0_SCK_PIN
+#ifdef ES_PIN_GPIO_A_5
+#define ES_SPI0_SCK_PIN ES_PIN_GPIO_A_5
+#endif
+#endif
+
+#ifndef ES_SPI0_SCK_GPIO_FUNC
+#define ES_SPI0_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PORT
+#define ES_SPI0_SCK_GPIO_PORT GPIOD
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PIN
+#define ES_SPI0_SCK_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_SPI0_SCK_PIN
+#ifdef ES_PIN_GPIO_D_3
+#define ES_SPI0_SCK_PIN ES_PIN_GPIO_D_3
+#endif
+#endif
+
+#ifndef ES_SPI1_SCK_GPIO_FUNC
+#define ES_SPI1_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PORT
+#define ES_SPI1_SCK_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PIN
+#define ES_SPI1_SCK_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_SPI1_SCK_PIN
+#ifdef ES_PIN_GPIO_B_13
+#define ES_SPI1_SCK_PIN ES_PIN_GPIO_B_13
+#endif
+#endif
+
+#ifndef ES_SPI1_SCK_GPIO_FUNC
+#define ES_SPI1_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PORT
+#define ES_SPI1_SCK_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PIN
+#define ES_SPI1_SCK_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_SPI1_SCK_PIN
+#ifdef ES_PIN_GPIO_C_1
+#define ES_SPI1_SCK_PIN ES_PIN_GPIO_C_1
+#endif
+#endif
+
+
+/* SPI_NSS */
+
+
+#ifndef ES_SPI0_NSS_GPIO_FUNC
+#define ES_SPI0_NSS_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PORT
+#define ES_SPI0_NSS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PIN
+#define ES_SPI0_NSS_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI0_NSS_PIN
+#ifdef ES_PIN_GPIO_A_4
+#define ES_SPI0_NSS_PIN ES_PIN_GPIO_A_4
+#endif
+#endif
+
+#ifndef ES_SPI0_NSS_GPIO_FUNC
+#define ES_SPI0_NSS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PORT
+#define ES_SPI0_NSS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PIN
+#define ES_SPI0_NSS_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_SPI0_NSS_PIN
+#ifdef ES_PIN_GPIO_A_15
+#define ES_SPI0_NSS_PIN ES_PIN_GPIO_A_15
+#endif
+#endif
+
+#ifndef ES_SPI1_NSS_GPIO_FUNC
+#define ES_SPI1_NSS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PORT
+#define ES_SPI1_NSS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PIN
+#define ES_SPI1_NSS_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_SPI1_NSS_PIN
+#ifdef ES_PIN_GPIO_C_0
+#define ES_SPI1_NSS_PIN ES_PIN_GPIO_C_0
+#endif
+#endif
+
+#ifndef ES_SPI1_NSS_GPIO_FUNC
+#define ES_SPI1_NSS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PORT
+#define ES_SPI1_NSS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PIN
+#define ES_SPI1_NSS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_SPI1_NSS_PIN
+#ifdef ES_PIN_GPIO_B_12
+#define ES_SPI1_NSS_PIN ES_PIN_GPIO_B_12
+#endif
+#endif
+
+
+/* CAN_TX */
+
+
+#ifndef ES_CAN0_TX_GPIO_FUNC
+#define ES_CAN0_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_CAN0_TX_GPIO_PORT
+#define ES_CAN0_TX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_CAN0_TX_GPIO_PIN
+#define ES_CAN0_TX_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_CAN0_TX_PIN
+#ifdef ES_PIN_GPIO_A_12
+#define ES_CAN0_TX_PIN ES_PIN_GPIO_A_12
+#endif
+#endif
+
+#ifndef ES_CAN0_TX_GPIO_FUNC
+#define ES_CAN0_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_CAN0_TX_GPIO_PORT
+#define ES_CAN0_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_CAN0_TX_GPIO_PIN
+#define ES_CAN0_TX_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_CAN0_TX_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_CAN0_TX_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+
+/* CAN_RX */
+
+
+#ifndef ES_CAN0_RX_GPIO_FUNC
+#define ES_CAN0_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_CAN0_RX_GPIO_PORT
+#define ES_CAN0_RX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_CAN0_RX_GPIO_PIN
+#define ES_CAN0_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_CAN0_RX_PIN
+#ifdef ES_PIN_GPIO_A_11
+#define ES_CAN0_RX_PIN ES_PIN_GPIO_A_11
+#endif
+#endif
+
+#ifndef ES_CAN0_RX_GPIO_FUNC
+#define ES_CAN0_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_CAN0_RX_GPIO_PORT
+#define ES_CAN0_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_CAN0_RX_GPIO_PIN
+#define ES_CAN0_RX_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_CAN0_RX_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_CAN0_RX_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+
+/* AD16C4T_CH1 */
+
+
+#ifndef ES_AD16C4T0_CH1_GPIO_FUNC
+#define ES_AD16C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PORT
+#define ES_AD16C4T0_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PIN
+#define ES_AD16C4T0_CH1_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_AD16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_A_8
+#define ES_AD16C4T0_CH1_PIN ES_PIN_GPIO_A_8
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH1_GPIO_FUNC
+#define ES_AD16C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PORT
+#define ES_AD16C4T0_CH1_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PIN
+#define ES_AD16C4T0_CH1_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_AD16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_E_9
+#define ES_AD16C4T0_CH1_PIN ES_PIN_GPIO_E_9
+#endif
+#endif
+
+
+/* AD16C4T_CH2 */
+
+
+#ifndef ES_AD16C4T0_CH2_GPIO_FUNC
+#define ES_AD16C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH2_GPIO_PORT
+#define ES_AD16C4T0_CH2_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T0_CH2_GPIO_PIN
+#define ES_AD16C4T0_CH2_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_AD16C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_A_9
+#define ES_AD16C4T0_CH2_PIN ES_PIN_GPIO_A_9
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH2_GPIO_FUNC
+#define ES_AD16C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH2_GPIO_PORT
+#define ES_AD16C4T0_CH2_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH2_GPIO_PIN
+#define ES_AD16C4T0_CH2_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_AD16C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_E_11
+#define ES_AD16C4T0_CH2_PIN ES_PIN_GPIO_E_11
+#endif
+#endif
+
+
+/* AD16C4T_CH3 */
+
+
+#ifndef ES_AD16C4T0_CH3_GPIO_FUNC
+#define ES_AD16C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH3_GPIO_PORT
+#define ES_AD16C4T0_CH3_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T0_CH3_GPIO_PIN
+#define ES_AD16C4T0_CH3_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_AD16C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_A_10
+#define ES_AD16C4T0_CH3_PIN ES_PIN_GPIO_A_10
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH3_GPIO_FUNC
+#define ES_AD16C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH3_GPIO_PORT
+#define ES_AD16C4T0_CH3_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH3_GPIO_PIN
+#define ES_AD16C4T0_CH3_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_AD16C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_E_13
+#define ES_AD16C4T0_CH3_PIN ES_PIN_GPIO_E_13
+#endif
+#endif
+
+
+/* AD16C4T_CH4 */
+
+
+#ifndef ES_AD16C4T0_CH4_GPIO_FUNC
+#define ES_AD16C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH4_GPIO_PORT
+#define ES_AD16C4T0_CH4_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH4_GPIO_PIN
+#define ES_AD16C4T0_CH4_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_AD16C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_E_14
+#define ES_AD16C4T0_CH4_PIN ES_PIN_GPIO_E_14
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH4_GPIO_FUNC
+#define ES_AD16C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH4_GPIO_PORT
+#define ES_AD16C4T0_CH4_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T0_CH4_GPIO_PIN
+#define ES_AD16C4T0_CH4_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_AD16C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_A_11
+#define ES_AD16C4T0_CH4_PIN ES_PIN_GPIO_A_11
+#endif
+#endif
+
+
+/* AD16C4T_CH1N */
+
+
+#ifndef ES_AD16C4T0_CH1N_GPIO_FUNC
+#define ES_AD16C4T0_CH1N_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PORT
+#define ES_AD16C4T0_CH1N_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PIN
+#define ES_AD16C4T0_CH1N_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_PIN
+#ifdef ES_PIN_GPIO_A_7
+#define ES_AD16C4T0_CH1N_PIN ES_PIN_GPIO_A_7
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_GPIO_FUNC
+#define ES_AD16C4T0_CH1N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PORT
+#define ES_AD16C4T0_CH1N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PIN
+#define ES_AD16C4T0_CH1N_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_PIN
+#ifdef ES_PIN_GPIO_B_13
+#define ES_AD16C4T0_CH1N_PIN ES_PIN_GPIO_B_13
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_GPIO_FUNC
+#define ES_AD16C4T0_CH1N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PORT
+#define ES_AD16C4T0_CH1N_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PIN
+#define ES_AD16C4T0_CH1N_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_PIN
+#ifdef ES_PIN_GPIO_E_8
+#define ES_AD16C4T0_CH1N_PIN ES_PIN_GPIO_E_8
+#endif
+#endif
+
+
+/* AD16C4T_CH2N */
+
+
+#ifndef ES_AD16C4T0_CH2N_GPIO_FUNC
+#define ES_AD16C4T0_CH2N_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PORT
+#define ES_AD16C4T0_CH2N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PIN
+#define ES_AD16C4T0_CH2N_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_PIN
+#ifdef ES_PIN_GPIO_B_0
+#define ES_AD16C4T0_CH2N_PIN ES_PIN_GPIO_B_0
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_GPIO_FUNC
+#define ES_AD16C4T0_CH2N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PORT
+#define ES_AD16C4T0_CH2N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PIN
+#define ES_AD16C4T0_CH2N_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_PIN
+#ifdef ES_PIN_GPIO_B_14
+#define ES_AD16C4T0_CH2N_PIN ES_PIN_GPIO_B_14
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_GPIO_FUNC
+#define ES_AD16C4T0_CH2N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PORT
+#define ES_AD16C4T0_CH2N_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PIN
+#define ES_AD16C4T0_CH2N_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_PIN
+#ifdef ES_PIN_GPIO_E_10
+#define ES_AD16C4T0_CH2N_PIN ES_PIN_GPIO_E_10
+#endif
+#endif
+
+
+/* AD16C4T_CH3N */
+
+
+#ifndef ES_AD16C4T0_CH3N_GPIO_FUNC
+#define ES_AD16C4T0_CH3N_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PORT
+#define ES_AD16C4T0_CH3N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PIN
+#define ES_AD16C4T0_CH3N_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_PIN
+#ifdef ES_PIN_GPIO_B_1
+#define ES_AD16C4T0_CH3N_PIN ES_PIN_GPIO_B_1
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_GPIO_FUNC
+#define ES_AD16C4T0_CH3N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PORT
+#define ES_AD16C4T0_CH3N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PIN
+#define ES_AD16C4T0_CH3N_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_PIN
+#ifdef ES_PIN_GPIO_B_15
+#define ES_AD16C4T0_CH3N_PIN ES_PIN_GPIO_B_15
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_GPIO_FUNC
+#define ES_AD16C4T0_CH3N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PORT
+#define ES_AD16C4T0_CH3N_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PIN
+#define ES_AD16C4T0_CH3N_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_PIN
+#ifdef ES_PIN_GPIO_E_12
+#define ES_AD16C4T0_CH3N_PIN ES_PIN_GPIO_E_12
+#endif
+#endif
+
+
+/* AD16C4T_CH4N */
+
+
+
+/* AD16C4T_ET */
+
+
+#ifndef ES_AD16C4T0_ET_GPIO_FUNC
+#define ES_AD16C4T0_ET_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_ET_GPIO_PORT
+#define ES_AD16C4T0_ET_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T0_ET_GPIO_PIN
+#define ES_AD16C4T0_ET_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_AD16C4T0_ET_PIN
+#ifdef ES_PIN_GPIO_A_12
+#define ES_AD16C4T0_ET_PIN ES_PIN_GPIO_A_12
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_ET_GPIO_FUNC
+#define ES_AD16C4T0_ET_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_ET_GPIO_PORT
+#define ES_AD16C4T0_ET_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_ET_GPIO_PIN
+#define ES_AD16C4T0_ET_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_AD16C4T0_ET_PIN
+#ifdef ES_PIN_GPIO_E_7
+#define ES_AD16C4T0_ET_PIN ES_PIN_GPIO_E_7
+#endif
+#endif
+
+
+/* GP32C4T_CH1 */
+
+
+
+/* GP32C4T_CH2 */
+
+
+
+/* GP32C4T_CH3 */
+
+
+
+/* GP32C4T_CH4 */
+
+
+
+/* GP32C4T_ET */
+
+
+
+/* GP16C4T_CH1 */
+
+
+#ifndef ES_GP16C4T0_CH1_GPIO_FUNC
+#define ES_GP16C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PORT
+#define ES_GP16C4T0_CH1_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PIN
+#define ES_GP16C4T0_CH1_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_GP16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_B_6
+#define ES_GP16C4T0_CH1_PIN ES_PIN_GPIO_B_6
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH1_GPIO_FUNC
+#define ES_GP16C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PORT
+#define ES_GP16C4T0_CH1_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PIN
+#define ES_GP16C4T0_CH1_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_GP16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_D_12
+#define ES_GP16C4T0_CH1_PIN ES_PIN_GPIO_D_12
+#endif
+#endif
+
+
+/* GP16C4T_CH2 */
+
+
+#ifndef ES_GP16C4T0_CH2_GPIO_FUNC
+#define ES_GP16C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PORT
+#define ES_GP16C4T0_CH2_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PIN
+#define ES_GP16C4T0_CH2_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_GP16C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_B_7
+#define ES_GP16C4T0_CH2_PIN ES_PIN_GPIO_B_7
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH2_GPIO_FUNC
+#define ES_GP16C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PORT
+#define ES_GP16C4T0_CH2_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PIN
+#define ES_GP16C4T0_CH2_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_GP16C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_D_13
+#define ES_GP16C4T0_CH2_PIN ES_PIN_GPIO_D_13
+#endif
+#endif
+
+
+/* GP16C4T_CH3 */
+
+
+#ifndef ES_GP16C4T0_CH3_GPIO_FUNC
+#define ES_GP16C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PORT
+#define ES_GP16C4T0_CH3_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PIN
+#define ES_GP16C4T0_CH3_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_GP16C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_D_14
+#define ES_GP16C4T0_CH3_PIN ES_PIN_GPIO_D_14
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH3_GPIO_FUNC
+#define ES_GP16C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PORT
+#define ES_GP16C4T0_CH3_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PIN
+#define ES_GP16C4T0_CH3_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_GP16C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_GP16C4T0_CH3_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+
+/* GP16C4T_CH4 */
+
+
+#ifndef ES_GP16C4T0_CH4_GPIO_FUNC
+#define ES_GP16C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PORT
+#define ES_GP16C4T0_CH4_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PIN
+#define ES_GP16C4T0_CH4_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_GP16C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_GP16C4T0_CH4_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH4_GPIO_FUNC
+#define ES_GP16C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PORT
+#define ES_GP16C4T0_CH4_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PIN
+#define ES_GP16C4T0_CH4_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_GP16C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_D_15
+#define ES_GP16C4T0_CH4_PIN ES_PIN_GPIO_D_15
+#endif
+#endif
+
+
+/* GP16C4T_ET */
+
+
+#ifndef ES_GP16C4T0_ET_GPIO_FUNC
+#define ES_GP16C4T0_ET_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_ET_GPIO_PORT
+#define ES_GP16C4T0_ET_GPIO_PORT GPIOE
+#endif
+#ifndef ES_GP16C4T0_ET_GPIO_PIN
+#define ES_GP16C4T0_ET_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_GP16C4T0_ET_PIN
+#ifdef ES_PIN_GPIO_E_0
+#define ES_GP16C4T0_ET_PIN ES_PIN_GPIO_E_0
+#endif
+#endif
+
+
+/* GP16C2T_CH1 */
+
+
+#ifndef ES_GP16C2T0_CH1_GPIO_FUNC
+#define ES_GP16C2T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C2T0_CH1_GPIO_PORT
+#define ES_GP16C2T0_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C2T0_CH1_GPIO_PIN
+#define ES_GP16C2T0_CH1_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_GP16C2T0_CH1_PIN
+#ifdef ES_PIN_GPIO_A_15
+#define ES_GP16C2T0_CH1_PIN ES_PIN_GPIO_A_15
+#endif
+#endif
+
+#ifndef ES_GP16C2T0_CH1_GPIO_FUNC
+#define ES_GP16C2T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C2T0_CH1_GPIO_PORT
+#define ES_GP16C2T0_CH1_GPIO_PORT GPIOF
+#endif
+#ifndef ES_GP16C2T0_CH1_GPIO_PIN
+#define ES_GP16C2T0_CH1_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_GP16C2T0_CH1_PIN
+#ifdef ES_PIN_GPIO_F_7
+#define ES_GP16C2T0_CH1_PIN ES_PIN_GPIO_F_7
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH1_GPIO_FUNC
+#define ES_GP16C2T1_CH1_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP16C2T1_CH1_GPIO_PORT
+#define ES_GP16C2T1_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C2T1_CH1_GPIO_PIN
+#define ES_GP16C2T1_CH1_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_GP16C2T1_CH1_PIN
+#ifdef ES_PIN_GPIO_A_6
+#define ES_GP16C2T1_CH1_PIN ES_PIN_GPIO_A_6
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH1_GPIO_FUNC
+#define ES_GP16C2T1_CH1_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP16C2T1_CH1_GPIO_PORT
+#define ES_GP16C2T1_CH1_GPIO_PORT GPIOC
+#endif
+#ifndef ES_GP16C2T1_CH1_GPIO_PIN
+#define ES_GP16C2T1_CH1_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_GP16C2T1_CH1_PIN
+#ifdef ES_PIN_GPIO_C_6
+#define ES_GP16C2T1_CH1_PIN ES_PIN_GPIO_C_6
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH1_GPIO_FUNC
+#define ES_GP16C2T1_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C2T1_CH1_GPIO_PORT
+#define ES_GP16C2T1_CH1_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C2T1_CH1_GPIO_PIN
+#define ES_GP16C2T1_CH1_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_GP16C2T1_CH1_PIN
+#ifdef ES_PIN_GPIO_B_4
+#define ES_GP16C2T1_CH1_PIN ES_PIN_GPIO_B_4
+#endif
+#endif
+
+
+/* GP16C2T_CH2 */
+
+
+#ifndef ES_GP16C2T0_CH2_GPIO_FUNC
+#define ES_GP16C2T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C2T0_CH2_GPIO_PORT
+#define ES_GP16C2T0_CH2_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C2T0_CH2_GPIO_PIN
+#define ES_GP16C2T0_CH2_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_GP16C2T0_CH2_PIN
+#ifdef ES_PIN_GPIO_A_1
+#define ES_GP16C2T0_CH2_PIN ES_PIN_GPIO_A_1
+#endif
+#endif
+
+#ifndef ES_GP16C2T0_CH2_GPIO_FUNC
+#define ES_GP16C2T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C2T0_CH2_GPIO_PORT
+#define ES_GP16C2T0_CH2_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C2T0_CH2_GPIO_PIN
+#define ES_GP16C2T0_CH2_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_GP16C2T0_CH2_PIN
+#ifdef ES_PIN_GPIO_B_3
+#define ES_GP16C2T0_CH2_PIN ES_PIN_GPIO_B_3
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH2_GPIO_FUNC
+#define ES_GP16C2T1_CH2_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP16C2T1_CH2_GPIO_PORT
+#define ES_GP16C2T1_CH2_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C2T1_CH2_GPIO_PIN
+#define ES_GP16C2T1_CH2_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_GP16C2T1_CH2_PIN
+#ifdef ES_PIN_GPIO_A_7
+#define ES_GP16C2T1_CH2_PIN ES_PIN_GPIO_A_7
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH2_GPIO_FUNC
+#define ES_GP16C2T1_CH2_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP16C2T1_CH2_GPIO_PORT
+#define ES_GP16C2T1_CH2_GPIO_PORT GPIOC
+#endif
+#ifndef ES_GP16C2T1_CH2_GPIO_PIN
+#define ES_GP16C2T1_CH2_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_GP16C2T1_CH2_PIN
+#ifdef ES_PIN_GPIO_C_7
+#define ES_GP16C2T1_CH2_PIN ES_PIN_GPIO_C_7
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH2_GPIO_FUNC
+#define ES_GP16C2T1_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C2T1_CH2_GPIO_PORT
+#define ES_GP16C2T1_CH2_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C2T1_CH2_GPIO_PIN
+#define ES_GP16C2T1_CH2_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_GP16C2T1_CH2_PIN
+#ifdef ES_PIN_GPIO_B_5
+#define ES_GP16C2T1_CH2_PIN ES_PIN_GPIO_B_5
+#endif
+#endif
+
+
+/* GP16C2T_CH1N */
+
+
+#ifndef ES_GP16C2T0_CH1N_GPIO_FUNC
+#define ES_GP16C2T0_CH1N_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_GP16C2T0_CH1N_GPIO_PORT
+#define ES_GP16C2T0_CH1N_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C2T0_CH1N_GPIO_PIN
+#define ES_GP16C2T0_CH1N_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_GP16C2T0_CH1N_PIN
+#ifdef ES_PIN_GPIO_A_2
+#define ES_GP16C2T0_CH1N_PIN ES_PIN_GPIO_A_2
+#endif
+#endif
+
+#ifndef ES_GP16C2T0_CH1N_GPIO_FUNC
+#define ES_GP16C2T0_CH1N_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_GP16C2T0_CH1N_GPIO_PORT
+#define ES_GP16C2T0_CH1N_GPIO_PORT GPIOC
+#endif
+#ifndef ES_GP16C2T0_CH1N_GPIO_PIN
+#define ES_GP16C2T0_CH1N_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_GP16C2T0_CH1N_PIN
+#ifdef ES_PIN_GPIO_C_10
+#define ES_GP16C2T0_CH1N_PIN ES_PIN_GPIO_C_10
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH1N_GPIO_FUNC
+#define ES_GP16C2T1_CH1N_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_GP16C2T1_CH1N_GPIO_PORT
+#define ES_GP16C2T1_CH1N_GPIO_PORT GPIOC
+#endif
+#ifndef ES_GP16C2T1_CH1N_GPIO_PIN
+#define ES_GP16C2T1_CH1N_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_GP16C2T1_CH1N_PIN
+#ifdef ES_PIN_GPIO_C_4
+#define ES_GP16C2T1_CH1N_PIN ES_PIN_GPIO_C_4
+#endif
+#endif
+
+#ifndef ES_GP16C2T1_CH1N_GPIO_FUNC
+#define ES_GP16C2T1_CH1N_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_GP16C2T1_CH1N_GPIO_PORT
+#define ES_GP16C2T1_CH1N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C2T1_CH1N_GPIO_PIN
+#define ES_GP16C2T1_CH1N_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_GP16C2T1_CH1N_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_GP16C2T1_CH1N_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+
+/* GP16C2T_CH2N */
+
+
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_pm.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_pm.h
new file mode 100644
index 0000000000..580268312c
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_pm.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_PM_H__
+#define __ES_CONF_INFO_PM_H__
+
+#include <ald_cmu.h>
+#include <ald_pmu.h>
+
+#define ES_PMU_SAVE_LOAD_UART
+
+/* PM 配置 */
+
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_pwm.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_pwm.h
new file mode 100644
index 0000000000..bb0c034da9
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_pwm.h
@@ -0,0 +1,72 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_PWM_H__
+#define __ES_CONF_INFO_PWM_H__
+
+#include "es_conf_info_map.h"
+#include <ald_cmu.h>
+#include <ald_timer.h>
+#include <ald_gpio.h>
+
+
+#define ES_C_PWM_OC_POL_HIGH TIMER_OC_POLARITY_HIGH
+#define ES_C_PWM_OC_POL_LOW TIMER_OC_POLARITY_LOW
+
+#define ES_C_PWM_OC_MODE_PWM1 TIMER_OC_MODE_PWM1
+#define ES_C_PWM_OC_MODE_PWM2 TIMER_OC_MODE_PWM2
+
+
+
+/* PWM 配置 */
+
+
+/* codes_main */
+
+
+
+#define ES_PWM_OC_POLARITY ES_C_PWM_OC_POL_HIGH
+#define ES_PWM_OC_MODE ES_C_PWM_OC_MODE_PWM1
+
+#ifndef ES_PWM_OC_POLARITY
+#define ES_PWM_OC_POLARITY ES_C_PWM_OC_POL_HIGH
+#endif
+#ifndef ES_PWM_OC_MODE
+#define ES_PWM_OC_MODE ES_C_PWM_OC_MODE_PWM2
+#endif
+
+#ifndef ES_DEVICE_NAME_AD16C4T0_PWM
+#define ES_DEVICE_NAME_AD16C4T0_PWM "pwm0"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C4T0_PWM
+#define ES_DEVICE_NAME_GP16C4T0_PWM "pwm1"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C2T0_PWM
+#define ES_DEVICE_NAME_GP16C2T0_PWM "pwm2"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C2T1_PWM
+#define ES_DEVICE_NAME_GP16C2T1_PWM "pwm3"
+#endif
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_rtc.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_rtc.h
new file mode 100644
index 0000000000..2aa8faf9d7
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_rtc.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_RTC_H__
+#define __ES_CONF_INFO_RTC_H__
+
+#include <ald_cmu.h>
+#include <ald_rtc.h>
+
+/* RTC 配置 */
+
+#define ES_C_RTC_SOURCE_LRC RTC_SOURCE_LRC
+#define ES_C_RTC_SOURCE_LOSC RTC_SOURCE_LOSC
+
+#define ES_RTC_CLK_SOURCE ES_C_RTC_SOURCE_LOSC
+
+
+
+
+/* codes_main */
+
+
+#ifndef ES_DEVICE_NAME_RTC
+#define ES_DEVICE_NAME_RTC "rtc"
+#endif
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_select.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_select.h
new file mode 100644
index 0000000000..47ac7c4e6a
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_select.h
@@ -0,0 +1,44 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_SELECT_H__
+#define __ES_CONF_INFO_SELECT_H__
+
+
+#define ES_C_ENABLE 1
+#define ES_C_DISABLE 0
+
+
+/* codes_main */
+//#define ES_USE_ASSERT ES_C_ENABLE
+
+#ifndef ES_USE_ASSERT
+#define ES_USE_ASSERT ES_C_DISABLE
+#endif
+
+
+#if ES_USE_ASSERT
+ #define USE_ASSERT
+#endif
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_spi.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_spi.h
new file mode 100644
index 0000000000..182bc4c44c
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_spi.h
@@ -0,0 +1,132 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_SPI_H__
+#define __ES_CONF_INFO_SPI_H__
+
+#include "es_conf_info_map.h"
+#include <ald_spi.h>
+#include <ald_gpio.h>
+#include <ald_cmu.h>
+
+/* SPI 配置 */
+
+#define SPI_BUS_CONFIG(_CONF_,_I_) do{_CONF_.mode = 0U; \
+ _CONF_.mode |= ( ES_SPI##_I_##_MASTER_SLAVE | \
+ ES_SPI##_I_##_WIRE_3_4 | \
+ ES_SPI##_I_##_CPHA_1_2 | \
+ ES_SPI##_I_##_CPOL_H_L | \
+ ES_SPI##_I_##_CS | \
+ ES_SPI##_I_##_M_L_SB ); \
+ _CONF_.data_width = ES_SPI##_I_##_DATA_W; \
+ _CONF_.max_hz = ES_SPI##_I_##_MAX_HZ; \
+ }while(0)
+
+
+// spi_config.mode &= ~RT_SPI_SLAVE; /* 主机模式 */
+// spi_config.mode &= ~RT_SPI_3WIRE; /* 4线,双向传输 */
+// spi_config.mode |= RT_SPI_CPHA; /* 第二边沿采样 */
+// spi_config.mode |= RT_SPI_CPOL; /* 空闲高电平 */
+// spi_config.mode |= RT_SPI_NO_CS; /* 禁用软件从机选择管理 */
+// spi_config.mode |= RT_SPI_MSB; /* 高位在前 */
+// spi_config.data_width = 8; /* 数据长度:8 */
+// spi_config.max_hz = 2000000; /* 最快时钟频率 */
+
+#define ES_C_SPI_CLK_POL_HIGH RT_SPI_CPOL
+#define ES_C_SPI_CLK_POL_LOW !RT_SPI_CPOL
+
+#define ES_C_SPI_CLK_PHA_FIRST !RT_SPI_CPHA
+#define ES_C_SPI_CLK_PHA_SECOND RT_SPI_CPHA
+
+#define ES_C_SPI_MSB RT_SPI_MSB
+#define ES_C_SPI_LSB RT_SPI_LSB
+
+#define ES_C_SPI_CS_LOW_LEVEL 0
+#define ES_C_SPI_CS_HIGH_LEVEL 1
+
+/* codes_main */
+
+
+#ifndef ES_DEVICE_NAME_SPI0_BUS
+#define ES_DEVICE_NAME_SPI0_BUS "spi0"
+#endif
+#ifndef ES_DEVICE_NAME_SPI0_DEV0
+#define ES_DEVICE_NAME_SPI0_DEV0 "spi00"
+#endif
+
+#ifndef ES_DEVICE_NAME_SPI1_BUS
+#define ES_DEVICE_NAME_SPI1_BUS "spi1"
+#endif
+#ifndef ES_DEVICE_NAME_SPI1_DEV0
+#define ES_DEVICE_NAME_SPI1_DEV0 "spi10"
+#endif
+
+
+#define ES_SPI_CS_LEVEL ES_C_SPI_CS_LOW_LEVEL
+
+#ifndef ES_SPI0_CPHA_1_2
+#define ES_SPI0_CPHA_1_2 ES_C_SPI_CLK_PHA_SECOND
+#endif
+#ifndef ES_SPI0_CPOL_H_L
+#define ES_SPI0_CPOL_H_L ES_C_SPI_CLK_POL_HIGH
+#endif
+#ifndef ES_SPI0_M_L_SB
+#define ES_SPI0_M_L_SB RT_SPI_MSB
+#endif
+#ifndef ES_SPI0_MAX_HZ
+#define ES_SPI0_MAX_HZ 2000000
+#endif
+#ifndef ES_SPI0_NSS_PIN
+#define ES_SPI0_NSS_PIN 0xFFFFFFFF
+#endif
+
+#ifndef ES_SPI1_CPHA_1_2
+#define ES_SPI1_CPHA_1_2 ES_C_SPI_CLK_PHA_SECOND
+#endif
+#ifndef ES_SPI1_CPOL_H_L
+#define ES_SPI1_CPOL_H_L ES_C_SPI_CLK_POL_HIGH
+#endif
+#ifndef ES_SPI1_M_L_SB
+#define ES_SPI1_M_L_SB RT_SPI_MSB
+#endif
+#ifndef ES_SPI1_MAX_HZ
+#define ES_SPI1_MAX_HZ 2000000
+#endif
+#ifndef ES_SPI1_NSS_PIN
+#define ES_SPI1_NSS_PIN 0xFFFFFFFF
+#endif
+
+
+
+#define ES_SPI0_MASTER_SLAVE !RT_SPI_SLAVE
+#define ES_SPI0_WIRE_3_4 !RT_SPI_3WIRE
+#define ES_SPI0_CS RT_SPI_NO_CS
+#define ES_SPI0_DATA_W 8
+
+#define ES_SPI1_MASTER_SLAVE !RT_SPI_SLAVE
+#define ES_SPI1_WIRE_3_4 !RT_SPI_3WIRE
+#define ES_SPI1_CS RT_SPI_NO_CS
+#define ES_SPI1_DATA_W 8
+
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/ES/es_conf_info_uart.h b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_uart.h
new file mode 100644
index 0000000000..2dd32aa220
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/ES/es_conf_info_uart.h
@@ -0,0 +1,206 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_UART_H__
+#define __ES_CONF_INFO_UART_H__
+
+#include "es_conf_info_map.h"
+#include <ald_gpio.h>
+#include <ald_uart.h>
+#include <ald_usart.h>
+#include <ald_cmu.h>
+
+
+
+#define ES_C_UART_PARITY_NONE PARITY_NONE
+#define ES_C_UART_PARITY_ODD PARITY_ODD
+#define ES_C_UART_PARITY_EVEN PARITY_EVEN
+
+#define ES_C_UART_STOP_1 STOP_BITS_1
+#define ES_C_UART_STOP_2 STOP_BITS_2
+
+
+/* UART 配置 */
+
+/* codes_main */
+
+
+
+#ifndef ES_DEVICE_NAME_UART0
+#define ES_DEVICE_NAME_UART0 "uart0"
+#endif
+#ifndef ES_DEVICE_NAME_UART1
+#define ES_DEVICE_NAME_UART1 "uart1"
+#endif
+#ifndef ES_DEVICE_NAME_UART2
+#define ES_DEVICE_NAME_UART2 "uart2"
+#endif
+#ifndef ES_DEVICE_NAME_UART3
+#define ES_DEVICE_NAME_UART3 "uart3"
+#endif
+#ifndef ES_DEVICE_NAME_USART0
+#define ES_DEVICE_NAME_USART0 "usart0"
+#endif
+#ifndef ES_DEVICE_NAME_USART1
+#define ES_DEVICE_NAME_USART1 "usart1"
+#endif
+
+#ifndef ES_CONF_UART0_BAUD_RATE
+#define ES_CONF_UART0_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART0_PARITY
+#define ES_CONF_UART0_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART0_STOP_BITS
+#define ES_CONF_UART0_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART1_BAUD_RATE
+#define ES_CONF_UART1_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART1_PARITY
+#define ES_CONF_UART1_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART1_STOP_BITS
+#define ES_CONF_UART1_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART2_BAUD_RATE
+#define ES_CONF_UART2_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART2_PARITY
+#define ES_CONF_UART2_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART2_STOP_BITS
+#define ES_CONF_UART2_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART3_BAUD_RATE
+#define ES_CONF_UART3_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART3_PARITY
+#define ES_CONF_UART3_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART3_STOP_BITS
+#define ES_CONF_UART3_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_USART0_BAUD_RATE
+#define ES_CONF_USART0_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_USART0_PARITY
+#define ES_CONF_USART0_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_USART0_STOP_BITS
+#define ES_CONF_USART0_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_USART1_BAUD_RATE
+#define ES_CONF_USART1_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_USART1_PARITY
+#define ES_CONF_USART1_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_USART1_STOP_BITS
+#define ES_CONF_USART1_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+
+#define ES_UART0_CONFIG \
+{ \
+ ES_CONF_UART0_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART0_STOP_BITS, \
+ ES_CONF_UART0_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART1_CONFIG \
+{ \
+ ES_CONF_UART1_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART1_STOP_BITS, \
+ ES_CONF_UART1_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART2_CONFIG \
+{ \
+ ES_CONF_UART2_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART2_STOP_BITS, \
+ ES_CONF_UART2_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART3_CONFIG \
+{ \
+ ES_CONF_UART3_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART3_STOP_BITS, \
+ ES_CONF_UART3_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_USART0_CONFIG \
+{ \
+ ES_CONF_USART0_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_USART0_STOP_BITS, \
+ ES_CONF_USART0_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_USART1_CONFIG \
+{ \
+ ES_CONF_USART1_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_USART1_STOP_BITS, \
+ ES_CONF_USART1_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/Kconfig b/bsp/essemi/es32f0654/drivers/Kconfig
index 3c3cf9e9e5..75d678805d 100644
--- a/bsp/essemi/es32f0654/drivers/Kconfig
+++ b/bsp/essemi/es32f0654/drivers/Kconfig
@@ -6,129 +6,7 @@ menu "Hardware Drivers Config"
select RT_USING_PIN
default y
- menu "UART Drivers"
- config BSP_USING_UART0
- bool "Enable UART0 PB10/PB11(T/R)"
- select RT_USING_SERIAL
- default n
-
- config BSP_USING_UART1
- bool "Enable UART1 PC10/PC11(T/R)"
- select RT_USING_SERIAL
- default n
-
- config BSP_USING_UART2
- bool "Enable UART2 PC12/PD02(T/R)"
- select RT_USING_SERIAL
- default y
- depends on !BSP_USING_HWTIMER1
-
- config BSP_USING_UART3
- bool "Enable UART3 PC04/PC05(T/R)"
- select RT_USING_SERIAL
- default n
- depends on !BSP_USING_HWTIMER2
- endmenu
-
- menu "SPI Drivers"
- config BSP_USING_SPI0
- bool "Enable SPI0 BUS PB03/PB04/PB05(CLK/MISO/MOSI)"
- select RT_USING_SPI
- select RT_USING_PIN
- default n
-
- config BSP_USING_SPI1
- bool "Enable SPI1 BUS PB13/PB14/PB15(CLK/MISO/MOSI)"
- select RT_USING_SPI
- select RT_USING_PIN
- default n
- endmenu
-
- menu "I2C Drivers"
- config BSP_USING_I2C0
- bool "Enable I2C0 BUS PB08/PB09(SCL/SDA)"
- select RT_USING_I2C
- default n
-
- config BSP_USING_I2C1
- bool "Enable I2C1 BUS PB10/PB11(SCL/SDA)"
- select RT_USING_I2C
- default n
- endmenu
-
- menu "CAN Drivers"
- config BSP_USING_CAN
- bool "Enable CAN BUS PA11/PA12(RX/TX)"
- select RT_USING_CAN
- default n
- endmenu
-
- menu "PWM Drivers"
- config BSP_USING_PWM0
- bool "Using PWM0 PA08/PA09/PA10/PA11"
- select RT_USING_PWM
- default n
-
- config BSP_USING_PWM1
- bool "Using PWM1 PB06/PB07/PB08/PB09"
- select RT_USING_PWM
- default n
-
- config BSP_USING_PWM2
- bool "Using PWM2 PA00/PA01"
- select RT_USING_PWM
- default n
-
- config BSP_USING_PWM3
- bool "Using PWM3 PC06/PC07"
- select RT_USING_PWM
- default n
- endmenu
-
- menu "HWtimer Drivers"
- config BSP_USING_HWTIMER0
- bool "Using timer0"
- select RT_USING_HWTIMER
- default n
-
- config BSP_USING_HWTIMER1
- bool "Using timer1"
- select RT_USING_HWTIMER
- default n
- depends on !BSP_USING_UART2
-
- config BSP_USING_HWTIMER2
- bool "Using timer2"
- select RT_USING_HWTIMER
- default n
- depends on !BSP_USING_UART3
-
- config BSP_USING_HWTIMER3
- bool "Using timer3"
- select RT_USING_HWTIMER
- default n
- endmenu
-
- menu "RTC Drivers"
- config BSP_USING_RTC
- bool "Using RTC"
- select RT_USING_RTC
- default n
- endmenu
-
- menu "PM Drivers"
- config BSP_USING_PM
- bool "Using PM"
- select RT_USING_PM
- default n
- endmenu
-
- menu "ADC Drivers"
- config BSP_USING_ADC
- bool "Using ADC"
- select RT_USING_ADC
- default n
- endmenu
+ source "drivers/ES/Kconfig"
endmenu
@@ -137,11 +15,21 @@ menu "Hardware Drivers Config"
config BSP_USING_SPI_FLASH
bool "Enable SPI FLASH (W25Q64 spi0)"
select BSP_USING_SPI
- select BSP_USING_SPI0
select RT_USING_SFUD
select RT_SFUD_USING_SFDP
default n
+if BSP_USING_SPI_FLASH
+
+ config ES_DEVICE_NAME_SPI_DEV
+ string "The name of spi device (registered)"
+ default "spi00"
+
+ config ES_DEVICE_NAME_SPI_FALSH_DEV
+ string "The name of spi flash device"
+ default "W25Q64"
+endif
+
endmenu
menu "Offboard Peripheral Drivers"
@@ -163,13 +51,17 @@ menu "Hardware Drivers Config"
bool "BSP_USING_EXAMPLE_I2C"
default n
+ config BSP_USING_EXAMPLE_I2C_E2PROM
+ bool "BSP_USING_EXAMPLE_I2C_E2PROM"
+ default n
+
config BSP_USING_EXAMPLE_LED_BLINK
bool "BSP_USING_EXAMPLE_LED_BLINK"
- default y
+ default n
config BSP_USING_EXAMPLE_PIN_BEEP
bool "BSP_USING_EXAMPLE_PIN_BEEP"
- default y
+ default n
config BSP_USING_EXAMPLE_PWM_LED
bool "BSP_USING_EXAMPLE_PWM_LED"
@@ -185,7 +77,7 @@ menu "Hardware Drivers Config"
config BSP_USING_EXAMPLE_UART
bool "BSP_USING_EXAMPLE_UART"
- default y
+ default n
config BSP_USING_EXAMPLE_CAN
bool "BSP_USING_EXAMPLE_CAN"
diff --git a/bsp/essemi/es32f0654/drivers/SConscript b/bsp/essemi/es32f0654/drivers/SConscript
index 280c6f5c90..0e34f50b2f 100644
--- a/bsp/essemi/es32f0654/drivers/SConscript
+++ b/bsp/essemi/es32f0654/drivers/SConscript
@@ -14,7 +14,10 @@ if GetDepend('RT_USING_PIN'):
src += ['drv_gpio.c']
# add serial driver code
-if GetDepend('BSP_USING_UART0') or GetDepend('BSP_USING_UART1') or GetDepend('BSP_USING_UART2') or GetDepend('BSP_USING_UART3'):
+if GetDepend('BSP_USING_UART0') or GetDepend('BSP_USING_UART1') or GetDepend('BSP_USING_UART2') or GetDepend('BSP_USING_UART3') or \
+ GetDepend('BSP_USING_UART4') or GetDepend('BSP_USING_UART5') or \
+ GetDepend('BSP_USING_USART0') or GetDepend('BSP_USING_USART1') or GetDepend('BSP_USING_USART2') or GetDepend('BSP_USING_USART3') or \
+ GetDepend('BSP_USING_USART4') or GetDepend('BSP_USING_USART5'):
src += ['drv_uart.c']
# add spi driver code
@@ -26,40 +29,50 @@ if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1'):
src += ['drv_i2c.c']
# add can driver code
-if GetDepend('BSP_USING_CAN'):
+if GetDepend('BSP_USING_CAN') or GetDepend('BSP_USING_CAN0') or GetDepend('RT_USING_CAN'):
src += ['drv_can.c']
+
+# add adc driver code
+if GetDepend(['BSP_USING_ADC0']) or GetDepend('BSP_USING_ADC'):
+ src += ['drv_adc.c']
+
+# add rtc driver code
+if GetDepend(['BSP_USING_RTC']):
+ src += ['drv_rtc.c']
+
# add spi flash driver code
if GetDepend('BSP_USING_SPI_FLASH'):
src += ['drv_spiflash.c']
-# add pwm driver code
-if GetDepend('BSP_USING_PWM0') or GetDepend('BSP_USING_PWM1') or GetDepend('BSP_USING_PWM2') or GetDepend('BSP_USING_PWM3'):
- src += ['drv_pwm.c']
-
# add hwtimer driver code
-if GetDepend('BSP_USING_HWTIMER0') or GetDepend('BSP_USING_HWTIMER1') or GetDepend('BSP_USING_HWTIMER2') or GetDepend('BSP_USING_HWTIMER3'):
+if GetDepend('BSP_USING_AD16C4T0_HWTIMER') or GetDepend('BSP_USING_AD16C4T1_HWTIMER') or \
+ GetDepend('BSP_USING_GP32C4T0_HWTIMER') or GetDepend('BSP_USING_GP32C4T1_HWTIMER') or \
+ GetDepend('BSP_USING_GP16C4T0_HWTIMER') or GetDepend('BSP_USING_GP16C4T1_HWTIMER') or \
+ GetDepend('BSP_USING_GP16C2T0_HWTIMER') or GetDepend('BSP_USING_GP16C2T1_HWTIMER') or \
+ GetDepend('BSP_USING_GP16C4T0_HWTIMER') or GetDepend('BSP_USING_GP16C4T1_HWTIMER') or \
+ GetDepend('BSP_USING_BS16T0_HWTIMER') or GetDepend('BSP_USING_BS16T1_HWTIMERIMER') or \
+ GetDepend('BSP_USING_BS16T2_HWTIMER') or GetDepend('BSP_USING_BS16T3_HWTIMER'):
src += ['drv_hwtimer.c']
-# add rtc driver code
-if GetDepend(['BSP_USING_RTC']):
- src += ['drv_rtc.c']
+# add pwm driver code
+if GetDepend('BSP_USING_AD16C4T0_PWM') or GetDepend('BSP_USING_AD16C4T1_PWM') or \
+ GetDepend('BSP_USING_GP16C4T0_PWM') or GetDepend('BSP_USING_GP16C4T1_PWM') or \
+ GetDepend('BSP_USING_GP16C2T0__PWM') or GetDepend('BSP_USING_GP16C2T1_PWM') or \
+ GetDepend('BSP_USING_GP32C4T0_PWM') or GetDepend('BSP_USING_GP32C4T1_PWM') or \
+ GetDepend('BSP_USING_GP16C4T0_PWM') or GetDepend('BSP_USING_GP16C4T1_PWM'):
+ src += ['drv_pwm.c']
# add pm driver code
if GetDepend(['BSP_USING_PM']):
src += ['drv_pm.c']
-
-# add adc driver code
-if GetDepend(['BSP_USING_ADC']):
- src += ['drv_adc.c']
-
CPPPATH = [cwd]
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
objs = objs + group
src = []
cwd = GetCurrentDir()
-include_path = [cwd]
+include_path = [cwd + '/ES']
if GetDepend('BSP_USING_EXAMPLE_ADC_VOL'):
src += ['bsp_driver_example/adc_vol_sample.c']
@@ -70,6 +83,9 @@ if GetDepend('BSP_USING_EXAMPLE_HWTIMER'):
if GetDepend('BSP_USING_EXAMPLE_I2C'):
src += ['bsp_driver_example/i2c_sample.c']
+if GetDepend('BSP_USING_EXAMPLE_I2C_E2PROM'):
+ src += ['bsp_driver_example/i2c_e2_sample.c']
+
if GetDepend('BSP_USING_EXAMPLE_LED_BLINK'):
src += ['bsp_driver_example/led_blink_sample.c']
diff --git a/bsp/essemi/es32f0654/drivers/board.c b/bsp/essemi/es32f0654/drivers/board.c
index 94b259e485..7411168324 100644
--- a/bsp/essemi/es32f0654/drivers/board.c
+++ b/bsp/essemi/es32f0654/drivers/board.c
@@ -1,12 +1,25 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
* 2019-01-23 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
@@ -14,7 +27,6 @@
#include "board.h"
#include "drv_uart.h"
#include "drv_gpio.h"
-#include <ald_cmu.h>
#include <ald_gpio.h>
/**
@@ -43,11 +55,65 @@ void NVIC_Configuration(void)
*******************************************************************************/
void SystemClock_Config(void)
{
- /* hosc 12MHz, from hosc/3 pll to 48MHz */
- ald_cmu_pll1_config(CMU_PLL1_INPUT_HOSC_3, CMU_PLL1_OUTPUT_48M);
+ SYSCFG_UNLOCK();
+#if ES_CMU_LRC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_LRCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_LRCEN_MSK);
+#endif /*ES_CMU_LRC_EN*/
+
+#if ES_CMU_LOSC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);
+#endif /*ES_CMU_LOSC_EN*/
+
+#if ES_CMU_HRC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_HRCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_HRCEN_MSK);
+#endif /*ES_CMU_HRC_EN*/
+
+#if ES_CMU_HOSC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_HOSCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_HOSCEN_MSK);
+#endif /*ES_CMU_HOSC_EN*/
- /* MCLK 48MHz*/
- ald_cmu_clock_config(CMU_CLOCK_PLL1, 48000000);
+ SYSCFG_LOCK();
+
+#if ES_CMU_PLL1_EN
+ /*PLL的源必须是4M*/
+ ald_cmu_pll1_config(ES_PLL1_REFER_CLK, ES_PLL1_OUT_CLK);
+
+ #if ES_CMU_PLL1_SAFE_EN
+ ald_cmu_pll_safe_config(ENABLE);
+ #else
+ ald_cmu_pll_safe_config(DISABLE);
+ #endif
+
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_PLL1EN_MSK);
+#endif /*ES_CMU_PLL1_EN*/
+
+ ald_cmu_clock_config(ES_SYS_CLK_SOURSE, ES_SYS_CLK);
+
+ ald_cmu_div_config(CMU_SYS,ES_CMU_SYS_DIV);
+ ald_cmu_div_config(CMU_HCLK_1,ES_CMU_HCLK_1_DIV);
+ ald_cmu_div_config(CMU_PCLK_1,ES_CMU_PCLK_1_DIV);
+ ald_cmu_div_config(CMU_PCLK_2,ES_CMU_PCLK_2_DIV);
+
+ ald_cmu_perh_clock_config(CMU_PERH_ALL, ENABLE);
+
+/*低功耗时钟使能*/
+#ifdef RT_USING_PM
+ SYSCFG_UNLOCK();
+ SET_BIT(CMU->LPENR, CMU_LPENR_LRCEN_MSK);
+ SET_BIT(CMU->LPENR, CMU_LPENR_LOSCEN_MSK);
+ SET_BIT(CMU->LPENR, CMU_LPENR_HRCEN_MSK);
+ SET_BIT(CMU->LPENR, CMU_LPENR_HOSCEN_MSK);
+ SYSCFG_LOCK();
+#endif
}
/*******************************************************************************
@@ -71,13 +137,22 @@ void SysTick_Handler(void)
{
/* enter interrupt */
rt_interrupt_enter();
-
+ ald_inc_tick();
rt_tick_increase();
/* leave interrupt */
rt_interrupt_leave();
}
+/**
+ * This is the cmu interrupt service.
+ *
+ */
+void CMU_Handler(void)
+{
+ ald_cmu_irq_handler();
+}
+
/*@}*/
/**
* This function will initial ES32F0 board.
diff --git a/bsp/essemi/es32f0654/drivers/board.h b/bsp/essemi/es32f0654/drivers/board.h
index 5b969142ac..a6fdd9e909 100644
--- a/bsp/essemi/es32f0654/drivers/board.h
+++ b/bsp/essemi/es32f0654/drivers/board.h
@@ -1,11 +1,24 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2019-01-23 wangyq the first version
+ * 2019-01-23 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
// <<< Use Configuration Wizard in Context Menu >>>
@@ -13,6 +26,7 @@
#define __BOARD_H__
#include <es32f065x.h>
+#include "es_conf_info_cmu.h"
#define ES32F0_SRAM_SIZE 0x8000
#define ES32F0_SRAM_END (0x20000000 + ES32F0_SRAM_SIZE)
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/adc_vol_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/adc_vol_sample.c
index 19eed3f35d..7d67c94070 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/adc_vol_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/adc_vol_sample.c
@@ -18,6 +18,9 @@
#include <rtthread.h>
#include <rtdevice.h>
+
+#ifdef RT_USING_ADC
+
#define ADC_DEV_NAME "adc0" /* ADC 设备名称 */
#define ADC_DEV_CHANNEL 5 /* PA1 ADC 通道 */
#define REFER_VOLTAGE 330 /* 参考电压 3.3V,数据精度乘以100保留2位小数*/
@@ -55,3 +58,5 @@ static int adc_vol_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(adc_vol_sample, adc voltage convert sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/can_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/can_sample.c
index 4c16d1d555..17f8f2007f 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/can_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/can_sample.c
@@ -18,7 +18,9 @@
#include <rtthread.h>
#include "rtdevice.h"
-#define CAN_DEV_NAME "can" /* CAN 设备名称 */
+#ifdef RT_USING_CAN
+
+#define CAN_DEV_NAME "can0" /* CAN 设备名称 */
static struct rt_semaphore rx_sem; /* 用于接收消息的信号量 */
static rt_device_t can_dev; /* CAN 设备句柄 */
@@ -142,3 +144,5 @@ int can_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(can_sample, can device sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/hwtimer_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/hwtimer_sample.c
index e2e39664f3..cc0b790643 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/hwtimer_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/hwtimer_sample.c
@@ -17,7 +17,9 @@
#include <rtthread.h>
#include <rtdevice.h>
-#define HWTIMER_DEV_NAME "timer0" /* 定时器名称 */
+#ifdef RT_USING_HWTIMER
+
+#define HWTIMER_DEV_NAME "timer1" /* 定时器名称 */
/* 定时器超时回调函数 */
static rt_err_t timeout_cb(rt_device_t dev, rt_size_t size)
@@ -83,3 +85,5 @@ static int hwtimer_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(hwtimer_sample, hwtimer sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_e2_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_e2_sample.c
new file mode 100644
index 0000000000..3bfd005e67
--- /dev/null
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_e2_sample.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-12-15 liuhy first implementation.
+ */
+/*
+ * 程序清单:这是一个 I2C 设备使用例程
+ * 例程导出了 i2c_e2_sample 命令到控制终端
+ * 命令调用格式:i2c_e2_sample
+ * 命令解释:使用默认的I2C总线设备i2c0
+ * 程序功能:通过 I2C 设备写读e2prom,ST24C04WP。
+*/
+
+/*ST24C04WP 有2个Block :Block0 的从机地址为:0x50,Block1 的从机地址为:0x51
+ 一个Block有 256字节,一页16字节,写只可在一页内(超过一页的范围后,会回到页的开始),读无页限制*/
+#include <rtthread.h>
+#include <rtdevice.h>
+
+#ifdef RT_USING_I2C
+
+#define I2C_BUS_NAME "i2c0" /*I2C总线设备名称 */
+#define SLAVE_ADDR 0x50 /*从机地址*/
+#define MEM_ADDR 0x00 /*从机的起始储存地址,范围:0x00到0xEF(例程写读范围:2页)*/
+#define ADDR_LEN 1 /*定义从机储存地址的长度,默认8位,1字节*/
+#define STR_LEN 16 /*接收发送的页数据长度 ,最大16*/
+
+static rt_uint8_t mem_addr,rx_buffer[33] = { 0U }; /*读两页,需要32字节,字符串结束'\0'*/
+/*第一个字节' '用来放 E2PROM 的内存地址,最后一个字节'\0'作为子串的结束,不存入e2prom*/
+static rt_uint8_t tx_buffer1[STR_LEN + ADDR_LEN + 1] = " e2prom example !\0";
+static rt_uint8_t tx_buffer2[STR_LEN + ADDR_LEN + 1] = " ABCDEFGH12345678\0";
+
+static void i2c_e2_sample(int argc, char *argv[])
+{
+ struct rt_i2c_bus_device *i2c_bus = RT_NULL; /* I2C总线设备句柄 */
+ struct rt_i2c_msg i2c_msg[2]; /* I2C消息 */
+ rt_size_t s_stat;
+
+ i2c_bus = (struct rt_i2c_bus_device *)rt_device_find(I2C_BUS_NAME); /* 通过名字获取I2C总线设备的句柄 */
+
+ if( i2c_bus == RT_NULL)
+ {
+ rt_kprintf("can't find i2c device :%s !\n",I2C_BUS_NAME);
+ return;
+ }
+
+ /*写T24C04WP
+ 如果 (MEM_ADDR & 0x0F) + STR_LEN <= 16, 写的范围为:(MEM_ADDR , MEM_ADDR + STR_LEN )
+ (0x10 + MEM_ADDR , 0x10 + MEM_ADDR + STR_LEN )
+ 如果 (MEM_ADDR & 0x0F) + STR_LEN > 16, 超出范围的部分会在页内循环写。*/
+ tx_buffer1[0] = MEM_ADDR;
+
+ /*初始化消息*/
+ i2c_msg[0].addr = SLAVE_ADDR; /* 从机地址 */
+ i2c_msg[0].len = ADDR_LEN + STR_LEN ; /* 写入的长度,地址+数据 */
+ i2c_msg[0].buf = tx_buffer1; /* 待写入第一段数据 */
+ i2c_msg[0].flags = RT_I2C_WR; /* I2C写 */
+ s_stat = rt_i2c_transfer(i2c_bus,i2c_msg,1); /* 写入第一段数据 */
+
+ if( s_stat == 1 )rt_kprintf("write successful. \nmessage: %s\n",&tx_buffer1[1]);
+ else rt_kprintf("device %s write fail \n",I2C_BUS_NAME);
+
+ tx_buffer2[0] = MEM_ADDR + 0x10; /*加一页*/
+ i2c_msg[0].buf = tx_buffer2; /* 待写入第二段数据 */
+ s_stat = rt_i2c_transfer(i2c_bus,i2c_msg,1); /* 写入第二段数据 */
+
+ if( s_stat == 1 )rt_kprintf("write successful. \nmessage: %s\n",&tx_buffer2[1]);
+ else rt_kprintf("device %s write fail \n",I2C_BUS_NAME);
+
+ /*读T24C04WP 读2页的数据。读数据需要2条消息:第一条消息:发送读取的地址。
+ 第二条消息:读取具体的数据。*/
+
+ mem_addr = MEM_ADDR & 0xF0; /*从页的开始读*/
+
+ i2c_msg[0].len = ADDR_LEN;
+ i2c_msg[0].buf = &mem_addr;
+
+ i2c_msg[1].addr = SLAVE_ADDR; /* 从机地址 */
+ i2c_msg[1].len = 32; /* 读取的数据长度:2*16 */
+ i2c_msg[1].buf = rx_buffer; /* 数据存放地址 */
+ i2c_msg[1].flags = RT_I2C_RD; /* I2C读 */
+ s_stat = rt_i2c_transfer(i2c_bus,i2c_msg,2); /* 读已写的2页 */
+
+ if( s_stat == 2 )rt_kprintf(" read successful \n messege : %s \n",rx_buffer);
+ else
+ rt_kprintf("read fail \n");
+
+ return;
+
+}
+/* 导出到 msh 命令列表中 */
+MSH_CMD_EXPORT(i2c_e2_sample, i2c e2prom sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_sample.c
index 2d386433c6..c8a666609d 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/i2c_sample.c
@@ -1,7 +1,19 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
@@ -11,14 +23,16 @@
* 程序清单:这是一个 I2C 设备使用例程
* 例程导出了 i2c_io_sample 命令到控制终端
* 命令调用格式:i2c_io_sample
- * 命令解释:使用默认的I2C总线设备
+ * 命令解释:使用默认的I2C总线设备i2c0
* 程序功能:通过 I2C 设备接收数据并打印,然后将接收的字符加1输出。
*/
#include <rtthread.h>
#include <rtdevice.h>
-#define I2C_BUS_NAME "i2c1" /* I2C总线设备名称 */
+#ifdef RT_USING_I2C
+
+#define I2C_BUS_NAME "i2c0" /* I2C总线设备名称 */
#define SLAVE_ADDR 0x2D /* 从机地址 */
#define STR_LEN 16 /* 接收发送的数据长度 */
@@ -95,3 +109,5 @@ static void i2c_io_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(i2c_io_sample, i2c io sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/pm_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/pm_sample.c
index f7287e36ac..78358e421c 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/pm_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/pm_sample.c
@@ -1,7 +1,19 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
@@ -11,15 +23,18 @@
* 程序清单:这是一个 pm睡眠唤醒的使用例程
* 例程导出了 pm_sample 命令到控制终端
* 命令调用格式:pm_sample
- * 命令解释:进入不同的睡眠模式,然后用按键唤醒
+ * 命令解释:进入不同的睡眠模式,然后用按键唤醒。
* 程序功能:通过串口输出字符串,告知进入睡眠和唤醒睡眠的情况。
+ * 注意:进入睡眠前,如果有中断挂起(SYSTICK、UART、EXTI等),睡眠将被瞬间唤醒。
*/
#include <rtthread.h>
#include <rtdevice.h>
+
+#ifdef RT_USING_PM
#define PM_NAME "pm" /* 设备名称 */
-#define WAKE_UP_PIN 18 /* 唤醒源 */
+#define WAKE_UP_PIN 19 /* 唤醒源 */
#define SLEEP_TIMES 12 /* 进入睡眠次数,轮流进入不同的睡眠模式,包括无睡眠模式 */
@@ -65,8 +80,9 @@ void sleep_in_out_callback(rt_uint8_t event, rt_uint8_t mode, void *data)
break;
/*睡眠唤醒后*/
case RT_PM_EXIT_SLEEP: g_pm_data.flag = 0; /*睡眠唤醒后*/
+ /*从深睡眠唤醒后,等待UART时钟未恢复稳定,输出可能丢失*/
rt_kprintf("\n\rEXIT\n\r");
- rt_pm_release(mode); /*释放休眠模式*/
+ rt_pm_request(PM_SLEEP_MODE_NONE); /*进无休眠模式*/
return;
default: break;
@@ -125,6 +141,9 @@ static void pm_test(void *parameter)
g_pm_data.flag = 2;
}
+
+ /*彻底释放无休眠模式*/
+ rt_pm_release_all(PM_SLEEP_MODE_NONE);
/*请求选择的休眠模式*/
rt_pm_request(in_mode[i%6]);
@@ -137,15 +156,21 @@ static void pm_test(void *parameter)
rt_thread_mdelay(500);
}
- /*释放选择的休眠模式*/
- rt_pm_release(in_mode[i%6]);
+ /*释放选择的休眠模式 ,彻底释放*/
+ rt_pm_release_all(in_mode[i%6]);
i++;
}
- /*清除回调函数和私有数据*/
+
+ /*切换为无睡眠模式*/
+ rt_pm_request(PM_SLEEP_MODE_NONE);
+
+ /*清除回调函数和私有数据*/
rt_pm_notify_set(RT_NULL,RT_NULL);
- rt_kprintf("thread pm_test close\n\r");
+
+ rt_kprintf("thread pm_test close\n\r");
+
}
/*按键唤醒的回调函数*/
@@ -181,3 +206,5 @@ static int pm_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(pm_sample, pm sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/pwm_led_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/pwm_led_sample.c
index ce1573aa55..23ecfd227e 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/pwm_led_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/pwm_led_sample.c
@@ -17,9 +17,12 @@
#include <rtthread.h>
#include <rtdevice.h>
+
+#ifdef RT_USING_PWM
+
#define LED_PIN_NUM 16 /* LED PIN脚编号,查看驱动文件drv_gpio.c确定 */
#define PWM_DEV_NAME "pwm1" /* PWM设备名称 */
-#define PWM_DEV_CHANNEL 4 /* PB9 PWM通道 */
+#define PWM_DEV_CHANNEL 1 /* PA8 PWM通道 */
struct rt_device_pwm *pwm_dev; /* PWM设备句柄 */
@@ -70,3 +73,6 @@ static int pwm_led_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(pwm_led_sample, pwm sample);
+
+#endif
+
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/rtc_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/rtc_sample.c
index 711a3a0ebb..6f732806f5 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/rtc_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/rtc_sample.c
@@ -17,6 +17,8 @@
#include <rtthread.h>
#include <rtdevice.h>
+#ifdef RT_USING_RTC
+
static int rtc_sample(int argc, char *argv[])
{
rt_err_t ret = RT_EOK;
@@ -49,3 +51,5 @@ static int rtc_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(rtc_sample, rtc sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/bsp_driver_example/spi_sample.c b/bsp/essemi/es32f0654/drivers/bsp_driver_example/spi_sample.c
index 994888cdb0..6f6e730288 100644
--- a/bsp/essemi/es32f0654/drivers/bsp_driver_example/spi_sample.c
+++ b/bsp/essemi/es32f0654/drivers/bsp_driver_example/spi_sample.c
@@ -1,7 +1,19 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
@@ -17,13 +29,14 @@
#include <rtthread.h>
#include <rtdevice.h>
+#ifdef RT_USING_SPI
+
#define SPI_DEVICE_NAME "spi00"
#define BUF_LEN 16
static void spi_io_sample(int argc, char *argv[])
{
struct rt_spi_device * spi_dev; /* spi设备的句柄 */
- struct rt_spi_configuration spi_config;
rt_uint8_t i,buffer[BUF_LEN] = { 0U };
rt_err_t s_stat;
rt_err_t result;
@@ -37,23 +50,8 @@ static void spi_io_sample(int argc, char *argv[])
return;
}
-
- /* 清空配置结构体 */
- rt_memset(&spi_config,0,sizeof(struct rt_spi_configuration));
-
- spi_config.mode &= ~RT_SPI_SLAVE; /* 主机模式 */
- spi_config.mode &= ~RT_SPI_3WIRE; /* 4线,双向传输 */
- spi_config.mode |= RT_SPI_CPHA; /* 第二边沿采样 */
- spi_config.mode |= RT_SPI_CPOL; /* 空闲高电平 */
- spi_config.mode |= RT_SPI_NO_CS; /* 禁用软件从机选择管理 */
- spi_config.mode |= RT_SPI_MSB; /* 高位在前 */
-
- spi_config.data_width = 8; /* 数据长度:8 */
-
- spi_config.max_hz = 2000000; /* 最快时钟频率 */
-
/* 配置SPI设备 */
- s_stat = rt_spi_configure(spi_dev,&spi_config);
+ s_stat = rt_spi_configure(spi_dev,&(spi_dev->config));
if(s_stat != RT_EOK)
{
@@ -150,3 +148,5 @@ static void spi_io_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(spi_io_sample, spi sample);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_adc.c b/bsp/essemi/es32f0654/drivers/drv_adc.c
index bc26b05802..bb1575c4a0 100644
--- a/bsp/essemi/es32f0654/drivers/drv_adc.c
+++ b/bsp/essemi/es32f0654/drivers/drv_adc.c
@@ -1,12 +1,25 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
* 2019-04-03 wangyq the first version
* 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
@@ -59,77 +72,69 @@ static adc_channel_t es32f0_adc_get_channel(rt_uint32_t channel)
{
case 0:
es32f0_channel = ADC_CHANNEL_0;
- ald_gpio_init(GPIOC, GPIO_PIN_0, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH0_GPIO, ES_GPIO_ADC_CH0_PIN, &gpio_initstruct);
break;
case 1:
es32f0_channel = ADC_CHANNEL_1;
- ald_gpio_init(GPIOC, GPIO_PIN_1, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH1_GPIO, ES_GPIO_ADC_CH1_PIN, &gpio_initstruct);
break;
case 2:
es32f0_channel = ADC_CHANNEL_2;
- ald_gpio_init(GPIOC, GPIO_PIN_2, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH2_GPIO, ES_GPIO_ADC_CH2_PIN, &gpio_initstruct);
break;
case 3:
es32f0_channel = ADC_CHANNEL_3;
- ald_gpio_init(GPIOC, GPIO_PIN_3, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH3_GPIO, ES_GPIO_ADC_CH3_PIN, &gpio_initstruct);
break;
case 4:
es32f0_channel = ADC_CHANNEL_4;
- ald_gpio_init(GPIOA, GPIO_PIN_0, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH4_GPIO, ES_GPIO_ADC_CH4_PIN, &gpio_initstruct);
break;
case 5:
es32f0_channel = ADC_CHANNEL_5;
- ald_gpio_init(GPIOA, GPIO_PIN_1, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH5_GPIO, ES_GPIO_ADC_CH5_PIN, &gpio_initstruct);
break;
case 6:
es32f0_channel = ADC_CHANNEL_6;
- ald_gpio_init(GPIOA, GPIO_PIN_2, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH6_GPIO, ES_GPIO_ADC_CH6_PIN, &gpio_initstruct);
break;
case 7:
es32f0_channel = ADC_CHANNEL_7;
- ald_gpio_init(GPIOA, GPIO_PIN_3, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH7_GPIO, ES_GPIO_ADC_CH7_PIN, &gpio_initstruct);
break;
case 8:
es32f0_channel = ADC_CHANNEL_8;
- ald_gpio_init(GPIOA, GPIO_PIN_4, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH8_GPIO, ES_GPIO_ADC_CH8_PIN, &gpio_initstruct);
break;
case 9:
es32f0_channel = ADC_CHANNEL_9;
- ald_gpio_init(GPIOA, GPIO_PIN_5, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH9_GPIO, ES_GPIO_ADC_CH9_PIN, &gpio_initstruct);
break;
case 10:
es32f0_channel = ADC_CHANNEL_10;
- ald_gpio_init(GPIOA, GPIO_PIN_6, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH10_GPIO, ES_GPIO_ADC_CH10_PIN, &gpio_initstruct);
break;
case 11:
es32f0_channel = ADC_CHANNEL_11;
- ald_gpio_init(GPIOA, GPIO_PIN_7, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH11_GPIO, ES_GPIO_ADC_CH11_PIN, &gpio_initstruct);
break;
case 12:
es32f0_channel = ADC_CHANNEL_12;
- ald_gpio_init(GPIOC, GPIO_PIN_4, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH12_GPIO, ES_GPIO_ADC_CH12_PIN, &gpio_initstruct);
break;
case 13:
es32f0_channel = ADC_CHANNEL_13;
- ald_gpio_init(GPIOC, GPIO_PIN_5, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH13_GPIO, ES_GPIO_ADC_CH13_PIN, &gpio_initstruct);
break;
case 14:
es32f0_channel = ADC_CHANNEL_14;
- ald_gpio_init(GPIOB, GPIO_PIN_0, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH14_GPIO, ES_GPIO_ADC_CH14_PIN, &gpio_initstruct);
break;
case 15:
es32f0_channel = ADC_CHANNEL_15;
- ald_gpio_init(GPIOB, GPIO_PIN_1, &gpio_initstruct);
- break;
- case 16:
- es32f0_channel = ADC_CHANNEL_16;
- break;
- case 17:
- es32f0_channel = ADC_CHANNEL_17;
- break;
- case 18:
- es32f0_channel = ADC_CHANNEL_18;
+ ald_gpio_init(ES_GPIO_ADC_CH15_GPIO, ES_GPIO_ADC_CH15_PIN, &gpio_initstruct);
break;
+
default:
break;
}
@@ -148,6 +153,9 @@ static rt_err_t es32f0_get_adc_value(struct rt_adc_device *device, rt_uint32_t c
/* config adc channel */
nm_config.ch = es32f0_adc_get_channel(channel);
nm_config.idx = ADC_NCH_IDX_1;
+
+/*aaabbbccc*/
+ nm_config.samp = ES_ADC0_NCH_SAMPLETIME;
nm_config.samp = ADC_SAMPLETIME_4;
ald_adc_normal_channel_config(_hadc, &nm_config);
@@ -168,24 +176,34 @@ static const struct rt_adc_ops es32f0_adc_ops =
int rt_hw_adc_init(void)
{
int result = RT_EOK;
- static adc_handle_t _h_adc0;
+
+ adc_handle_t _h_adc;
- /* adc function initialization */
+ _h_adc.init.scan = DISABLE;
+ _h_adc.init.cont = DISABLE;
+ _h_adc.init.disc = ADC_ALL_DISABLE;
+ _h_adc.init.disc_nr = ADC_DISC_NR_1;
+ _h_adc.init.nche_sel = ADC_NCHESEL_MODE_ALL;
+ _h_adc.init.n_ref = ADC_NEG_REF_VSS;
+ _h_adc.init.p_ref = ADC_POS_REF_VDD;
+ _h_adc.init.nch_nr = ADC_NCH_NR_16;
+
+#ifdef BSP_USING_ADC0
+
+ static adc_handle_t _h_adc0;
+
+ _h_adc0.init = _h_adc.init;
+
_h_adc0.perh = ADC0;
- _h_adc0.init.align = ADC_DATAALIGN_RIGHT;
- _h_adc0.init.scan = DISABLE;
- _h_adc0.init.cont = DISABLE;
- _h_adc0.init.disc = ADC_ALL_DISABLE;
- _h_adc0.init.disc_nr = ADC_DISC_NR_1;
- _h_adc0.init.data_bit = ADC_CONV_BIT_12;
- _h_adc0.init.div = ADC_CKDIV_128;
- _h_adc0.init.nche_sel = ADC_NCHESEL_MODE_ALL;
- _h_adc0.init.n_ref = ADC_NEG_REF_VSS;
- _h_adc0.init.p_ref = ADC_POS_REF_VDD;
+ _h_adc0.init.align = ES_ADC0_ALIGN;
+ _h_adc0.init.data_bit = ES_ADC0_DATA_BIT;
+ _h_adc0.init.div = ES_ADC0_CLK_DIV;
ald_adc_init(&_h_adc0);
-
- rt_hw_adc_register(&_device_adc0, "adc0", &es32f0_adc_ops, &_h_adc0);
-
+
+ result = rt_hw_adc_register(&_device_adc0, ES_DEVICE_NAME_ADC0, &es32f0_adc_ops, &_h_adc0);
+
+#endif /*BSP_USING_ADC0*/
+
return result;
}
INIT_BOARD_EXPORT(rt_hw_adc_init);
diff --git a/bsp/essemi/es32f0654/drivers/drv_adc.h b/bsp/essemi/es32f0654/drivers/drv_adc.h
index eaddd67407..fa51cdbb21 100644
--- a/bsp/essemi/es32f0654/drivers/drv_adc.h
+++ b/bsp/essemi/es32f0654/drivers/drv_adc.h
@@ -3,14 +3,29 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-04-03 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_ADC_H__
#define DRV_ADC_H__
+#include "es_conf_info_adc.h"
+
int rt_hw_adc_init(void);
#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_can.c b/bsp/essemi/es32f0654/drivers/drv_can.c
index cefddd997c..7c73acd0cf 100644
--- a/bsp/essemi/es32f0654/drivers/drv_can.c
+++ b/bsp/essemi/es32f0654/drivers/drv_can.c
@@ -1,51 +1,94 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2019-11-09 wangyq the first version
+ * 2019-11-09 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#include "drv_can.h"
-#ifdef BSP_USING_CAN
+#ifdef RT_USING_CAN
-static struct es32f0_can can;
-/* attention !!! baud calculation example: Pclk / ((sjw + seg1 + seg2) * psc) 48 / ((1 + 3 + 2) * 8) = 1MHz */
-static const struct es32f0_baud_rate_tab can_baud_rate_tab[] =
-{
- {CAN1MBaud, 8},
- {CAN800kBaud, 10},
- {CAN500kBaud, 16},
- {CAN250kBaud, 32},
- {CAN125kBaud, 64},
- {CAN100kBaud, 80},
- {CAN50kBaud, 160},
- {CAN20kBaud, 400},
- {CAN10kBaud, 800}
-};
+static struct es32f0_can can;
-static rt_uint32_t get_can_baud_index(rt_uint32_t baud)
-{
- rt_uint32_t len, index;
- len = sizeof(can_baud_rate_tab) / sizeof(can_baud_rate_tab[0]);
- for (index = 0; index < len; index++)
+static rt_uint32_t get_can_baud_index(rt_uint32_t baud,can_init_t * init)
+{
+/* attention !!! baud calculation example: Pclk / ((1 + seg1 + seg2) * psc) Pclk=48 / ((1 + seg1=3 + seg2=2) * 8) = 1MHz */
+ double target,temp,min;
+ uint32_t i,j,j_max,near = 0;
+ target = (double)(ald_cmu_get_pclk1_clock());
+ target/= baud; /*�������1*/
+
+ min = 0xFFFFFFFF;
+
+ for(i = 1 + 16 + 8 ;i > 2;i--) /*SYNC_SEG + SEG1 + SEG2*/
{
- if (can_baud_rate_tab[index].baud_rate == baud)
- return index;
+ j_max = target/i/(0.98) + 1; /*��С��Χ*/
+ j_max = (j_max > 1024) ? (1024) : (j_max);
+
+ for(j = target/i/1.02 ;j < j_max;j++)
+ {
+ temp = target/i/j; /*�������2*/
+ temp = (temp > 1) ? (temp - 1) : (1 - temp);
+ temp+= ((1.0 * i * j) / 0xFFFFFFFF) ;
+
+ if(temp < min)
+ {
+ if(temp > 0.000001)
+ {
+ near = (i<<16) + j;
+ min = temp;
+ }
+ else
+ {
+ init->seg1 = (can_seg1_t)((i - 1)*2/3-1);
+ init->seg2 = (can_seg2_t)(i - init->seg1 - 1 - 1 - 1);
+ init->psc = j;
+
+ return 0;
+ }
+ }
+ }
}
- return 0; /* default baud is CAN1MBaud */
+ if(min < 0.01)
+ {
+ i = near>>16;
+ j = near % (1<<16);
+ init->seg1 = (can_seg1_t)((i - 1)*2/3-1);
+ init->seg2 = (can_seg2_t)(i - init->seg1 - 1 - 1 - 1);
+ init->psc = j;
+
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
}
+
static rt_err_t _can_config(struct rt_can_device *can_device, struct can_configure *cfg)
{
struct es32f0_can *drv_can;
- rt_uint32_t baud_index;
RT_ASSERT(can_device);
RT_ASSERT(cfg);
@@ -56,7 +99,7 @@ static rt_err_t _can_config(struct rt_can_device *can_device, struct can_configu
drv_can->CanHandle.init.ttcm = DISABLE;
drv_can->CanHandle.init.abom = ENABLE;
drv_can->CanHandle.init.awk = DISABLE;
- drv_can->CanHandle.init.artx = DISABLE;
+ drv_can->CanHandle.init.artx = (type_func_t)ES_CAN0_AUTO_BAN_RE_T;
drv_can->CanHandle.init.rfom = DISABLE;
drv_can->CanHandle.init.txmp = ENABLE;
@@ -75,12 +118,20 @@ static rt_err_t _can_config(struct rt_can_device *can_device, struct can_configu
drv_can->CanHandle.init.mode = CAN_MODE_SILENT_LOOPBACK;
break;
}
+ /*����*/
+ if(get_can_baud_index(cfg->baud_rate,&(drv_can->CanHandle.init)))
+ {
+ return -RT_ERROR;
+ }
+ drv_can->CanHandle.init.sjw = (can_sjw_t)(cfg->reserved);
+
+ /* init can */
- baud_index = get_can_baud_index(cfg->baud_rate);
- drv_can->CanHandle.init.sjw = CAN_SJW_1;
- drv_can->CanHandle.init.seg1 = CAN_SEG1_3;
- drv_can->CanHandle.init.seg2 = CAN_SEG2_2;
- drv_can->CanHandle.init.psc = can_baud_rate_tab[baud_index].config_data;
+ // baud_index = get_can_baud_index(cfg->baud_rate);
+ //drv_can->CanHandle.init.sjw = CAN_SJW_1;
+ // drv_can->CanHandle.init.seg1 = CAN_SEG1_3;
+ // drv_can->CanHandle.init.seg2 = CAN_SEG2_2;
+ // drv_can->CanHandle.init.psc = can_baud_rate_tab[baud_index].config_data;
/* init can */
if (ald_can_init(&drv_can->CanHandle) != OK)
{
@@ -96,7 +147,10 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
{
rt_uint32_t argval;
struct es32f0_can *drv_can;
+
+#ifdef RT_CAN_USING_HDR
struct rt_can_filter_config *filter_cfg;
+#endif
RT_ASSERT(can_device != RT_NULL);
drv_can = (struct es32f0_can *)can_device->parent.user_data;
@@ -108,8 +162,12 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
argval = (rt_uint32_t) arg;
if (argval == RT_DEVICE_FLAG_INT_RX)
{
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_FP0 | CAN_IT_FF0 | CAN_IT_FOV0 |
- CAN_IT_FP1 | CAN_IT_FF1 | CAN_IT_FOV1), DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP0, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF0, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV0, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP1, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF1, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV1, DISABLE);
}
else if (argval == RT_DEVICE_FLAG_INT_TX)
{
@@ -117,8 +175,11 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
}
else if (argval == RT_DEVICE_CAN_INT_ERR)
{
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_WARN | CAN_IT_PERR | CAN_IT_BOF |
- CAN_IT_PRERR | CAN_IT_ERR), DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_WARN, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PERR, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_BOF, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PRERR, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_ERR, DISABLE);
}
break;
case RT_DEVICE_CTRL_SET_INT:
@@ -127,8 +188,14 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
{
NVIC_SetPriority(CAN0_IRQn, 1);
NVIC_EnableIRQ(CAN0_IRQn);
-
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_FP0 | CAN_IT_FP1), ENABLE);
+
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP0, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF0, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV0, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP1, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF1, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV1, ENABLE);
+
}
else if (argval == RT_DEVICE_FLAG_INT_TX)
{
@@ -141,11 +208,16 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
{
NVIC_SetPriority(CAN0_IRQn, 1);
NVIC_EnableIRQ(CAN0_IRQn);
-
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_WARN | CAN_IT_PERR | CAN_IT_BOF |
- CAN_IT_PRERR | CAN_IT_ERR), ENABLE);
+
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_WARN, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PERR, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_BOF, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PRERR, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_ERR, ENABLE);
+
}
break;
+#ifdef RT_CAN_USING_HDR
case RT_CAN_CMD_SET_FILTER:
if (RT_NULL == arg)
{
@@ -157,8 +229,55 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
filter_cfg = (struct rt_can_filter_config *)arg;
/* get default filter */
for (int i = 0; i < filter_cfg->count; i++)
- {
- drv_can->FilterConfig.number = filter_cfg->items[i].hdr;
+ {
+
+ /*Ĭ�Ϲ��˱��ж�*/
+ if(filter_cfg->items[i].hdr < drv_can->device.config.maxhdr)
+ drv_can->FilterConfig.number = filter_cfg->items[i].hdr;
+ else
+ drv_can->FilterConfig.number = ES_C_CAN_DEFAULT_FILTER_NUMBER;
+
+ if(filter_cfg->items[i].mode)
+ {
+ /*��ʶ���б�ģʽ�� ����ƥ�� ��idƥ��Ϊ�����յ�id = ���õ�id
+ ���� = ���õ�mask ��ͨ��*/
+ /*��չ֡*/
+ if(filter_cfg->items[i].ide)
+ {
+// filter_cfg->items[i].id = filter_cfg->items[i].id ; /*id 29 λ*/
+ filter_cfg->items[i].mask = ((filter_cfg->items[i].mask << 3) |
+ (filter_cfg->items[i].ide << 2) |
+ (filter_cfg->items[i].rtr << 1));
+ }
+ else /*��׼֡*/
+ {
+ filter_cfg->items[i].id = (filter_cfg->items[i].id << 18);
+ filter_cfg->items[i].mask = ((filter_cfg->items[i].mask << 21) |
+ (filter_cfg->items[i].ide << 2) |
+ (filter_cfg->items[i].rtr << 1));
+ }
+ }
+ else
+ {
+ /*��ʶ������ģʽ*/
+ /*��չ֡*/
+ if(filter_cfg->items[i].ide)
+ {
+ filter_cfg->items[i].mask = (filter_cfg->items[i].mask)<<3;
+ }
+ else /*��׼֡*/
+ {
+ filter_cfg->items[i].id = (filter_cfg->items[i].id)<<18;
+ filter_cfg->items[i].mask = (filter_cfg->items[i].mask)<<21;
+ }
+
+#if ES_C_CAN_FILTER_FRAME_TYPE
+ /*ƥ������*/
+ filter_cfg->items[i].mask |= 0x6;
+#endif
+
+ }
+
drv_can->FilterConfig.id_high = (filter_cfg->items[i].id >> 13) & 0xFFFF;
drv_can->FilterConfig.id_low = ((filter_cfg->items[i].id << 3) |
(filter_cfg->items[i].ide << 2) |
@@ -171,6 +290,8 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
}
}
break;
+
+#endif
case RT_CAN_CMD_SET_MODE:
argval = (rt_uint32_t) arg;
if (argval != RT_CAN_MODE_NORMAL &&
@@ -188,18 +309,7 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
break;
case RT_CAN_CMD_SET_BAUD:
argval = (rt_uint32_t) arg;
- if (argval != CAN1MBaud &&
- argval != CAN800kBaud &&
- argval != CAN500kBaud &&
- argval != CAN250kBaud &&
- argval != CAN125kBaud &&
- argval != CAN100kBaud &&
- argval != CAN50kBaud &&
- argval != CAN20kBaud &&
- argval != CAN10kBaud)
- {
- return -RT_ERROR;
- }
+
if (argval != drv_can->device.config.baud_rate)
{
drv_can->device.config.baud_rate = argval;
@@ -423,8 +533,11 @@ static void _can_rx_isr(struct rt_can_device *can, rt_uint32_t fifo)
/* RX interrupt */
else
{
+ if(CAN_RX_MSG_PENDING(h_can, CAN_RX_FIFO0) != 0)
+ {
/* save to user list */
rt_hw_can_isr(can, RT_CAN_EVENT_RX_IND | fifo << 8);
+ }
/* Clear FIFO0 rx Flag */
SET_BIT(h_can->perh->RXF0, CAN_RXF0_FREE_MSK);
@@ -441,8 +554,11 @@ static void _can_rx_isr(struct rt_can_device *can, rt_uint32_t fifo)
/* RX interrupt */
else
{
+ if(CAN_RX_MSG_PENDING(h_can, CAN_RX_FIFO1) != 0)
+ {
/* save to user list */
rt_hw_can_isr(can, RT_CAN_EVENT_RX_IND | fifo << 8);
+ }
/* Clear FIFO0 rx Flag */
SET_BIT(h_can->perh->RXF1, CAN_RXF1_FREE_MSK);
@@ -549,20 +665,12 @@ void CAN0_Handler(void)
can.device.status.errcode = errtype & 0x07;
h_can->perh->IFC |= CAN_IFC_ERRIFC_MSK;
}
-
rt_interrupt_leave();
}
int rt_hw_can_init(void)
{
gpio_init_t h_gpio;
- struct can_configure config = CANDEFAULTCONFIG;
-
- config.privmode = RT_CAN_MODE_NOPRIV;
- config.ticks = 50;
-#ifdef RT_CAN_USING_HDR
- config.maxhdr = 14;
-#endif
/* Initialize can common pin */
h_gpio.odos = GPIO_PUSH_PULL;
@@ -570,15 +678,22 @@ int rt_hw_can_init(void)
h_gpio.odrv = GPIO_OUT_DRIVE_NORMAL;
h_gpio.flt = GPIO_FILTER_DISABLE;
h_gpio.type = GPIO_TYPE_TTL;
- h_gpio.func = GPIO_FUNC_4;
+#if defined(ES_CAN0_RX_GPIO_FUNC)&&defined(ES_CAN0_RX_GPIO_PORT)&&defined(ES_CAN0_RX_GPIO_PIN)
/* Initialize can rx pin */
- h_gpio.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOA, GPIO_PIN_11, &h_gpio);
-
+ h_gpio.mode = GPIO_MODE_INPUT;
+ h_gpio.func = ES_CAN0_RX_GPIO_FUNC;
+ ald_gpio_init(ES_CAN0_RX_GPIO_PORT, ES_CAN0_RX_GPIO_PIN, &h_gpio);
+#endif
+
+
+#if defined(ES_CAN0_TX_GPIO_FUNC)&&defined(ES_CAN0_TX_GPIO_PORT)&&defined(ES_CAN0_TX_GPIO_PIN)
/* Initialize can tx pin */
- h_gpio.mode = GPIO_MODE_OUTPUT;
- ald_gpio_init(GPIOA, GPIO_PIN_12, &h_gpio);
+ h_gpio.mode = GPIO_MODE_OUTPUT;
+ h_gpio.func = ES_CAN0_TX_GPIO_FUNC;
+ ald_gpio_init(ES_CAN0_TX_GPIO_PORT, ES_CAN0_TX_GPIO_PIN, &h_gpio);
+#endif
+
/* config default filter */
can_filter_t filter = {0};
@@ -587,15 +702,21 @@ int rt_hw_can_init(void)
filter.mask_id_high = 0x0000;
filter.mask_id_low = 0x0000;
filter.fifo = CAN_FILTER_FIFO0;
- filter.number = 0;
+ filter.number = ES_C_CAN_DEFAULT_FILTER_NUMBER;
filter.mode = CAN_FILTER_MODE_MASK;
filter.scale = CAN_FILTER_SCALE_32;
filter.active = ENABLE;
can.FilterConfig = filter;
- can.device.config = config;
+ can.device.config = (struct can_configure)ES_CAN0_CONFIG;
+#ifdef RT_CAN_USING_HDR
+ can.device.config.maxhdr = 14;
+#endif
+ can.device.config.privmode = RT_CAN_MODE_NOPRIV;
+ can.device.config.ticks = 50;
+ can.device.config.reserved = ES_CAN0_SJW;
/* register CAN1 device */
- rt_hw_can_register(&can.device, "can", &_can_ops, &can);
+ rt_hw_can_register(&can.device, ES_DEVICE_NAME_CAN0, &_can_ops, &can);
return 0;
}
diff --git a/bsp/essemi/es32f0654/drivers/drv_can.h b/bsp/essemi/es32f0654/drivers/drv_can.h
index 798a3a8653..c89f2bb2ae 100644
--- a/bsp/essemi/es32f0654/drivers/drv_can.h
+++ b/bsp/essemi/es32f0654/drivers/drv_can.h
@@ -3,9 +3,22 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-11-09 wangyq the first version
+ * 2019-11-09 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_CAN_H__
@@ -14,16 +27,9 @@
#include <board.h>
#include <rtdevice.h>
#include <rtthread.h>
+#include "es_conf_info_can.h"
-#include <ald_can.h>
-#include <ald_gpio.h>
-
-struct es32f0_baud_rate_tab
-{
- rt_uint32_t baud_rate;
- rt_uint32_t config_data;
-};
-
+#ifdef RT_USING_CAN
/* es32f0 can device */
struct es32f0_can
{
@@ -34,4 +40,5 @@ struct es32f0_can
int rt_hw_can_init(void);
+#endif
#endif /*DRV_CAN_H__ */
diff --git a/bsp/essemi/es32f0654/drivers/drv_gpio.c b/bsp/essemi/es32f0654/drivers/drv_gpio.c
index 142fcce7fc..00050866e5 100644
--- a/bsp/essemi/es32f0654/drivers/drv_gpio.c
+++ b/bsp/essemi/es32f0654/drivers/drv_gpio.c
@@ -1,102 +1,33 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
* 2019-01-23 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
-#include <rthw.h>
-#include <rtdevice.h>
#include "board.h"
#include "drv_gpio.h"
-#include <ald_cmu.h>
-#include <ald_gpio.h>
-
-#ifdef RT_USING_PIN
-#define __ES32F0_PIN(index, gpio, gpio_index) {index, GPIO##gpio, GPIO_PIN_##gpio_index}
-#define __ES32F0_PIN_DEFAULT {-1, 0, 0}
+/*管脚映射在 es_conf_info_map.h 的 pins[] 中*/
-/* ES32F0 GPIO driver */
-struct pin_index
-{
- int index;
- GPIO_TypeDef *gpio;
- uint32_t pin;
-};
-
-static const struct pin_index pins[] =
-{
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN(2, C, 13),
- __ES32F0_PIN(3, C, 14),
- __ES32F0_PIN(4, C, 15),
- __ES32F0_PIN(5, H, 0),
- __ES32F0_PIN(6, H, 1),
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN(8, C, 0),
- __ES32F0_PIN(9, C, 1),
- __ES32F0_PIN(10, C, 2),
- __ES32F0_PIN(11, C, 3),
- __ES32F0_PIN(12, H, 3),
- __ES32F0_PIN(13, H, 4),
- __ES32F0_PIN(14, A, 0),
- __ES32F0_PIN(15, A, 1),
- __ES32F0_PIN(16, A, 2),
- __ES32F0_PIN(17, A, 3),
- __ES32F0_PIN(18, F, 0),
- __ES32F0_PIN(19, F, 1),
- __ES32F0_PIN(20, A, 4),
- __ES32F0_PIN(21, A, 5),
- __ES32F0_PIN(22, A, 6),
- __ES32F0_PIN(23, A, 7),
- __ES32F0_PIN(24, C, 4),
- __ES32F0_PIN(25, C, 5),
- __ES32F0_PIN(26, B, 0),
- __ES32F0_PIN(27, B, 1),
- __ES32F0_PIN(28, B, 2),
- __ES32F0_PIN(29, B, 10),
- __ES32F0_PIN(30, B, 11),
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN(33, B, 12),
- __ES32F0_PIN(34, B, 13),
- __ES32F0_PIN(35, B, 14),
- __ES32F0_PIN(36, B, 15),
- __ES32F0_PIN(37, C, 6),
- __ES32F0_PIN(38, C, 7),
- __ES32F0_PIN(39, C, 8),
- __ES32F0_PIN(40, C, 9),
- __ES32F0_PIN(41, A, 8),
- __ES32F0_PIN(42, A, 9),
- __ES32F0_PIN(43, A, 10),
- __ES32F0_PIN(44, A, 11),
- __ES32F0_PIN(45, A, 12),
- __ES32F0_PIN(46, A, 13),
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN(49, A, 14),
- __ES32F0_PIN(50, A, 15),
- __ES32F0_PIN(51, C, 10),
- __ES32F0_PIN(52, C, 11),
- __ES32F0_PIN(53, C, 12),
- __ES32F0_PIN(54, D, 2),
- __ES32F0_PIN(55, B, 3),
- __ES32F0_PIN(56, B, 4),
- __ES32F0_PIN(57, B, 5),
- __ES32F0_PIN(58, B, 6),
- __ES32F0_PIN(59, B, 7),
- __ES32F0_PIN(60, H, 2),
- __ES32F0_PIN(61, B, 8),
- __ES32F0_PIN(62, B, 9),
- __ES32F0_PIN_DEFAULT,
- __ES32F0_PIN_DEFAULT,
-};
+#ifdef RT_USING_PIN
struct pin_irq_map
{
@@ -143,6 +74,150 @@ struct rt_pin_irq_hdr pin_irq_hdr_tab[] =
{ -1, 0, RT_NULL, RT_NULL},
};
+#ifdef ES_CONF_EXTI_IRQ_0
+
+RT_WEAK void irq_pin0_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 0\r\n");
+}
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_1
+
+RT_WEAK void irq_pin1_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 1\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_2
+
+ RT_WEAK void irq_pin2_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 2\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_3
+
+RT_WEAK void irq_pin3_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 3\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_4
+
+RT_WEAK void irq_pin4_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 4\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_5
+
+RT_WEAK void irq_pin5_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 5\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_6
+
+RT_WEAK void irq_pin6_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 6\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_7
+
+RT_WEAK void irq_pin7_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 7\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_8
+
+RT_WEAK void irq_pin8_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 8\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_9
+
+RT_WEAK void irq_pin9_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 9\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_10
+
+RT_WEAK void irq_pin10_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 10\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_11
+
+RT_WEAK void irq_pin11_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 11\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_12
+
+RT_WEAK void irq_pin12_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 12\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_13
+
+RT_WEAK void irq_pin13_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 13\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_14
+
+RT_WEAK void irq_pin14_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 14\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_15
+
+RT_WEAK void irq_pin15_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 15\r\n");
+}
+
+#endif
+
+
#define ITEM_NUM(items) sizeof(items) / sizeof(items[0])
const struct pin_index *get_pin(uint8_t pin)
{
@@ -408,18 +483,9 @@ const static struct rt_pin_ops _es32f0_pin_ops =
es32f0_pin_attach_irq,
es32f0_pin_detach_irq,
es32f0_pin_irq_enable,
- RT_NULL,
+ /*RT_NULL,*/
};
-int rt_hw_pin_init(void)
-{
- int result;
- ald_cmu_perh_clock_config(CMU_PERH_GPIO, ENABLE);
- result = rt_device_pin_register("pin", &_es32f0_pin_ops, RT_NULL);
- return result;
-}
-INIT_BOARD_EXPORT(rt_hw_pin_init);
-
rt_inline void pin_irq_hdr(uint16_t GPIO_Pin)
{
uint16_t irqno;
@@ -488,4 +554,44 @@ void EXTI12_15_Handler(void)
rt_interrupt_leave();
}
+int rt_hw_pin_init(void)
+{
+ int result;
+
+
+#ifdef ES_INIT_GPIOS
+
+ rt_size_t i,gpio_conf_num = sizeof(gpio_conf_all) / sizeof(gpio_conf_t);
+
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_GPIO, ENABLE);
+
+ result = rt_device_pin_register(ES_DEVICE_NAME_PIN, &_es32f0_pin_ops, RT_NULL);
+
+ if(result != RT_EOK)return result;
+
+#ifdef ES_INIT_GPIOS
+
+ for(i = 0;i < gpio_conf_num;i++)
+ {
+ rt_pin_mode( gpio_conf_all[i].pin,gpio_conf_all[i].pin_mode);
+
+ if((gpio_conf_all[i].pin_mode == ES_C_GPIO_MODE_OUTPUT)||(gpio_conf_all[i].pin_mode == ES_C_GPIO_MODE_OUTPUT_OD))
+ rt_pin_write(gpio_conf_all[i].pin,gpio_conf_all[i].pin_level);
+
+ if(!gpio_conf_all[i].irq_en)continue;
+
+ rt_pin_attach_irq(gpio_conf_all[i].pin, gpio_conf_all[i].irq_mode, gpio_conf_all[i].callback, RT_NULL);
+ rt_pin_irq_enable(gpio_conf_all[i].pin, gpio_conf_all[i].irq_en);
+ }
+
+#endif
+
+
+
+ return result;
+}
+INIT_BOARD_EXPORT(rt_hw_pin_init);
+
#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_gpio.h b/bsp/essemi/es32f0654/drivers/drv_gpio.h
index 3032af51ba..b0b68714d3 100644
--- a/bsp/essemi/es32f0654/drivers/drv_gpio.h
+++ b/bsp/essemi/es32f0654/drivers/drv_gpio.h
@@ -3,14 +3,29 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-01-23 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_GPIO_H__
#define DRV_GPIO_H__
+#include "es_conf_info_gpio.h"
+
int rt_hw_pin_init(void);
#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_hwtimer.c b/bsp/essemi/es32f0654/drivers/drv_hwtimer.c
index 4d7614a323..83d3d9c87a 100644
--- a/bsp/essemi/es32f0654/drivers/drv_hwtimer.c
+++ b/bsp/essemi/es32f0654/drivers/drv_hwtimer.c
@@ -1,21 +1,33 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
* 2019-3-19 wangyq the first version
* 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <drv_hwtimer.h>
-#include <board.h>
-#include <ald_cmu.h>
-#include <ald_timer.h>
+#include <board.h>
+
#ifdef RT_USING_HWTIMER
@@ -26,93 +38,172 @@ struct es32f0_hwtimer_dev
IRQn_Type IRQn;
};
-#ifdef BSP_USING_HWTIMER0
-static struct es32f0_hwtimer_dev hwtimer0;
+#ifdef BSP_USING_AD16C4T0_HWTIMER
+static struct es32f0_hwtimer_dev ad16c4t0_hwtimer;
-void BS16T0_Handler(void)
+static struct rt_hwtimer_info ad16c4t0_info =
{
- ald_timer_clear_flag_status(hwtimer0.hwtimer_periph, TIMER_FLAG_UPDATE);
- rt_device_hwtimer_isr(&hwtimer0.parent);
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_AD16C4T0_HWTIMER_MODE
+};
- if (HWTIMER_MODE_ONESHOT == hwtimer0.parent.mode)
- {
- ald_timer_base_stop(hwtimer0.hwtimer_periph);
- }
+void AD16C4T0_BRK_UP_TRIG_COM_Handler(void)
+{
+ ald_timer_clear_flag_status(ad16c4t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&ad16c4t0_hwtimer.parent);
}
+
#endif
-#ifdef BSP_USING_HWTIMER1
-static struct es32f0_hwtimer_dev hwtimer1;
-/* can not use when UART2 Handler is enabled */
-void BS16T1_UART2_Handler(void)
+#ifdef BSP_USING_GP16C4T0_HWTIMER
+
+static struct es32f0_hwtimer_dev gp16c4t0_hwtimer;
+
+static struct rt_hwtimer_info gp16c4t0_info =
{
- /* if BS16T1 it */
- if (ald_timer_get_it_status(hwtimer1.hwtimer_periph, TIMER_IT_UPDATE) &&
- ald_timer_get_flag_status(hwtimer1.hwtimer_periph, TIMER_FLAG_UPDATE))
- {
- ald_timer_clear_flag_status(hwtimer1.hwtimer_periph, TIMER_FLAG_UPDATE);
- rt_device_hwtimer_isr(&hwtimer1.parent);
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_GP16C4T0_HWTIMER_MODE
+};
- if (HWTIMER_MODE_ONESHOT == hwtimer1.parent.mode)
- {
- ald_timer_base_stop(hwtimer1.hwtimer_periph);
- }
- }
+void GP16C4T0_LCD_Handler(void)
+{
+ ald_timer_clear_flag_status(gp16c4t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&gp16c4t0_hwtimer.parent);
}
+
#endif
-#ifdef BSP_USING_HWTIMER2
-static struct es32f0_hwtimer_dev hwtimer2;
-/* can not use when UART3 Handler is enabled */
-void BS16T2_UART3_Handler(void)
+#ifdef BSP_USING_GP16C2T0_HWTIMER
+
+static struct es32f0_hwtimer_dev gp16c2t0_hwtimer;
+
+static struct rt_hwtimer_info gp16c2t0_info =
{
- /* if BS16T2 it */
- if (ald_timer_get_it_status(hwtimer2.hwtimer_periph, TIMER_IT_UPDATE) &&
- ald_timer_get_flag_status(hwtimer2.hwtimer_periph, TIMER_FLAG_UPDATE))
- {
- ald_timer_clear_flag_status(hwtimer2.hwtimer_periph, TIMER_FLAG_UPDATE);
- rt_device_hwtimer_isr(&hwtimer2.parent);
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_GP16C2T0_HWTIMER_MODE
+};
- if (HWTIMER_MODE_ONESHOT == hwtimer2.parent.mode)
- {
- ald_timer_base_stop(hwtimer2.hwtimer_periph);
- }
- }
+void GP16C2T0_Handler(void)
+{
+ ald_timer_clear_flag_status(gp16c2t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&gp16c2t0_hwtimer.parent);
}
+
#endif
-#ifdef BSP_USING_HWTIMER3
-static struct es32f0_hwtimer_dev hwtimer3;
-/* can not use when DAC0 Handler is enabled */
-void BS16T3_DAC0_Handler(void)
+#ifdef BSP_USING_GP16C2T1_HWTIMER
+
+static struct es32f0_hwtimer_dev gp16c2t1_hwtimer;
+
+static struct rt_hwtimer_info gp16c2t1_info =
{
- /* if BS16T3 it */
- if (ald_timer_get_it_status(hwtimer3.hwtimer_periph, TIMER_IT_UPDATE) &&
- ald_timer_get_flag_status(hwtimer3.hwtimer_periph, TIMER_FLAG_UPDATE))
- {
- ald_timer_clear_flag_status(hwtimer3.hwtimer_periph, TIMER_FLAG_UPDATE);
- rt_device_hwtimer_isr(&hwtimer3.parent);
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_GP16C2T1_HWTIMER_MODE
+};
- if (HWTIMER_MODE_ONESHOT == hwtimer3.parent.mode)
- {
- ald_timer_base_stop(hwtimer3.hwtimer_periph);
- }
- }
+void GP16C2T1_Handler(void)
+{
+ ald_timer_clear_flag_status(gp16c2t1_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&gp16c2t1_hwtimer.parent);
+}
+
+#endif
+
+#ifdef BSP_USING_BS16T0_HWTIMER
+
+static struct es32f0_hwtimer_dev bs16t0_hwtimer;
+
+static struct rt_hwtimer_info bs16t0_info =
+{
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_BS16T0_HWTIMER_MODE
+};
+
+void BS16T0_Handler(void)
+{
+ ald_timer_clear_flag_status(bs16t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&bs16t0_hwtimer.parent);
+}
+
+#endif
+
+#ifdef BSP_USING_BS16T1_HWTIMER
+
+static struct es32f0_hwtimer_dev bs16t1_hwtimer;
+
+static struct rt_hwtimer_info bs16t1_info =
+{
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_BS16T1_HWTIMER_MODE
+};
+
+void BS16T1_UART2_Handler(void)
+{
+ ald_timer_clear_flag_status(bs16t1_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&bs16t1_hwtimer.parent);
+}
+
+#endif
+
+#ifdef BSP_USING_BS16T2_HWTIMER
+
+static struct es32f0_hwtimer_dev bs16t2_hwtimer;
+
+static struct rt_hwtimer_info bs16t2_info =
+{
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_BS16T2_HWTIMER_MODE
+};
+
+void BS16T2_UART3_Handler(void)
+{
+ ald_timer_clear_flag_status(bs16t2_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&bs16t2_hwtimer.parent);
}
+
#endif
-static struct rt_hwtimer_info es32f0_hwtimer_info =
+#ifdef BSP_USING_BS16T3_HWTIMER
+
+static struct es32f0_hwtimer_dev bs16t3_hwtimer;
+
+static struct rt_hwtimer_info bs16t3_info =
{
- 48000000, /* maximum count frequency */
- 1, /* minimum count frequency */
- 65535, /* counter maximum value */
- HWTIMER_CNTMODE_UP
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_BS16T3_HWTIMER_MODE
};
+void BS16T3_DAC0_Handler(void)
+{
+ ald_timer_clear_flag_status(bs16t3_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&bs16t3_hwtimer.parent);
+}
+
+#endif
+
static void es32f0_hwtimer_init(rt_hwtimer_t *timer, rt_uint32_t state)
{
struct es32f0_hwtimer_dev *hwtimer = (struct es32f0_hwtimer_dev *)timer->parent.user_data;
+ struct rt_hwtimer_info *hwtimer_info = (struct rt_hwtimer_info *)timer->info;
+
+
RT_ASSERT(hwtimer != RT_NULL);
if (1 == state)
@@ -121,9 +212,10 @@ static void es32f0_hwtimer_init(rt_hwtimer_t *timer, rt_uint32_t state)
ald_timer_interrupt_config(hwtimer->hwtimer_periph, TIMER_IT_UPDATE, ENABLE);
NVIC_EnableIRQ(hwtimer->IRQn);
}
- hwtimer->parent.freq = ald_cmu_get_pclk1_clock();
- es32f0_hwtimer_info.maxfreq = ald_cmu_get_pclk1_clock();
- es32f0_hwtimer_info.minfreq = ald_cmu_get_pclk1_clock();
+
+ hwtimer->parent.freq = ald_cmu_get_pclk1_clock()/((hwtimer->hwtimer_periph->perh->PRES & 0xFFFF)+1);
+ hwtimer_info->maxfreq = hwtimer->parent.freq;
+ hwtimer_info->minfreq = (hwtimer->parent.freq)/0xFFFF;
}
static rt_err_t es32f0_hwtimer_start(rt_hwtimer_t *timer,
@@ -175,10 +267,37 @@ static rt_err_t es32f0_hwtimer_control(rt_hwtimer_t *timer,
{
case HWTIMER_CTRL_FREQ_SET:
freq = *(rt_uint32_t *)args;
- if (freq != ald_cmu_get_pclk1_clock())
- {
- ret = -RT_ERROR;
+
+ ret = -RT_ERROR;
+
+ if(freq)
+ {
+ double temp,target;
+ temp = (double)ald_cmu_get_pclk1_clock();
+ target = temp/freq;
+
+ if(target < 0x10001) /*����Ƶ = max(PRES)+1*/
+ {
+ temp = target - (int)(target);
+
+ if((temp > 0.998)&&(target < 0x10000))
+ {
+ hwtimer->hwtimer_periph->perh->PRES = (uint32_t)target;
+ ret = RT_EOK;
+ }
+ if((temp < 0.002)&&(target >= 0x1))
+ {
+ hwtimer->hwtimer_periph->perh->PRES = (uint32_t)target - 1;
+ ret = RT_EOK;
+ }
+
+ }
+
+ if(ret == RT_EOK) /*������Ϣ*/
+ hwtimer->parent.freq = ald_cmu_get_pclk1_clock()/((hwtimer->hwtimer_periph->perh->PRES & 0xFFFF)+1);
+
}
+
break;
case HWTIMER_CTRL_STOP:
@@ -206,46 +325,127 @@ int rt_hw_hwtimer_init(void)
{
rt_err_t ret = RT_EOK;
-#ifdef BSP_USING_HWTIMER0
- static timer_handle_t _hwtimer_periph0;
- _hwtimer_periph0.perh = BS16T0;
- hwtimer0.IRQn = BS16T0_IRQn;
- hwtimer0.hwtimer_periph = &_hwtimer_periph0;
- hwtimer0.parent.info = &es32f0_hwtimer_info;
- hwtimer0.parent.ops = &es32f0_hwtimer_ops;
- ret = rt_device_hwtimer_register(&hwtimer0.parent, "timer0", &hwtimer0);
+#ifdef BSP_USING_AD16C4T0_HWTIMER
+ static timer_handle_t ad16c4t0_hwtimer_periph;
+
+ ad16c4t0_hwtimer_periph.perh = AD16C4T0;
+ ad16c4t0_hwtimer.IRQn = AD16C4T0_BRK_UP_TRIG_COM_IRQn;
+
+ ad16c4t0_hwtimer_periph.init.prescaler = ES_AD16C4T0_HWTIMER_PRES - 1;
+ ad16c4t0_hwtimer_periph.init.mode = ( ES_AD16C4T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ ad16c4t0_hwtimer.hwtimer_periph = &ad16c4t0_hwtimer_periph;
+
+ ad16c4t0_hwtimer.parent.info = &ad16c4t0_info;
+ ad16c4t0_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&ad16c4t0_hwtimer.parent, ES_DEVICE_NAME_AD16C4T0_HWTIMER, &ad16c4t0_hwtimer);
+#endif
+
+#ifdef BSP_USING_GP16C4T0_HWTIMER
+ static timer_handle_t gp16c4t0_hwtimer_periph;
+
+ gp16c4t0_hwtimer_periph.perh = GP16C4T0;
+ gp16c4t0_hwtimer.IRQn = GP16C4T0_LCD_IRQn;
+
+ gp16c4t0_hwtimer_periph.init.prescaler = ES_GP16C4T0_HWTIMER_PRES - 1;
+ gp16c4t0_hwtimer_periph.init.mode = ( ES_GP16C4T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ gp16c4t0_hwtimer.hwtimer_periph = &gp16c4t0_hwtimer_periph;
+
+ gp16c4t0_hwtimer.parent.info = &gp16c4t0_info;
+ gp16c4t0_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&gp16c4t0_hwtimer.parent, ES_DEVICE_NAME_GP16C4T0_HWTIMER, &gp16c4t0_hwtimer);
+#endif
+
+#ifdef BSP_USING_GP16C2T0_HWTIMER
+ static timer_handle_t gp16c2t0_hwtimer_periph;
+
+ gp16c2t0_hwtimer_periph.perh = GP16C2T0;
+ gp16c2t0_hwtimer.IRQn = GP16C2T0_IRQn;
+
+ gp16c2t0_hwtimer_periph.init.prescaler = ES_GP16C2T0_HWTIMER_PRES - 1;
+ gp16c2t0_hwtimer_periph.init.mode = ( ES_GP16C2T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ gp16c2t0_hwtimer.hwtimer_periph = &gp16c2t0_hwtimer_periph;
+
+ gp16c2t0_hwtimer.parent.info = &gp16c2t0_info;
+ gp16c2t0_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&gp16c2t0_hwtimer.parent, ES_DEVICE_NAME_GP16C2T0_HWTIMER, &gp16c2t0_hwtimer);
#endif
-#ifdef BSP_USING_HWTIMER1
- static timer_handle_t _hwtimer_periph1;
- _hwtimer_periph1.perh = BS16T1;
- hwtimer1.IRQn = BS16T1_UART2_IRQn;
- hwtimer1.hwtimer_periph = &_hwtimer_periph1;
- hwtimer1.parent.info = &es32f0_hwtimer_info;
- hwtimer1.parent.ops = &es32f0_hwtimer_ops;
- ret = rt_device_hwtimer_register(&hwtimer1.parent, "timer1", &hwtimer1);
+#ifdef BSP_USING_GP16C2T1_HWTIMER
+ static timer_handle_t gp16c2t1_hwtimer_periph;
+
+ gp16c2t1_hwtimer_periph.perh = GP16C2T1;
+ gp16c2t1_hwtimer.IRQn = GP16C2T1_IRQn;
+
+ gp16c2t1_hwtimer_periph.init.prescaler = ES_GP16C2T1_HWTIMER_PRES - 1;
+ gp16c2t1_hwtimer_periph.init.mode = ( ES_GP16C2T1_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ gp16c2t1_hwtimer.hwtimer_periph = &gp16c2t1_hwtimer_periph;
+
+ gp16c2t1_hwtimer.parent.info = &gp16c2t1_info;
+ gp16c2t1_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&gp16c2t1_hwtimer.parent, ES_DEVICE_NAME_GP16C2T1_HWTIMER, &gp16c2t1_hwtimer);
#endif
-#ifdef BSP_USING_HWTIMER2
- static timer_handle_t _hwtimer_periph2;
- _hwtimer_periph2.perh = BS16T2;
- hwtimer2.IRQn = BS16T2_UART3_IRQn;
- hwtimer2.hwtimer_periph = &_hwtimer_periph2;
- hwtimer2.parent.info = &es32f0_hwtimer_info;
- hwtimer2.parent.ops = &es32f0_hwtimer_ops;
- ret = rt_device_hwtimer_register(&hwtimer2.parent, "timer2", &hwtimer2);
+#ifdef BSP_USING_BS16T0_HWTIMER
+ static timer_handle_t bs16t0_hwtimer_periph;
+
+ bs16t0_hwtimer_periph.perh = BS16T0;
+ bs16t0_hwtimer.IRQn = BS16T0_IRQn;
+
+ bs16t0_hwtimer_periph.init.prescaler = ES_BS16T0_HWTIMER_PRES - 1;
+ bs16t0_hwtimer_periph.init.mode = ( ES_BS16T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ bs16t0_hwtimer.hwtimer_periph = &bs16t0_hwtimer_periph;
+
+ bs16t0_hwtimer.parent.info = &bs16t0_info;
+ bs16t0_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&bs16t0_hwtimer.parent, ES_DEVICE_NAME_BS16T0_HWTIMER, &bs16t0_hwtimer);
#endif
-#ifdef BSP_USING_HWTIMER3
- static timer_handle_t _hwtimer_periph3;
- _hwtimer_periph3.perh = BS16T3;
- hwtimer3.IRQn = BS16T3_DAC0_IRQn;
- hwtimer3.hwtimer_periph = &_hwtimer_periph3;
- hwtimer3.parent.info = &es32f0_hwtimer_info;
- hwtimer3.parent.ops = &es32f0_hwtimer_ops;
- ret = rt_device_hwtimer_register(&hwtimer3.parent, "timer3", &hwtimer3);
+#ifdef BSP_USING_BS16T1_HWTIMER
+ static timer_handle_t bs16t1_hwtimer_periph;
+
+ bs16t1_hwtimer_periph.perh = BS16T1;
+ bs16t1_hwtimer.IRQn = BS16T1_UART2_IRQn;
+
+ bs16t1_hwtimer_periph.init.prescaler = ES_BS16T1_HWTIMER_PRES - 1;
+ bs16t1_hwtimer_periph.init.mode = ( ES_BS16T1_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ bs16t1_hwtimer.hwtimer_periph = &bs16t1_hwtimer_periph;
+
+ bs16t1_hwtimer.parent.info = &bs16t1_info;
+ bs16t1_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&bs16t1_hwtimer.parent, ES_DEVICE_NAME_BS16T1_HWTIMER, &bs16t1_hwtimer);
#endif
+#ifdef BSP_USING_BS16T2_HWTIMER
+ static timer_handle_t bs16t2_hwtimer_periph;
+
+ bs16t2_hwtimer_periph.perh = BS16T2;
+ bs16t2_hwtimer.IRQn = BS16T2_UART3_IRQn;
+
+ bs16t2_hwtimer_periph.init.prescaler = ES_BS16T2_HWTIMER_PRES - 1;
+ bs16t2_hwtimer_periph.init.mode = ( ES_BS16T2_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ bs16t2_hwtimer.hwtimer_periph = &bs16t2_hwtimer_periph;
+
+ bs16t2_hwtimer.parent.info = &bs16t2_info;
+ bs16t2_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&bs16t2_hwtimer.parent, ES_DEVICE_NAME_BS16T2_HWTIMER, &bs16t2_hwtimer);
+#endif
+
+#ifdef BSP_USING_BS16T3_HWTIMER
+ static timer_handle_t bs16t3_hwtimer_periph;
+
+ bs16t3_hwtimer_periph.perh = BS16T3;
+ bs16t3_hwtimer.IRQn = BS16T3_DAC0_IRQn;
+
+ bs16t3_hwtimer_periph.init.prescaler = ES_BS16T3_HWTIMER_PRES - 1;
+ bs16t3_hwtimer_periph.init.mode = ( ES_BS16T3_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ bs16t3_hwtimer.hwtimer_periph = &bs16t3_hwtimer_periph;
+
+ bs16t3_hwtimer.parent.info = &bs16t3_info;
+ bs16t3_hwtimer.parent.ops = &es32f0_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&bs16t3_hwtimer.parent, ES_DEVICE_NAME_BS16T3_HWTIMER, &bs16t3_hwtimer);
+#endif
+
+
return ret;
}
INIT_BOARD_EXPORT(rt_hw_hwtimer_init);
diff --git a/bsp/essemi/es32f0654/drivers/drv_hwtimer.h b/bsp/essemi/es32f0654/drivers/drv_hwtimer.h
index e18d580fbd..46e307a5c3 100644
--- a/bsp/essemi/es32f0654/drivers/drv_hwtimer.h
+++ b/bsp/essemi/es32f0654/drivers/drv_hwtimer.h
@@ -3,14 +3,28 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-3-19 wangyq the first version
+ * 2019-3-19 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_HWTIMER_H__
#define DRV_HWTIMER_H__
+#include "es_conf_info_hwtimer.h"
int rt_hw_hwtimer_init(void);
#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_i2c.c b/bsp/essemi/es32f0654/drivers/drv_i2c.c
index 399e1427ef..1109b7f641 100644
--- a/bsp/essemi/es32f0654/drivers/drv_i2c.c
+++ b/bsp/essemi/es32f0654/drivers/drv_i2c.c
@@ -1,8 +1,19 @@
/*
- * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-01-24 wangyq the first version
@@ -10,19 +21,24 @@
* 2020-12-15 liuhy update libraries
*/
+#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
-#include <rtdbg.h>
#include "board.h"
#include "drv_i2c.h"
-#include <ald_i2c.h>
-#include <ald_gpio.h>
+
#ifdef RT_USING_I2C
#define TIMEOUT 0x0FFF
/* I2C struct definition */
-static i2c_handle_t _h_i2c0, _h_i2c1;
+#ifdef BSP_USING_I2C0
+ static i2c_handle_t _h_i2c0;
+#endif
+
+#ifdef BSP_USING_I2C1
+ static i2c_handle_t _h_i2c1;
+#endif
static void _i2c_init(void)
{
@@ -38,35 +54,55 @@ static void _i2c_init(void)
gpio_instruct.func = GPIO_FUNC_5;
#ifdef BSP_USING_I2C0
+
+#if defined(ES_I2C0_SCL_GPIO_FUNC)&&defined(ES_I2C0_SCL_GPIO_PORT)&&defined(ES_I2C0_SCL_GPIO_PIN)
+ gpio_instruct.func = ES_I2C0_SCL_GPIO_FUNC;
+ ald_gpio_init(ES_I2C0_SCL_GPIO_PORT, ES_I2C0_SCL_GPIO_PIN, &gpio_instruct);
+#endif
+
+#if defined(ES_I2C0_SDA_GPIO_FUNC)&&defined(ES_I2C0_SDA_GPIO_PORT)&&defined(ES_I2C0_SDA_GPIO_PIN)
+ gpio_instruct.func = ES_I2C0_SDA_GPIO_FUNC;
+ ald_gpio_init(ES_I2C0_SDA_GPIO_PORT, ES_I2C0_SDA_GPIO_PIN, &gpio_instruct);
+#endif
+
/* Initialize I2C Function */
_h_i2c0.perh = I2C0;
- _h_i2c0.init.clk_speed = 100000;
_h_i2c0.init.duty = I2C_DUTYCYCLE_2;
- _h_i2c0.init.own_addr1 = 0x0A;
- _h_i2c0.init.addr_mode = I2C_ADDR_7BIT;
- _h_i2c0.init.general_call = I2C_GENERALCALL_DISABLE;
- _h_i2c0.init.no_stretch = I2C_NOSTRETCH_ENABLE;
+ _h_i2c0.init.clk_speed = ES_I2C0_CLK_SPEED;
+ _h_i2c0.init.own_addr1 = ES_I2C0_OWN_ADDR1;
+ _h_i2c0.init.addr_mode = ES_I2C0_ADDR_MODE;
+ _h_i2c0.init.general_call = ES_I2C0_GENERAL_CALL;
+ _h_i2c0.init.no_stretch = ES_I2C0_STRETCH;
ald_i2c_reset(&_h_i2c0);
ald_i2c_init(&_h_i2c0);
- /* I2C0_SCL->PB8, I2C0_SDA->PB9 */
- ald_gpio_init(GPIOB, GPIO_PIN_8 | GPIO_PIN_9, &gpio_instruct);
+
#endif
#ifdef BSP_USING_I2C1
+
+#if defined(ES_I2C1_SDA_GPIO_FUNC)&&defined(ES_I2C1_SDA_GPIO_PORT)&&defined(ES_I2C1_SDA_GPIO_PIN)
+ gpio_instruct.func = ES_I2C1_SDA_GPIO_FUNC;
+ ald_gpio_init(ES_I2C1_SDA_GPIO_PORT, ES_I2C1_SDA_GPIO_PIN, &gpio_instruct);
+#endif
+
+#if defined(ES_I2C1_SDA_GPIO_FUNC)&&defined(ES_I2C1_SDA_GPIO_PORT)&&defined(ES_I2C1_SDA_GPIO_PIN)
+ gpio_instruct.func = ES_I2C1_SDA_GPIO_FUNC;
+ ald_gpio_init(ES_I2C1_SDA_GPIO_PORT, ES_I2C1_SDA_GPIO_PIN, &gpio_instruct);
+#endif
+
/* Initialize i2c function */
_h_i2c1.perh = I2C1;
- _h_i2c1.init.clk_speed = 100000;
- _h_i2c1.init.duty = I2C_DUTYCYCLE_2;
- _h_i2c1.init.own_addr1 = 0xA0;
- _h_i2c1.init.addr_mode = I2C_ADDR_7BIT;
- _h_i2c1.init.general_call = I2C_GENERALCALL_DISABLE;
- _h_i2c1.init.no_stretch = I2C_NOSTRETCH_ENABLE;
-
+ _h_i2c1.init.duty = I2C_DUTYCYCLE_2;
+ _h_i2c1.init.clk_speed = ES_I2C1_CLK_SPEED;
+ _h_i2c1.init.own_addr1 = ES_I2C1_OWN_ADDR1;
+ _h_i2c1.init.addr_mode = ES_I2C1_ADDR_MODE;
+ _h_i2c1.init.general_call = ES_I2C1_GENERAL_CALL;
+ _h_i2c1.init.no_stretch = ES_I2C1_STRETCH;
+
ald_i2c_reset(&_h_i2c1);
ald_i2c_init(&_h_i2c1);
- /* I2C1_SCL->PB10, I2C1_SDA->PB11 */
- ald_gpio_init(GPIOB, GPIO_PIN_10 | GPIO_PIN_11, &gpio_instruct);
+
#endif
}
@@ -116,6 +152,8 @@ const struct rt_i2c_bus_device_ops es32f0_i2c_ops =
int rt_hw_i2c_init(void)
{
+ int result = RT_EOK;
+
_i2c_init();
#ifdef BSP_USING_I2C0
@@ -124,16 +162,25 @@ int rt_hw_i2c_init(void)
rt_memset((void *)&_i2c_device0, 0, sizeof(struct rt_i2c_bus_device));
_i2c_device0.ops = &es32f0_i2c_ops;
_i2c_device0.priv = &_h_i2c0;
- rt_i2c_bus_device_register(&_i2c_device0, "i2c0");
+ result = rt_i2c_bus_device_register(&_i2c_device0, ES_DEVICE_NAME_I2C0);
+ if (result != RT_EOK)
+ {
+ return result;
+ }
#endif
#ifdef BSP_USING_I2C1
/* define i2c Instance */
static struct rt_i2c_bus_device _i2c_device1;
rt_memset((void *)&_i2c_device1, 0, sizeof(struct rt_i2c_bus_device));
+
_i2c_device1.ops = &es32f0_i2c_ops;
_i2c_device1.priv = &_h_i2c1;
- rt_i2c_bus_device_register(&_i2c_device1, "i2c1");
+ rt_i2c_bus_device_register(&_i2c_device1, ES_DEVICE_NAME_I2C1);
+ if (result != RT_EOK)
+ {
+ return result;
+ }
#endif
return RT_EOK;
diff --git a/bsp/essemi/es32f0654/drivers/drv_i2c.h b/bsp/essemi/es32f0654/drivers/drv_i2c.h
index 84c32561c8..b5cc316ee7 100644
--- a/bsp/essemi/es32f0654/drivers/drv_i2c.h
+++ b/bsp/essemi/es32f0654/drivers/drv_i2c.h
@@ -1,16 +1,31 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2019-01-24 wangyq the first version
+ * 2019-01-24 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_I2C_H__
#define DRV_I2C_H__
+#include "es_conf_info_i2c.h"
+
int rt_hw_i2c_init(void);
#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_pm.c b/bsp/essemi/es32f0654/drivers/drv_pm.c
index 669514c7b8..c1b4c41237 100644
--- a/bsp/essemi/es32f0654/drivers/drv_pm.c
+++ b/bsp/essemi/es32f0654/drivers/drv_pm.c
@@ -3,20 +3,30 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-04-08 wangyq the first version
* 2019-11-01 wangyq adapt to the new power management interface
+ * 2020-12-15 liuhy the first version
*/
-#include <rthw.h>
-#include <board.h>
-#include <rtdevice.h>
-#include <ald_cmu.h>
-#include <ald_pmu.h>
+#include "drv_pm.h"
#ifdef RT_USING_PM
+
static void uart_console_reconfig(void)
{
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
@@ -24,26 +34,14 @@ static void uart_console_reconfig(void)
rt_device_control(rt_console_get_device(), RT_DEVICE_CTRL_CONFIG, &config);
}
-static void delay(void)
-{
- long i;
- rt_base_t level;
-
- level = rt_hw_interrupt_disable();
- i = 0;
- do{
- i++;
- }
- while (i < 10000);
-
- rt_hw_interrupt_enable(level);
-}
-
/**
- * This function will put ES32F033x into sleep mode.
+ * This function will put ES32F065x into sleep mode.
*
* @param pm pointer to power manage structure
*/
+
+
+/* 注意:进入睡眠前,如果有中断挂起(SYSTICK、PENDSV、UART、EXTI等),睡眠将被瞬间唤醒。*/
static void sleep(struct rt_pm *pm, uint8_t mode)
{
switch (mode)
@@ -52,31 +50,26 @@ static void sleep(struct rt_pm *pm, uint8_t mode)
break;
case PM_SLEEP_MODE_IDLE:
- //__WFI();
break;
case PM_SLEEP_MODE_LIGHT:
/* Enter SLEEP Mode, Main regulator is ON */
ald_pmu_stop1_enter();
- delay();
break;
- case PM_SLEEP_MODE_DEEP:
- /* Enter STOP 2 mode */
+ case PM_SLEEP_MODE_DEEP:
+ /* Enter STOP 2 mode */
ald_pmu_stop2_enter();
- delay();
break;
case PM_SLEEP_MODE_STANDBY:
- /* Enter STANDBY mode */
+ /* Enter STANDBY mode */
ald_pmu_stop2_enter();
- delay();
break;
case PM_SLEEP_MODE_SHUTDOWN:
- /* Enter SHUTDOWNN mode */
+ /* Enter SHUTDOWNN mode */
ald_pmu_stop2_enter();
- delay();
break;
default:
diff --git a/bsp/essemi/es32f0654/drivers/drv_pm.h b/bsp/essemi/es32f0654/drivers/drv_pm.h
index a4f6cc84ee..e43ba09c26 100644
--- a/bsp/essemi/es32f0654/drivers/drv_pm.h
+++ b/bsp/essemi/es32f0654/drivers/drv_pm.h
@@ -3,7 +3,20 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
+
* Date Author Notes
* 2019-04-01 wangyq the first version
*/
@@ -11,6 +24,12 @@
#ifndef DRV_PM_H__
#define DRV_PM_H__
+#include <rthw.h>
+#include <board.h>
+#include <rtdevice.h>
+#include "es_conf_info_pm.h"
+#include <string.h>
+
int rt_hw_pm_init(void);
#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_pwm.c b/bsp/essemi/es32f0654/drivers/drv_pwm.c
index d324e2bbbb..59e8494241 100644
--- a/bsp/essemi/es32f0654/drivers/drv_pwm.c
+++ b/bsp/essemi/es32f0654/drivers/drv_pwm.c
@@ -3,28 +3,33 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-03-11 wangyq the first version
* 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
-#include <ald_cmu.h>
-#include <ald_timer.h>
-#include <ald_gpio.h>
+#include "es_conf_info_pwm.h"
-static void pwm_set_freq(timer_handle_t *timer_initstruct, uint32_t ns)
-{
- uint64_t _arr = (uint64_t)ald_cmu_get_pclk1_clock() * ns / 1000000000 /
- (timer_initstruct->init.prescaler + 1);
- WRITE_REG(timer_initstruct->perh->AR, (uint32_t)_arr);
- timer_initstruct->init.period = (uint32_t)_arr;
-}
+#ifdef RT_USING_PWM
static void pwm_set_duty(timer_handle_t *timer_initstruct, timer_channel_t ch, uint32_t ns)
{
@@ -44,7 +49,8 @@ static void pwm_set_duty(timer_handle_t *timer_initstruct, timer_channel_t ch, u
static rt_err_t es32f0_pwm_control(struct rt_device_pwm *device, int cmd, void *arg)
{
rt_err_t ret = RT_EOK;
- uint32_t _ccep;
+ uint64_t _arr,bus_speed,tmp;
+ uint32_t _maxcnt,_ccep_ch_en = 0U;
timer_channel_t pwm_channel;
timer_oc_init_t tim_ocinit;
timer_handle_t *timer_initstruct = (timer_handle_t *)device->parent.user_data;
@@ -52,39 +58,30 @@ static rt_err_t es32f0_pwm_control(struct rt_device_pwm *device, int cmd, void *
RT_ASSERT(timer_initstruct != RT_NULL);
- tim_ocinit.oc_mode = TIMER_OC_MODE_PWM1;
- tim_ocinit.oc_polarity = TIMER_OC_POLARITY_HIGH;
- tim_ocinit.oc_fast_en = DISABLE;
- tim_ocinit.ocn_polarity = TIMER_OCN_POLARITY_HIGH;
- tim_ocinit.ocn_idle = TIMER_OCN_IDLE_RESET;
- tim_ocinit.oc_idle = TIMER_OC_IDLE_RESET;
-
/* select pwm output channel */
if (1 == cfg->channel)
{
pwm_channel = TIMER_CHANNEL_1;
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC1EN_MSK;
}
- else if (2 == cfg->channel)
+ else if (2 == cfg->channel)
{
pwm_channel = TIMER_CHANNEL_2;
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC2EN_MSK;
}
- else if (3 == cfg->channel)
+ else if (3 == cfg->channel)
{
- if (timer_initstruct->perh == GP16C2T0 || timer_initstruct->perh == GP16C2T1)
- return RT_EINVAL;
pwm_channel = TIMER_CHANNEL_3;
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC3EN_MSK;
}
- else if (4 == cfg->channel)
+ else if (4 == cfg->channel)
{
- if (timer_initstruct->perh == GP16C2T0 || timer_initstruct->perh == GP16C2T1)
- return RT_EINVAL;
pwm_channel = TIMER_CHANNEL_4;
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC4EN_MSK;
}
else
- {
return RT_EINVAL;
- }
-
+
switch (cmd)
{
case PWM_CMD_ENABLE:
@@ -96,19 +93,44 @@ static rt_err_t es32f0_pwm_control(struct rt_device_pwm *device, int cmd, void *
break;
case PWM_CMD_SET:
- _ccep = timer_initstruct->perh->CCEP;
- /* count registers max 0xFFFF, auto adjust prescaler */
+
+ /*当通道没开的时候:关通道,设置输出模式和极性,初始化通道*/
+ if(!_ccep_ch_en)
+ {
+ tim_ocinit.oc_mode = ES_PWM_OC_MODE;
+ tim_ocinit.oc_polarity = ES_PWM_OC_POLARITY;
+ tim_ocinit.oc_fast_en = DISABLE;
+ tim_ocinit.ocn_polarity = TIMER_OCN_POLARITY_HIGH;
+ tim_ocinit.ocn_idle = TIMER_OCN_IDLE_RESET;
+ tim_ocinit.oc_idle = TIMER_OC_IDLE_RESET;
+ ald_timer_oc_config_channel(timer_initstruct, &tim_ocinit, pwm_channel);
+ }
+
+ bus_speed = (uint64_t)ald_cmu_get_pclk1_clock();
+
+ /*外设的计数器最大值*/
+ _maxcnt = 0xFFFF;
+
+ /*当最大分频 <= _maxcnt时:估计大概的分频,加快速度 */
+ tmp = bus_speed * (cfg->period)/1000000000/_maxcnt;
+ timer_initstruct->init.prescaler = (tmp > 2U) ? (tmp - 2U) : 0U ; /*bus_speed < 500000000*/
+
+ /* count registers max , auto adjust prescaler */
do
{
- pwm_set_freq(timer_initstruct, cfg->period);
- timer_initstruct->init.prescaler ++;
+ _arr = bus_speed * (cfg->period) / 1000000000 /(++timer_initstruct->init.prescaler);
+
}
- while (timer_initstruct->init.period > 0xFFFF);
+ while (_arr > _maxcnt);
+
+ WRITE_REG(timer_initstruct->perh->AR, (uint32_t)_arr);
+ timer_initstruct->init.period = (uint32_t)_arr;
+
/* update prescaler */
WRITE_REG(timer_initstruct->perh->PRES, --timer_initstruct->init.prescaler);
- ald_timer_oc_config_channel(timer_initstruct, &tim_ocinit, pwm_channel);
+
pwm_set_duty(timer_initstruct, pwm_channel, cfg->pulse);
- timer_initstruct->perh->CCEP = _ccep;
+
break;
case PWM_CMD_GET:
@@ -139,74 +161,124 @@ int rt_hw_pwm_init(void)
gpio_initstructure.flt = GPIO_FILTER_DISABLE;
gpio_initstructure.type = GPIO_TYPE_TTL;
-#ifdef BSP_USING_PWM0 /* 4 channels */
- static struct rt_device_pwm pwm_dev0;
- static timer_handle_t timer_initstruct0;
+#ifdef BSP_USING_AD16C4T0_PWM /* 4 channels */
+ static struct rt_device_pwm ad16c4t0_pwm_dev;
+ static timer_handle_t ad16c4t0_timer_initstruct;
- timer_initstruct0.perh = AD16C4T0;
- ald_timer_pwm_init(&timer_initstruct0);
+ ad16c4t0_timer_initstruct.perh = AD16C4T0;
+ ald_timer_pwm_init(&ad16c4t0_timer_initstruct);
/* gpio initialization */
- gpio_initstructure.func = GPIO_FUNC_2;
- ald_gpio_init(GPIOA, GPIO_PIN_8, &gpio_initstructure);
- ald_gpio_init(GPIOA, GPIO_PIN_9, &gpio_initstructure);
- ald_gpio_init(GPIOA, GPIO_PIN_10, &gpio_initstructure);
- ald_gpio_init(GPIOA, GPIO_PIN_11, &gpio_initstructure);
- ret = rt_device_pwm_register(&pwm_dev0, "pwm0", &es32f0_pwm_ops,
- &timer_initstruct0);
+#if defined(ES_AD16C4T0_CH1_GPIO_FUNC)&&defined(ES_AD16C4T0_CH1_GPIO_PORT)&&defined(ES_AD16C4T0_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T0_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH1_GPIO_PORT, ES_AD16C4T0_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T0_CH2_GPIO_FUNC)&&defined(ES_AD16C4T0_CH2_GPIO_PORT)&&defined(ES_AD16C4T0_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T0_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH2_GPIO_PORT, ES_AD16C4T0_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T0_CH3_GPIO_FUNC)&&defined(ES_AD16C4T0_CH3_GPIO_PORT)&&defined(ES_AD16C4T0_CH3_GPIO_FUNC)
+ gpio_initstructure.func = ES_AD16C4T0_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH3_GPIO_PORT, ES_AD16C4T0_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T0_CH4_GPIO_FUNC)&&defined(ES_AD16C4T0_CH4_GPIO_PORT)&&defined(ES_AD16C4T0_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T0_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH4_GPIO_PORT, ES_AD16C4T0_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ret = rt_device_pwm_register(&ad16c4t0_pwm_dev, ES_DEVICE_NAME_AD16C4T0_PWM, &es32f0_pwm_ops,
+ &ad16c4t0_timer_initstruct);
#endif
-#ifdef BSP_USING_PWM1 /* 4 channels */
- static struct rt_device_pwm pwm_dev1;
- static timer_handle_t timer_initstruct1;
+#ifdef BSP_USING_GP16C4T0_PWM /* 4 channels */
+ static struct rt_device_pwm gp16c4t0_pwm_dev;
+ static timer_handle_t gp16c4t0_timer_initstruct;
- timer_initstruct1.perh = GP16C4T0;
- ald_timer_pwm_init(&timer_initstruct1);
+ gp16c4t0_timer_initstruct.perh = GP16C4T0;
+ ald_timer_pwm_init(&gp16c4t0_timer_initstruct);
/* gpio initialization */
- gpio_initstructure.func = GPIO_FUNC_2;
- ald_gpio_init(GPIOB, GPIO_PIN_6, &gpio_initstructure);
- ald_gpio_init(GPIOB, GPIO_PIN_7, &gpio_initstructure);
- ald_gpio_init(GPIOB, GPIO_PIN_8, &gpio_initstructure);
- ald_gpio_init(GPIOB, GPIO_PIN_9, &gpio_initstructure);
+
+#if defined(ES_GP16C4T0_CH1_GPIO_FUNC)&&defined(ES_GP16C4T0_CH1_GPIO_PORT)&&defined(ES_GP16C4T0_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH1_GPIO_PORT, ES_GP16C4T0_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T0_CH2_GPIO_FUNC)&&defined(ES_GP16C4T0_CH2_GPIO_PORT)&&defined(ES_GP16C4T0_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH2_GPIO_PORT, ES_GP16C4T0_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
- ret = rt_device_pwm_register(&pwm_dev1, "pwm1", &es32f0_pwm_ops,
- &timer_initstruct1);
+#if defined(ES_GP16C4T0_CH3_GPIO_FUNC)&&defined(ES_GP16C4T0_CH3_GPIO_PORT)&&defined(ES_GP16C4T0_CH3_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH3_GPIO_PORT, ES_GP16C4T0_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T0_CH4_GPIO_FUNC)&&defined(ES_GP16C4T0_CH4_GPIO_PORT)&&defined(ES_GP16C4T0_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH4_GPIO_PORT, ES_GP16C4T0_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ret = rt_device_pwm_register(&gp16c4t0_pwm_dev, ES_DEVICE_NAME_GP16C4T0_PWM, &es32f0_pwm_ops,
+ &gp16c4t0_timer_initstruct);
#endif
-#ifdef BSP_USING_PWM2 /* 2 channels */
- static struct rt_device_pwm pwm_dev2;
- static timer_handle_t timer_initstruct2;
- timer_initstruct2.perh = GP16C2T0;
- ald_timer_pwm_init(&timer_initstruct2);
+#ifdef BSP_USING_GP16C2T0_PWM /* 2 channels */
+ static struct rt_device_pwm gp16c2t0_pwm_dev;
+ static timer_handle_t gp16c2t0_timer_initstruct;
+
+ gp16c2t0_timer_initstruct.perh = GP16C2T0;
+ ald_timer_pwm_init(&gp16c2t0_timer_initstruct);
/* gpio initialization */
- gpio_initstructure.func = GPIO_FUNC_2;
- ald_gpio_init(GPIOA, GPIO_PIN_0, &gpio_initstructure);
- ald_gpio_init(GPIOA, GPIO_PIN_1, &gpio_initstructure);
+
+#if defined(ES_GP16C2T0_CH1_GPIO_FUNC)&&defined(ES_GP16C2T0_CH1_GPIO_PORT)&&defined(ES_GP16C2T0_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C2T0_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C2T0_CH1_GPIO_PORT, ES_GP16C2T0_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C2T0_CH2_GPIO_FUNC)&&defined(ES_GP16C2T0_CH2_GPIO_PORT)&&defined(ES_GP16C2T0_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C2T0_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C2T0_CH2_GPIO_PORT, ES_GP16C2T0_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
- ret = rt_device_pwm_register(&pwm_dev2, "pwm2", &es32f0_pwm_ops,
- &timer_initstruct2);
+ ret = rt_device_pwm_register(&gp16c2t0_pwm_dev, ES_DEVICE_NAME_GP16C2T0_PWM, &es32f0_pwm_ops,
+ &gp16c2t0_timer_initstruct);
#endif
-#ifdef BSP_USING_PWM3 /* 2 channels */
- static struct rt_device_pwm pwm_dev3;
- static timer_handle_t timer_initstruct3;
- timer_initstruct3.perh = GP16C2T1;
- ald_timer_pwm_init(&timer_initstruct3);
+#ifdef BSP_USING_GP16C2T1_PWM /* 2 channels */
+ static struct rt_device_pwm gp16c2t1_pwm_dev;
+ static timer_handle_t gp16c2t1_timer_initstruct;
+
+ gp16c2t1_timer_initstruct.perh = GP16C2T1;
+ ald_timer_pwm_init(&gp16c2t1_timer_initstruct);
/* gpio initialization */
- gpio_initstructure.func = GPIO_FUNC_3;
- ald_gpio_init(GPIOC, GPIO_PIN_6, &gpio_initstructure);
- ald_gpio_init(GPIOC, GPIO_PIN_7, &gpio_initstructure);
+
+#if defined(ES_GP16C2T1_CH1_GPIO_FUNC)&&defined(ES_GP16C2T1_CH1_GPIO_PORT)&&defined(ES_GP16C2T1_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C2T1_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C2T1_CH1_GPIO_PORT, ES_GP16C2T1_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C2T1_CH2_GPIO_FUNC)&&defined(ES_GP16C2T1_CH2_GPIO_PORT)&&defined(ES_GP16C2T1_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C2T1_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C2T1_CH2_GPIO_PORT, ES_GP16C2T1_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
- ret = rt_device_pwm_register(&pwm_dev3, "pwm3", &es32f0_pwm_ops,
- &timer_initstruct3);
+ ret = rt_device_pwm_register(&gp16c2t1_pwm_dev, ES_DEVICE_NAME_GP16C2T1_PWM, &es32f0_pwm_ops,
+ &gp16c2t1_timer_initstruct);
#endif
+
+
return ret;
}
INIT_DEVICE_EXPORT(rt_hw_pwm_init);
+
+#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_pwm.h b/bsp/essemi/es32f0654/drivers/drv_pwm.h
index f4fcfe7cff..3383e7ba1c 100644
--- a/bsp/essemi/es32f0654/drivers/drv_pwm.h
+++ b/bsp/essemi/es32f0654/drivers/drv_pwm.h
@@ -3,6 +3,18 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-03-11 wangyq the first version
diff --git a/bsp/essemi/es32f0654/drivers/drv_rtc.c b/bsp/essemi/es32f0654/drivers/drv_rtc.c
index cab5b8b61b..ee7589090b 100644
--- a/bsp/essemi/es32f0654/drivers/drv_rtc.c
+++ b/bsp/essemi/es32f0654/drivers/drv_rtc.c
@@ -3,26 +3,38 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-03-22 wangyq the first version
* 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
-#include <rtdevice.h>
+#include <rtdevice.h>
#include <sys/time.h>
#include <string.h>
#include "board.h"
-#include "drv_rtc.h"
-#include <ald_cmu.h>
-#include <ald_rtc.h>
+#include "drv_rtc.h"
#ifdef RT_USING_RTC
static void __rtc_init(rtc_init_t *init)
{
+
assert_param(IS_RTC_HOUR_FORMAT(init->hour_format));
assert_param(IS_RTC_OUTPUT_SEL(init->output));
assert_param(IS_RTC_OUTPUT_POLARITY(init->output_polarity));
@@ -117,10 +129,16 @@ int rt_hw_rtc_init(void)
rt_err_t ret = RT_EOK;
static struct rt_device rtc_dev;
rtc_init_t rtc_initstruct;
+
+ /* enable clk */
+ ald_rtc_source_select(ES_RTC_CLK_SOURCE);
- /* enable external 32.768kHz */
- CMU_LOSC_ENABLE();
- ald_cmu_losc_safe_config(ENABLE);
+ if(ES_RTC_CLK_SOURCE == ES_C_RTC_SOURCE_LOSC)
+ {
+ CMU_LOSC_ENABLE();
+ ald_cmu_losc_safe_config(ENABLE);
+ }
+
/* set default time */
RTC_UNLOCK();
WRITE_REG(RTC->TIME, 0x134251);
@@ -131,6 +149,8 @@ int rt_hw_rtc_init(void)
rtc_initstruct.asynch_pre_div = 0;
rtc_initstruct.synch_pre_div = 32767;
rtc_initstruct.output = RTC_OUTPUT_DISABLE;
+ rtc_initstruct.output_polarity = RTC_OUTPUT_POLARITY_HIGH;
+
__rtc_init(&rtc_initstruct);
rtc_dev.type = RT_Device_Class_RTC;
@@ -150,7 +170,7 @@ int rt_hw_rtc_init(void)
rtc_dev.user_data = RTC;
- ret = rt_device_register(&rtc_dev, "rtc", RT_DEVICE_FLAG_RDWR);
+ ret = rt_device_register(&rtc_dev, ES_DEVICE_NAME_RTC, RT_DEVICE_FLAG_RDWR);
return ret;
}
diff --git a/bsp/essemi/es32f0654/drivers/drv_rtc.h b/bsp/essemi/es32f0654/drivers/drv_rtc.h
index fe0264fb51..76e5b24d85 100644
--- a/bsp/essemi/es32f0654/drivers/drv_rtc.h
+++ b/bsp/essemi/es32f0654/drivers/drv_rtc.h
@@ -3,14 +3,28 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-03-22 wangyq the first version
+ * 2019-03-22 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_RTC_H__
#define DRV_RTC_H__
+#include "es_conf_info_rtc.h"
int rt_hw_rtc_init(void);
#endif
diff --git a/bsp/essemi/es32f0654/drivers/drv_spi.c b/bsp/essemi/es32f0654/drivers/drv_spi.c
index dd37691125..6ea5c1a705 100644
--- a/bsp/essemi/es32f0654/drivers/drv_spi.c
+++ b/bsp/essemi/es32f0654/drivers/drv_spi.c
@@ -3,11 +3,23 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-01-24 wangyq the first version
* 2019-11-01 wangyq update libraries
- * 2020-12-15 liuhy update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rtthread.h>
@@ -16,9 +28,7 @@
#include <rthw.h>
#include "board.h"
#include "drv_spi.h"
-#include <ald_spi.h>
-#include <ald_gpio.h>
-#include <ald_cmu.h>
+
#ifdef RT_USING_SPI
@@ -30,6 +40,9 @@ rt_err_t spi_configure(struct rt_spi_device *device,
spi_handle_t *hspi;
hspi = (spi_handle_t *)device->bus->parent.user_data;
+ hspi->init.ss_en = DISABLE;
+ hspi->init.crc_calc = DISABLE;
+
/* config spi mode */
if (cfg->mode & RT_SPI_SLAVE)
{
@@ -64,6 +77,16 @@ rt_err_t spi_configure(struct rt_spi_device *device,
{
hspi->init.phase = SPI_CPHA_FIRST;
}
+
+ if (cfg->mode & RT_SPI_MSB)
+ {
+ hspi->init.first_bit = SPI_FIRSTBIT_MSB;
+ }
+ else
+ {
+ hspi->init.first_bit = SPI_FIRSTBIT_LSB;
+ }
+
if (cfg->mode & RT_SPI_CPOL)
{
hspi->init.polarity = SPI_CPOL_HIGH;
@@ -72,6 +95,7 @@ rt_err_t spi_configure(struct rt_spi_device *device,
{
hspi->init.polarity = SPI_CPOL_LOW;
}
+
if (cfg->mode & RT_SPI_NO_CS)
{
hspi->init.ss_en = DISABLE;
@@ -150,74 +174,54 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
hspi = (spi_handle_t *)device->bus->parent.user_data;
cs = device->parent.user_data;
+
+ if (message->cs_take)
+ {
+ rt_pin_write(cs->pin, ES_SPI_CS_LEVEL);
+ }
if(message->send_buf != RT_NULL || message->recv_buf != RT_NULL)
{
/* send & receive */
if ((message->send_buf != RT_NULL) && (message->recv_buf != RT_NULL))
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
res = ald_spi_send_recv(hspi, (rt_uint8_t *)message->send_buf, (rt_uint8_t *)message->recv_buf,
(rt_int32_t)message->length, SPITIMEOUT);
- if (message->cs_release)
- {
- rt_pin_write(cs->pin, 1);
- }
- if (res != RT_EOK)
- return RT_ERROR;
}
else
{
/* only send data */
if (message->recv_buf == RT_NULL)
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
res = ald_spi_send(hspi, (rt_uint8_t *)message->send_buf, (rt_int32_t)message->length, SPITIMEOUT);
- if (message->cs_release)
- {
- rt_pin_write(cs->pin, 1);
- }
- if (res != RT_EOK)
- return RT_ERROR;
}
/* only receive data */
if (message->send_buf == RT_NULL)
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
res = ald_spi_recv(hspi, (rt_uint8_t *)message->recv_buf, (rt_int32_t)message->length, SPITIMEOUT);
- if (message->cs_release)
- {
- rt_pin_write(cs->pin, 1);
- }
- if (res != RT_EOK)
- return RT_ERROR;
}
}
-
+
+ if (message->cs_release)
+ {
+ rt_pin_write(cs->pin, !ES_SPI_CS_LEVEL);
+ }
+
+ if (res != RT_EOK)
+ return RT_ERROR;
+ else
+ return message->length;
+
}
else
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
-
+
if (message->cs_release)
{
- rt_pin_write(cs->pin, 1);
+ rt_pin_write(cs->pin, !ES_SPI_CS_LEVEL);
}
return RT_EOK;
}
- return message->length;
}
@@ -230,6 +234,7 @@ const struct rt_spi_ops es32f0_spi_ops =
rt_err_t es32f0_spi_device_attach(rt_uint32_t pin, const char *bus_name, const char *device_name)
{
+ int result;
/* define spi Instance */
struct rt_spi_device *spi_device = (struct rt_spi_device *)rt_malloc(sizeof(struct rt_spi_device));
RT_ASSERT(spi_device != RT_NULL);
@@ -238,7 +243,17 @@ rt_err_t es32f0_spi_device_attach(rt_uint32_t pin, const char *bus_name, const c
cs_pin->pin = pin;
rt_pin_mode(pin, PIN_MODE_OUTPUT);
rt_pin_write(pin, 1);
- return rt_spi_bus_attach_device(spi_device, device_name, bus_name, (void *)cs_pin);
+
+ result = rt_spi_bus_attach_device(spi_device, device_name, bus_name, (void *)cs_pin);
+
+#ifdef BSP_USING_SPI0
+ if(!(strcmp(bus_name,ES_DEVICE_NAME_SPI0_BUS)))SPI_BUS_CONFIG(spi_device->config,0);
+#endif
+#ifdef BSP_USING_SPI1
+ if(!(strcmp(bus_name,ES_DEVICE_NAME_SPI1_BUS)))SPI_BUS_CONFIG(spi_device->config,1);
+#endif
+
+ return result;
}
#ifdef BSP_USING_SPI0
@@ -259,77 +274,84 @@ int rt_hw_spi_init(void)
spi_handle_t *spi;
gpio_init_t gpio_instruct;
+ gpio_instruct.odos = GPIO_PUSH_PULL;
+ gpio_instruct.type = GPIO_TYPE_CMOS;
+ gpio_instruct.flt = GPIO_FILTER_DISABLE;
+ gpio_instruct.odrv = GPIO_OUT_DRIVE_NORMAL;
#ifdef BSP_USING_SPI0
_spi0.perh = SPI0;
spi_bus = &_spi_bus0;
spi = &_spi0;
- rt_device_t spi_bus_dev0;
/* SPI0 gpio init */
- gpio_instruct.mode = GPIO_MODE_OUTPUT;
- gpio_instruct.odos = GPIO_PUSH_PULL;
- gpio_instruct.func = GPIO_FUNC_4;
- gpio_instruct.type = GPIO_TYPE_CMOS;
- gpio_instruct.flt = GPIO_FILTER_DISABLE;
+ gpio_instruct.mode = GPIO_MODE_OUTPUT;
- /* PB3->SPI0_SCK, PB5->SPI0_MOSI */
- ald_gpio_init(GPIOB, GPIO_PIN_3 | GPIO_PIN_5, &gpio_instruct);
+#if defined(ES_SPI0_SCK_GPIO_FUNC)&&defined(ES_SPI0_SCK_GPIO_PORT)&&defined(ES_SPI0_SCK_GPIO_PIN)
+ gpio_instruct.func = ES_SPI0_SCK_GPIO_FUNC;
+ ald_gpio_init(ES_SPI0_SCK_GPIO_PORT, ES_SPI0_SCK_GPIO_PIN, &gpio_instruct);
+#endif
- /* PB4->SPI0_MISO */
- gpio_instruct.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_4, &gpio_instruct);
+#if defined(ES_SPI0_MOSI_GPIO_FUNC)&&defined(ES_SPI0_MOSI_GPIO_PORT)&&defined(ES_SPI0_MOSI_GPIO_PIN)
+ gpio_instruct.func = ES_SPI0_MOSI_GPIO_FUNC;
+ ald_gpio_init(ES_SPI0_MOSI_GPIO_PORT, ES_SPI0_MOSI_GPIO_PIN, &gpio_instruct);
+#endif
+
+ gpio_instruct.mode = GPIO_MODE_INPUT;
+
+#if defined(ES_SPI0_MISO_GPIO_FUNC)&&defined(ES_SPI0_MISO_GPIO_PORT)&&defined(ES_SPI0_MISO_GPIO_PIN)
+ gpio_instruct.func = ES_SPI0_MISO_GPIO_FUNC;
+ ald_gpio_init(ES_SPI0_MISO_GPIO_PORT, ES_SPI0_MISO_GPIO_PIN, &gpio_instruct);
+#endif
spi_bus->parent.user_data = spi;
- result = rt_spi_bus_register(spi_bus, "spi0", &es32f0_spi_ops);
+ result = rt_spi_bus_register(spi_bus, ES_DEVICE_NAME_SPI0_BUS, &es32f0_spi_ops);
if (result != RT_EOK)
{
return result;
}
- rt_device_register(spi_bus_dev0, "spi00", RT_DEVICE_FLAG_RDWR);
-
- /* SPI0_NSS = PA15 = PIN 50 */
- result = es32f0_spi_device_attach(50, "spi0", "spi00");
+ result = es32f0_spi_device_attach(ES_SPI0_NSS_PIN, ES_DEVICE_NAME_SPI0_BUS, ES_DEVICE_NAME_SPI0_DEV0);
if (result != RT_EOK)
{
return result;
}
-
+
#endif
#ifdef BSP_USING_SPI1
_spi1.perh = SPI1;
spi_bus = &_spi_bus1;
spi = &_spi1;
- rt_device_t spi_bus_dev0;
/* SPI1 gpio init */
- gpio_instruct.mode = GPIO_MODE_OUTPUT;
- gpio_instruct.odos = GPIO_PUSH_PULL;
- gpio_instruct.func = GPIO_FUNC_4;
- gpio_instruct.type = GPIO_TYPE_CMOS;
- gpio_instruct.flt = GPIO_FILTER_DISABLE;
-
- /* PB13->SPI1_SCK, PB15->SPI1_MOSI */
- ald_gpio_init(GPIOB, GPIO_PIN_13 | GPIO_PIN_15, &gpio_instruct);
-
- /* PB14->SPI1_MISO */
- gpio_instruct.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_14, &gpio_instruct);
+ gpio_instruct.mode = GPIO_MODE_OUTPUT;
+
+#if defined(ES_SPI1_SCK_GPIO_FUNC)&&defined(ES_SPI1_SCK_GPIO_PORT)&&defined(ES_SPI1_SCK_GPIO_PIN)
+ gpio_instruct.func = ES_SPI1_SCK_GPIO_FUNC;
+ ald_gpio_init(ES_SPI1_SCK_GPIO_PORT, ES_SPI1_SCK_GPIO_PIN, &gpio_instruct);
+#endif
+
+#if defined(ES_SPI1_MOSI_GPIO_FUNC)&&defined(ES_SPI1_MOSI_GPIO_PORT)&&defined(ES_SPI1_MOSI_GPIO_PIN)
+ gpio_instruct.func = ES_SPI1_MOSI_GPIO_FUNC;
+ ald_gpio_init(ES_SPI1_MOSI_GPIO_PORT, ES_SPI1_MOSI_GPIO_PIN, &gpio_instruct);
+#endif
+
+ gpio_instruct.mode = GPIO_MODE_INPUT;
+
+#if defined(ES_SPI1_MISO_GPIO_FUNC)&&defined(ES_SPI1_MISO_GPIO_PORT)&&defined(ES_SPI1_MISO_GPIO_PIN)
+ gpio_instruct.func = ES_SPI1_MISO_GPIO_FUNC;
+ ald_gpio_init(ES_SPI1_MISO_GPIO_PORT, ES_SPI1_MISO_GPIO_PIN, &gpio_instruct);
+#endif
spi_bus->parent.user_data = spi;
- result = rt_spi_bus_register(spi_bus, "spi1", &es32f0_spi_ops);
+ result = rt_spi_bus_register(spi_bus, ES_DEVICE_NAME_SPI1_BUS, &es32f0_spi_ops);
if (result != RT_EOK)
{
return result;
}
- rt_device_register(spi_bus_dev0, "spi10", RT_DEVICE_FLAG_RDWR);
-
- /* SPI1_NSS = PC00 = PIN 8 */
- result = es32f0_spi_device_attach(8, "spi1", "spi10");
-
+ result = es32f0_spi_device_attach((ES_SPI1_NSS_PIN, ES_DEVICE_NAME_SPI1_BUS, ES_DEVICE_NAME_SPI1_DEV0);
if (result != RT_EOK)
{
return result;
diff --git a/bsp/essemi/es32f0654/drivers/drv_spi.h b/bsp/essemi/es32f0654/drivers/drv_spi.h
index 991ff35c7a..df7932d570 100644
--- a/bsp/essemi/es32f0654/drivers/drv_spi.h
+++ b/bsp/essemi/es32f0654/drivers/drv_spi.h
@@ -3,9 +3,22 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-01-24 wangyq the first version
+ * 2019-01-24 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_SPI_H__
@@ -14,6 +27,8 @@
#include <rtthread.h>
#include <rthw.h>
#include <rtdevice.h>
+
+#include "es_conf_info_spi.h"
struct es32f0_hw_spi_cs
{
diff --git a/bsp/essemi/es32f0654/drivers/drv_spiflash.c b/bsp/essemi/es32f0654/drivers/drv_spiflash.c
index c84fe1be78..d8176257d1 100644
--- a/bsp/essemi/es32f0654/drivers/drv_spiflash.c
+++ b/bsp/essemi/es32f0654/drivers/drv_spiflash.c
@@ -9,18 +9,20 @@
* 2019-11-01 wangyq update libraries
*/
+#include "board.h"
#include <rtthread.h>
+
+#if defined(BSP_USING_SPI_FLASH)
+
#include "spi_flash.h"
#include "drv_spiflash.h"
#include "spi_flash_sfud.h"
#include "drv_spi.h"
-#if defined(BSP_USING_SPI_FLASH)
int rt_hw_spi_flash_init(void)
{
- es32f0_spi_device_attach(50, "spi0", "spi00");
-
- if (RT_NULL == rt_sfud_flash_probe("W25Q64", "spi00"))
+
+ if (RT_NULL == rt_sfud_flash_probe(ES_DEVICE_NAME_SPI_FALSH_DEV, ES_DEVICE_NAME_SPI_DEV))
{
return -RT_ERROR;
};
diff --git a/bsp/essemi/es32f0654/drivers/drv_uart.c b/bsp/essemi/es32f0654/drivers/drv_uart.c
index 4ebd18f826..45f42eed78 100644
--- a/bsp/essemi/es32f0654/drivers/drv_uart.c
+++ b/bsp/essemi/es32f0654/drivers/drv_uart.c
@@ -3,19 +3,30 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-01-23 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include "board.h"
-#include "drv_uart.h"
-#include <ald_gpio.h>
-#include <ald_uart.h>
+#include "es_conf_info_uart.h"
#ifdef RT_USING_SERIAL
@@ -24,151 +35,13 @@ struct es32_uart
{
uart_handle_t huart;
IRQn_Type irq;
-};
-
-static rt_err_t es32f0x_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
-{
- gpio_init_t gpio_initstructure;
- struct es32_uart *uart;
- RT_ASSERT(serial != RT_NULL);
- RT_ASSERT(cfg != RT_NULL);
- uart = (struct es32_uart *)serial->parent.user_data;
-
- /* Initialize tx pin */
- gpio_initstructure.mode = GPIO_MODE_OUTPUT;
- gpio_initstructure.odos = GPIO_PUSH_PULL;
- gpio_initstructure.pupd = GPIO_PUSH_UP;
- gpio_initstructure.odrv = GPIO_OUT_DRIVE_NORMAL;
- gpio_initstructure.flt = GPIO_FILTER_DISABLE;
- gpio_initstructure.type = GPIO_TYPE_TTL;
-
-#ifdef BSP_USING_UART0
- gpio_initstructure.func = GPIO_FUNC_3;
- ald_gpio_init(GPIOB, GPIO_PIN_10, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_11, &gpio_initstructure);
-#endif /* uart0 gpio init */
-
-#ifdef BSP_USING_UART1
- gpio_initstructure.func = GPIO_FUNC_3;
- ald_gpio_init(GPIOC, GPIO_PIN_10, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOC, GPIO_PIN_11, &gpio_initstructure);
-#endif /* uart1 gpio init */
-
-#ifdef BSP_USING_UART2
- gpio_initstructure.func = GPIO_FUNC_5;
- ald_gpio_init(GPIOC, GPIO_PIN_12, &gpio_initstructure);
+};
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOD, GPIO_PIN_2, &gpio_initstructure);
-#endif /* uart2 gpio init */
-
-#ifdef BSP_USING_UART3
- gpio_initstructure.func = GPIO_FUNC_4;
- ald_gpio_init(GPIOC, GPIO_PIN_4, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOC, GPIO_PIN_5, &gpio_initstructure);
-#endif /* uart3 gpio init */
-
- uart->huart.init.mode = UART_MODE_UART;
- uart->huart.init.baud = cfg->baud_rate;
- uart->huart.init.word_length = (uart_word_length_t)(cfg->data_bits - 5);
- uart->huart.init.parity = (uart_parity_t)(cfg->parity == PARITY_EVEN ? UART_PARITY_EVEN : cfg->parity);
- uart->huart.init.fctl = UART_HW_FLOW_CTL_DISABLE;
- ald_uart_init(&uart->huart);
-
- if (cfg->bit_order == BIT_ORDER_MSB)
- {
- UART_MSB_FIRST_ENABLE(&uart->huart);
- }
- else
- {
- UART_MSB_FIRST_DISABLE(&uart->huart);
- }
-
- if (cfg->invert == NRZ_INVERTED)
- {
- UART_DATA_INV_ENABLE(&uart->huart);
- }
- else
- {
- UART_DATA_INV_DISABLE(&uart->huart);
- }
-
- /* enable rx int */
- ald_uart_interrupt_config(&uart->huart, UART_IT_RXRD, ENABLE);
-
- return RT_EOK;
-}
-
-static rt_err_t es32f0x_control(struct rt_serial_device *serial, int cmd, void *arg)
+/* es32 usart driver */
+struct es32_usart
{
- struct es32_uart *uart;
- RT_ASSERT(serial != RT_NULL);
-
- uart = (struct es32_uart *)serial->parent.user_data;
- switch (cmd)
- {
- case RT_DEVICE_CTRL_CLR_INT:
- /* disable rx irq */
- NVIC_DisableIRQ(uart->irq);
- /* disable interrupt */
- ald_uart_interrupt_config(&uart->huart, UART_IT_RXRD, DISABLE);
- break;
-
- case RT_DEVICE_CTRL_SET_INT:
- /* enable rx irq */
- NVIC_EnableIRQ(uart->irq);
- /* enable interrupt */
- ald_uart_interrupt_config(&uart->huart, UART_IT_RXRD, ENABLE);
- break;
- }
-
- return RT_EOK;
-}
-
-static int es32f0x_putc(struct rt_serial_device *serial, char c)
-{
- struct es32_uart *uart;
- RT_ASSERT(serial != RT_NULL);
- uart = (struct es32_uart *)serial->parent.user_data;
-
- while (!(uart->huart.perh->SR & 0x40)) ;
- WRITE_REG(uart->huart.perh->TBR, c);
-
- return 1;
-}
-
-static int es32f0x_getc(struct rt_serial_device *serial)
-{
- int ch = -1;
- struct es32_uart *uart;
-
- RT_ASSERT(serial != RT_NULL);
- uart = (struct es32_uart *)serial->parent.user_data;
-
- if (uart->huart.perh->SR & 0x01)
- {
- ch = (uint8_t)(uart->huart.perh->RBR & 0xFF);
- }
-
- return ch;
-}
-
-static const struct rt_uart_ops es32f0x_uart_ops =
-{
- es32f0x_configure,
- es32f0x_control,
- es32f0x_putc,
- es32f0x_getc,
+ usart_handle_t huart;
+ IRQn_Type irq;
};
#ifdef BSP_USING_UART0
@@ -266,19 +139,380 @@ void BS16T2_UART3_Handler(void)
rt_interrupt_leave();
}
#endif /* BSP_USING_UART3 */
+
+#ifdef BSP_USING_USART0
+/* USART0 device driver structure */
+struct es32_usart usart0 =
+{
+ {USART0},
+ USART0_IRQn
+};
+
+struct rt_serial_device serial4;
+
+void USART0_Handler(void)
+{
+ /* enter interrupt */
+ rt_interrupt_enter();
+
+ if (USART0->STAT & USART_FLAG_RXNE)
+ {
+ rt_hw_serial_isr(&serial4, RT_SERIAL_EVENT_RX_IND);
+ }
+ /* leave interrupt */
+ rt_interrupt_leave();
+}
+#endif /* BSP_USING_USART0 */
+
+#ifdef BSP_USING_USART1
+/* USART1 device driver structure */
+struct es32_usart usart1 =
+{
+ {USART1},
+ USART1_IRQn
+};
+
+struct rt_serial_device serial5;
+
+void USART1_Handler(void)
+{
+ /* enter interrupt */
+ rt_interrupt_enter();
+
+ if (USART1->STAT & USART_FLAG_RXNE)
+ {
+ rt_hw_serial_isr(&serial5, RT_SERIAL_EVENT_RX_IND);
+ }
+ /* leave interrupt */
+ rt_interrupt_leave();
+}
+#endif /* BSP_USING_USART1 */
+
+static rt_err_t es32f0x_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
+{
+ gpio_init_t gpio_initstructure;
+ struct es32_uart *uart;
+ RT_ASSERT(serial != RT_NULL);
+ RT_ASSERT(cfg != RT_NULL);
+ uart = (struct es32_uart *)serial->parent.user_data;
+
+ /* Initialize tx pin */
+ gpio_initstructure.mode = GPIO_MODE_OUTPUT;
+ gpio_initstructure.odos = GPIO_PUSH_PULL;
+ gpio_initstructure.pupd = GPIO_PUSH_UP;
+ gpio_initstructure.odrv = GPIO_OUT_DRIVE_NORMAL;
+ gpio_initstructure.flt = GPIO_FILTER_DISABLE;
+ gpio_initstructure.type = GPIO_TYPE_TTL;
+
+ if((uint32_t)(uart->huart.perh) > (uint32_t)UART3) /*根据外设物理地址区分UART和USART*/
+ {
+ /*USART*/
+ struct es32_usart *usart= (struct es32_usart *)serial->parent.user_data;
+
+#ifdef BSP_USING_USART0
+ if(usart == (&usart0))
+ {
+#if defined(ES_USART0_TX_GPIO_FUNC)&&defined(ES_USART0_TX_GPIO_PORT)&&defined(ES_USART0_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_USART0_TX_GPIO_FUNC;
+ ald_gpio_init(ES_USART0_TX_GPIO_PORT, ES_USART0_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_USART0_RX_GPIO_FUNC)&&defined(ES_USART0_RX_GPIO_PORT)&&defined(ES_USART0_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_USART0_RX_GPIO_FUNC;
+ ald_gpio_init(ES_USART0_RX_GPIO_PORT, ES_USART0_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+ ald_cmu_perh_clock_config(CMU_PERH_USART0, ENABLE);
+ }
+
+#endif /* usart0 gpio init */
+
+#ifdef BSP_USING_USART1
+ if(usart == (&usart1))
+ {
+#if defined(ES_USART1_TX_GPIO_FUNC)&&defined(ES_USART1_TX_GPIO_PORT)&&defined(ES_USART1_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_USART1_TX_GPIO_FUNC;
+ ald_gpio_init(ES_USART1_TX_GPIO_PORT, ES_USART1_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_USART1_RX_GPIO_FUNC)&&defined(ES_USART1_RX_GPIO_PORT)&&defined(ES_USART1_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_USART1_RX_GPIO_FUNC;
+ ald_gpio_init(ES_USART1_RX_GPIO_PORT, ES_USART1_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_USART1, ENABLE);
+ }
+#endif /* usart1 gpio init */
+
+ usart->huart.init.mode = USART_MODE_TX_RX;
+ usart->huart.init.baud = cfg->baud_rate;
+ usart->huart.init.word_length = (usart_word_length_t)(cfg->data_bits - 8);
+ usart->huart.init.stop_bits = ((cfg->stop_bits == STOP_BITS_1) ? USART_STOP_BITS_1 : USART_STOP_BITS_2);
+ usart->huart.init.parity = (usart_parity_t)(cfg->parity == PARITY_NONE ? cfg->parity : (4 - cfg->parity) );
+ usart->huart.init.fctl = USART_HW_FLOW_CTL_NONE;
+
+ ald_usart_init(&usart->huart);
+
+ /*
+ BIT_ORDER_LSB BIT_ORDER_MSB
+ NRZ_NORMAL NRZ_INVERTED
+ 无相关寄存器*/
+
+ /* enable rx int */
+ ald_usart_interrupt_config(&usart->huart, USART_IT_RXNE, ENABLE);
+
+ }
+ else
+ {
+ /*UART*/
+
+#ifdef BSP_USING_UART0
+ if(uart == (&uart0))
+ {
+#if defined(ES_UART0_TX_GPIO_FUNC)&&defined(ES_UART0_TX_GPIO_PORT)&&defined(ES_UART0_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART0_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART0_TX_GPIO_PORT, ES_UART0_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART0_RX_GPIO_FUNC)&&defined(ES_UART0_RX_GPIO_PORT)&&defined(ES_UART0_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART0_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART0_RX_GPIO_PORT, ES_UART0_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+ ald_cmu_perh_clock_config(CMU_PERH_UART0, ENABLE);
+ }
+
+#endif /* uart0 gpio init */
+
+#ifdef BSP_USING_UART1
+ if(uart == (&uart1))
+ {
+#if defined(ES_UART1_TX_GPIO_FUNC)&&defined(ES_UART1_TX_GPIO_PORT)&&defined(ES_UART1_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART1_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART1_TX_GPIO_PORT, ES_UART1_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART1_RX_GPIO_FUNC)&&defined(ES_UART1_RX_GPIO_PORT)&&defined(ES_UART1_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART1_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART1_RX_GPIO_PORT, ES_UART1_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART1, ENABLE);
+ }
+#endif /* uart1 gpio init */
+
+#ifdef BSP_USING_UART2
+ if(uart == (&uart2))
+ {
+#if defined(ES_UART2_TX_GPIO_FUNC)&&defined(ES_UART2_TX_GPIO_PORT)&&defined(ES_UART2_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART2_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART2_TX_GPIO_PORT, ES_UART2_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART2_RX_GPIO_FUNC)&&defined(ES_UART2_RX_GPIO_PORT)&&defined(ES_UART2_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART2_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART2_RX_GPIO_PORT, ES_UART2_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART2, ENABLE);
+ }
+#endif /* uart2 gpio init */
+
+#ifdef BSP_USING_UART3
+ if(uart == (&uart3))
+ {
+#if defined(ES_UART3_TX_GPIO_FUNC)&&defined(ES_UART3_TX_GPIO_PORT)&&defined(ES_UART3_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART3_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART3_TX_GPIO_PORT, ES_UART3_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART3_RX_GPIO_FUNC)&&defined(ES_UART3_RX_GPIO_PORT)&&defined(ES_UART3_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART3_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART3_RX_GPIO_PORT, ES_UART3_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART3, ENABLE);
+ }
+#endif /* uart3 gpio init */
+
+ uart->huart.init.mode = UART_MODE_UART;
+ uart->huart.init.baud = cfg->baud_rate;
+ uart->huart.init.word_length = (uart_word_length_t)(cfg->data_bits - 5);
+ uart->huart.init.stop_bits = (uart_stop_bits_t)cfg->stop_bits;
+ uart->huart.init.parity = (uart_parity_t)(cfg->parity == PARITY_EVEN ? UART_PARITY_EVEN : cfg->parity);
+ uart->huart.init.fctl = UART_HW_FLOW_CTL_DISABLE;
+
+ ald_uart_init(&uart->huart);
+
+ if (cfg->bit_order == BIT_ORDER_MSB)
+ {
+ UART_MSB_FIRST_ENABLE(&uart->huart);
+ }
+ else
+ {
+ UART_MSB_FIRST_DISABLE(&uart->huart);
+ }
+
+ if (cfg->invert == NRZ_INVERTED)
+ {
+ UART_DATA_INV_ENABLE(&uart->huart);
+ }
+ else
+ {
+ UART_DATA_INV_DISABLE(&uart->huart);
+ }
+
+ /* enable rx int */
+ ald_uart_interrupt_config(&uart->huart, UART_IT_RXRD, ENABLE);
+
+ }
+
+
+ return RT_EOK;
+}
+
+static rt_err_t es32f0x_control(struct rt_serial_device *serial, int cmd, void *arg)
+{
+ struct es32_uart *uart;
+ RT_ASSERT(serial != RT_NULL);
+
+ uart = (struct es32_uart *)serial->parent.user_data;
+
+ if((uint32_t)(uart->huart.perh) > (uint32_t)UART3) /*根据外设物理地址区分UART和USART*/
+ {
+ /*USART*/
+ struct es32_usart *usart= (struct es32_usart *)serial->parent.user_data;
+
+ switch (cmd)
+ {
+ case RT_DEVICE_CTRL_CLR_INT:
+ /* disable rx irq */
+ NVIC_DisableIRQ(usart->irq);
+ /* disable interrupt */
+ ald_usart_interrupt_config(&usart->huart, USART_IT_RXNE, DISABLE);
+ break;
+
+ case RT_DEVICE_CTRL_SET_INT:
+ /* enable rx irq */
+ NVIC_EnableIRQ(usart->irq);
+ /* enable interrupt */
+ ald_usart_interrupt_config(&usart->huart, USART_IT_RXNE, ENABLE);
+ break;
+ }
+
+ }
+ else
+ {
+ /*UART*/
+
+ switch (cmd)
+ {
+ case RT_DEVICE_CTRL_CLR_INT:
+ /* disable rx irq */
+ NVIC_DisableIRQ(uart->irq);
+ /* disable interrupt */
+ ald_uart_interrupt_config(&uart->huart, UART_IT_RXRD, DISABLE);
+ break;
+
+ case RT_DEVICE_CTRL_SET_INT:
+ /* enable rx irq */
+ NVIC_EnableIRQ(uart->irq);
+ /* enable interrupt */
+ ald_uart_interrupt_config(&uart->huart, UART_IT_RXRD, ENABLE);
+ break;
+ }
+ }
+
+
+ return RT_EOK;
+}
+
+static int es32f0x_putc(struct rt_serial_device *serial, char c)
+{
+ struct es32_uart *uart;
+ RT_ASSERT(serial != RT_NULL);
+ uart = (struct es32_uart *)serial->parent.user_data;
+
+ if((uint32_t)(uart->huart.perh) > (uint32_t)UART3) /*根据外设物理地址区分UART和USART*/
+ {
+ /*USART*/
+ struct es32_usart *usart= (struct es32_usart *)serial->parent.user_data;
+ while (!(usart->huart.perh->STAT & USART_STAT_TXEMPIF_MSK)) ;
+ WRITE_REG(usart->huart.perh->DATA, c);
+ }
+ else
+ {
+ /*UART*/
+ while (!(uart->huart.perh->SR & 0x40)) ;
+ WRITE_REG(uart->huart.perh->TBR, c);
+ }
+
+ return 1;
+}
+
+static int es32f0x_getc(struct rt_serial_device *serial)
+{
+ int ch = -1;
+ struct es32_uart *uart;
+
+ RT_ASSERT(serial != RT_NULL);
+ uart = (struct es32_uart *)serial->parent.user_data;
+
+ if((uint32_t)(uart->huart.perh) > (uint32_t)UART3) /*根据外设物理地址区分UART和USART*/
+ {
+ /*USART*/
+ struct es32_usart *usart= (struct es32_usart *)serial->parent.user_data;
+ if (usart->huart.perh->STAT & USART_STAT_RXNEIF_MSK)
+ {
+ ch = (uint8_t)(usart->huart.perh->DATA & 0xFF);
+ }
+ }
+ else
+ {
+ /*UART*/
+ if (uart->huart.perh->SR & 0x01)
+ {
+ ch = (uint8_t)(uart->huart.perh->RBR & 0xFF);
+ }
+ }
+
+ return ch;
+}
+
+static const struct rt_uart_ops es32f0x_uart_ops =
+{
+ es32f0x_configure,
+ es32f0x_control,
+ es32f0x_putc,
+ es32f0x_getc,
+};
int rt_hw_uart_init(void)
{
+#if (defined(BSP_USING_UART0)||defined(BSP_USING_UART1)||defined(BSP_USING_UART2)||defined(BSP_USING_UART3))
struct es32_uart *uart;
- struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
+#endif
+#if (defined(BSP_USING_USART0)||defined(BSP_USING_USART1))
+ struct es32_usart *usart;
+#endif
#ifdef BSP_USING_UART0
uart = &uart0;
serial0.ops = &es32f0x_uart_ops;
- serial0.config = config;
+ serial0.config = (struct serial_configure)ES_UART0_CONFIG;
/* register UART0 device */
- rt_hw_serial_register(&serial0, "uart0",
+ rt_hw_serial_register(&serial0, ES_DEVICE_NAME_UART0,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART0 */
@@ -286,10 +520,10 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART1
uart = &uart1;
serial1.ops = &es32f0x_uart_ops;
- serial1.config = config;
+ serial1.config = (struct serial_configure)ES_UART1_CONFIG;
/* register UART1 device */
- rt_hw_serial_register(&serial1, "uart1",
+ rt_hw_serial_register(&serial1, ES_DEVICE_NAME_UART1,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART1 */
@@ -297,10 +531,10 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART2
uart = &uart2;
serial2.ops = &es32f0x_uart_ops;
- serial2.config = config;
+ serial2.config = (struct serial_configure)ES_UART2_CONFIG;
/* register UART2 device */
- rt_hw_serial_register(&serial2, "uart2",
+ rt_hw_serial_register(&serial2, ES_DEVICE_NAME_UART2,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART2 */
@@ -308,14 +542,35 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART3
uart = &uart3;
serial3.ops = &es32f0x_uart_ops;
- serial3.config = config;
+ serial3.config = (struct serial_configure)ES_UART3_CONFIG;
/* register UART3 device */
- rt_hw_serial_register(&serial3, "uart3",
+ rt_hw_serial_register(&serial3, ES_DEVICE_NAME_UART3,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART3 */
+
+#ifdef BSP_USING_USART0
+ usart = &usart0;
+ serial4.ops = &es32f0x_uart_ops;
+ serial4.config = (struct serial_configure)ES_USART0_CONFIG;
+ /* register USART0 device */
+ rt_hw_serial_register(&serial4, ES_DEVICE_NAME_USART0,
+ RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
+ usart);
+#endif /* BSP_USING_USART0 */
+
+#ifdef BSP_USING_USART1
+ usart = &usart1;
+ serial5.ops = &es32f0x_uart_ops;
+ serial5.config = (struct serial_configure)ES_USART1_CONFIG;
+
+ /* register USART1 device */
+ rt_hw_serial_register(&serial5, ES_DEVICE_NAME_USART1,
+ RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
+ usart);
+#endif /* BSP_USING_USART1 */
return 0;
}
INIT_BOARD_EXPORT(rt_hw_uart_init);
diff --git a/bsp/essemi/es32f0654/drivers/drv_uart.h b/bsp/essemi/es32f0654/drivers/drv_uart.h
index e68d67ca1e..a7eb0de41d 100644
--- a/bsp/essemi/es32f0654/drivers/drv_uart.h
+++ b/bsp/essemi/es32f0654/drivers/drv_uart.h
@@ -3,6 +3,18 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-01-23 wangyq the first version
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_acmp.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_acmp.h
index 2bbe7437d0..535d7c2770 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_acmp.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_acmp.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_adc.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_adc.h
index b5f9532f8d..efad62ab26 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_adc.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_adc.h
@@ -9,6 +9,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
******************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_bkpc.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_bkpc.h
index cbaa1c88f8..038ddf635b 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_bkpc.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_bkpc.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_calc.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_calc.h
index 283417d843..870c5b536d 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_calc.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_calc.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_can.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_can.h
index 196094eaaa..04a5d5ef5e 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_can.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_can.h
@@ -10,6 +10,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
******************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_cmu.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_cmu.h
index 648b3c2b50..314c585a8a 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_cmu.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_cmu.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_conf.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_conf.h
index 2a91282ab6..673782173a 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_conf.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_conf.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crc.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crc.h
index 3ea24ea927..d40e22fcf9 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crc.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crc.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crypt.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crypt.h
index 483c15a31e..00be4131f3 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crypt.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_crypt.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dbgc.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dbgc.h
index 3f695b7e8f..a4e2d75621 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dbgc.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dbgc.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dma.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dma.h
index 1fbebd56bf..4d7f6b9787 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dma.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_dma.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_flash.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_flash.h
index 8858b8b707..ad3148382f 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_flash.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_flash.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_gpio.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_gpio.h
index 336c90f977..01df5fd138 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_gpio.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_gpio.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_i2c.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_i2c.h
index f421ff168e..27527104ba 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_i2c.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_i2c.h
@@ -10,6 +10,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_iap.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_iap.h
index a777fca4a9..2fa6a4f6ec 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_iap.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_iap.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pis.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pis.h
index c17b03cfd9..5b63193f46 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pis.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pis.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pmu.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pmu.h
index 264c185b81..be93e204ba 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pmu.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_pmu.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rmu.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rmu.h
index 164ebb5e3f..6cc63fab8a 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rmu.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rmu.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rtc.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rtc.h
index dd5d8ad7ee..fbb6799c17 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rtc.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_rtc.h
@@ -10,6 +10,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*******************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_smartcard.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_smartcard.h
index 74401fecc1..291908e6d5 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_smartcard.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_smartcard.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_spi.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_spi.h
index 1a7c7c7e5e..5820deadf2 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_spi.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_spi.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_syscfg.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_syscfg.h
index 35844c887e..3df2492432 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_syscfg.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_syscfg.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_timer.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_timer.h
index 538fc0ca0b..e6f4986947 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_timer.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_timer.h
@@ -12,6 +12,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_trng.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_trng.h
index 635cb1a90a..202e6f2af8 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_trng.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_trng.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_tsense.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_tsense.h
index 410dcb7ff6..dc78ce56cc 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_tsense.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_tsense.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_uart.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_uart.h
index 10a351ca19..a240a91b36 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_uart.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_uart.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_usart.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_usart.h
index 4f30e2c2a4..b3cd4bf421 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_usart.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_usart.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_wdt.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_wdt.h
index 619f777324..2473a8ebb2 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_wdt.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/ald_wdt.h
@@ -10,6 +10,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/type.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/type.h
index 54082f3f21..a892c69bd4 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/type.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/type.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
@@ -22,6 +36,7 @@ extern "C" {
#endif
#include <stdint.h>
+#include "es_conf_info_select.h"
#if defined (__CC_ARM)
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/utils.h b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/utils.h
index 5ad1dc36a7..165cec6306 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/utils.h
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Include/utils.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_acmp.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_acmp.c
index e480de1697..cec11372c3 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_acmp.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_acmp.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_adc.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_adc.c
index 7f1f522c7a..bf0215740b 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_adc.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_adc.c
@@ -24,6 +24,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_bkpc.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_bkpc.c
index a3852bdb22..b459fba045 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_bkpc.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_bkpc.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_calc.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_calc.c
index ec2400453d..2196ffb99f 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_calc.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_calc.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_can.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_can.c
index fb551abdf1..b665165077 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_can.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_can.c
@@ -14,6 +14,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_cmu.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_cmu.c
index e43b12c7d1..b6473dc432 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_cmu.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_cmu.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crc.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crc.c
index bf6fde037c..2a69489158 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crc.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crc.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crypt.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crypt.c
index ff8f92d9d5..1381bd416f 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crypt.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_crypt.c
@@ -12,6 +12,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_dma.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_dma.c
index f3c125578d..080dff3045 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_dma.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_dma.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash.c
index 44d25a7f76..224843cb01 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash.c
@@ -10,6 +10,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#include "ald_flash.h"
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash_ext.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash_ext.c
index 44e8fe7d9c..4087b71b01 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash_ext.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_flash_ext.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*
*********************************************************************************
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_gpio.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_gpio.c
index 08366e9350..153a21d8a6 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_gpio.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_gpio.c
@@ -16,6 +16,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_i2c.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_i2c.c
index 82faa31502..a442d73428 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_i2c.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_i2c.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
@verbatim
==============================================================================
##### How to use this driver #####
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_iap.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_iap.c
index ccb9b5170b..61cee32739 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_iap.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_iap.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pis.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pis.c
index d9067499ea..c83907e0c2 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pis.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pis.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pmu.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pmu.c
index f8b4b94e27..976bae4334 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pmu.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_pmu.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rmu.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rmu.c
index 2b04f2719c..ec2ec312b6 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rmu.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rmu.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rtc.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rtc.c
index 7391045a62..4863178005 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rtc.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_rtc.c
@@ -18,6 +18,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_smartcard.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_smartcard.c
index 2b3552ab77..5a18e4ed27 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_smartcard.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_smartcard.c
@@ -16,6 +16,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_spi.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_spi.c
index f756f6785d..fd154c6c73 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_spi.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_spi.c
@@ -17,6 +17,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
@verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_timer.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_timer.c
index dc0a285368..77d3b14c8f 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_timer.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_timer.c
@@ -12,6 +12,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_trng.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_trng.c
index 8e4d13a4d0..81a62e6127 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_trng.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_trng.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_tsense.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_tsense.c
index 5fcd8311f1..9200f5a33f 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_tsense.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_tsense.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_uart.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_uart.c
index 59c2489bfa..3a13a5ea04 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_uart.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_uart.c
@@ -17,6 +17,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_usart.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_usart.c
index 1e9ed5c501..8c9c2ef8f1 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_usart.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_usart.c
@@ -17,6 +17,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_wdt.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_wdt.c
index d19a0397ab..fe21244fe7 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_wdt.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/ald_wdt.c
@@ -10,6 +10,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/utils.c b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/utils.c
index e406c53afc..e74f9d3f7f 100644
--- a/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/utils.c
+++ b/bsp/essemi/es32f0654/libraries/ES32F065x_ALD_StdPeriph_Driver/Source/utils.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f0654/project.uvprojx b/bsp/essemi/es32f0654/project.uvprojx
index 70c93b4c8e..569397deb8 100644
--- a/bsp/essemi/es32f0654/project.uvprojx
+++ b/bsp/essemi/es32f0654/project.uvprojx
@@ -336,9 +336,9 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
- <Define>ES32F065x</Define>
+ <Define>ES32F065x, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND</Define>
<Undefine></Undefine>
- <IncludePath>applications;.;drivers;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m0;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\spi;..\..\..\components\drivers\include;..\..\..\components\drivers\include;drivers;..\..\..\components\finsh;.;..\..\..\include;libraries\CMSIS\Device\EastSoft\ES32F065x\Include;libraries\CMSIS\Include;libraries\ES32F065x_ALD_StdPeriph_Driver\Include</IncludePath>
+ <IncludePath>applications;.;drivers\ES;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m0;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;drivers;..\..\..\components\finsh;.;..\..\..\include;..\..\..\components\libc\compilers\common;libraries\CMSIS\Device\EastSoft\ES32F065x\Include;libraries\CMSIS\Include;libraries\ES32F065x_ALD_StdPeriph_Driver\Include</IncludePath>
</VariousControls>
</Cads>
<Aads>
@@ -390,9 +390,14 @@
</Files>
</Group>
<Group>
- <GroupName>cpu</GroupName>
+ <GroupName>CPU</GroupName>
<Files>
<File>
+ <FileName>showmem.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>..\..\..\libcpu\arm\common\showmem.c</FilePath>
+ </File>
+ <File>
<FileName>backtrace.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\libcpu\arm\common\backtrace.c</FilePath>
@@ -403,163 +408,39 @@
<FilePath>..\..\..\libcpu\arm\common\div0.c</FilePath>
</File>
<File>
- <FileName>showmem.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\libcpu\arm\common\showmem.c</FilePath>
+ <FileName>context_rvds.S</FileName>
+ <FileType>2</FileType>
+ <FilePath>..\..\..\libcpu\arm\cortex-m0\context_rvds.S</FilePath>
</File>
<File>
<FileName>cpuport.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\libcpu\arm\cortex-m0\cpuport.c</FilePath>
</File>
- <File>
- <FileName>context_rvds.S</FileName>
- <FileType>2</FileType>
- <FilePath>..\..\..\libcpu\arm\cortex-m0\context_rvds.S</FilePath>
- </File>
</Files>
</Group>
<Group>
<GroupName>DeviceDrivers</GroupName>
- <GroupOption>
- <CommonProperty>
- <UseCPPCompiler>0</UseCPPCompiler>
- <RVCTCodeConst>0</RVCTCodeConst>
- <RVCTZI>0</RVCTZI>
- <RVCTOtherData>0</RVCTOtherData>
- <ModuleSelection>0</ModuleSelection>
- <IncludeInBuild>1</IncludeInBuild>
- <AlwaysBuild>0</AlwaysBuild>
- <GenerateAssemblyFile>0</GenerateAssemblyFile>
- <AssembleAssemblyFile>0</AssembleAssemblyFile>
- <PublicsOnly>0</PublicsOnly>
- <StopOnExitCode>3</StopOnExitCode>
- <CustomArgument></CustomArgument>
- <IncludeLibraryModules></IncludeLibraryModules>
- <ComprImg>0</ComprImg>
- </CommonProperty>
- <GroupArmAds>
- <Cads>
- <interw>2</interw>
- <Optim>0</Optim>
- <oTime>2</oTime>
- <SplitLS>2</SplitLS>
- <OneElfS>2</OneElfS>
- <Strict>2</Strict>
- <EnumInt>2</EnumInt>
- <PlainCh>2</PlainCh>
- <Ropi>2</Ropi>
- <Rwpi>2</Rwpi>
- <wLevel>0</wLevel>
- <uThumb>2</uThumb>
- <uSurpInc>2</uSurpInc>
- <uC99>2</uC99>
- <uGnu>2</uGnu>
- <useXO>2</useXO>
- <v6Lang>0</v6Lang>
- <v6LangP>0</v6LangP>
- <vShortEn>2</vShortEn>
- <vShortWch>2</vShortWch>
- <v6Lto>2</v6Lto>
- <v6WtE>2</v6WtE>
- <v6Rtti>2</v6Rtti>
- <VariousControls>
- <MiscControls></MiscControls>
- <Define> </Define>
- <Undefine> </Undefine>
- <IncludePath></IncludePath>
- </VariousControls>
- </Cads>
- <Aads>
- <interw>2</interw>
- <Ropi>2</Ropi>
- <Rwpi>2</Rwpi>
- <thumb>2</thumb>
- <SplitLS>2</SplitLS>
- <SwStkChk>2</SwStkChk>
- <NoWarn>2</NoWarn>
- <uSurpInc>2</uSurpInc>
- <useXO>2</useXO>
- <uClangAs>2</uClangAs>
- <VariousControls>
- <MiscControls></MiscControls>
- <Define></Define>
- <Undefine></Undefine>
- <IncludePath></IncludePath>
- </VariousControls>
- </Aads>
- </GroupArmAds>
- </GroupOption>
<Files>
<File>
- <FileName>can.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\can\can.c</FilePath>
- </File>
- <File>
- <FileName>hwtimer.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\hwtimer\hwtimer.c</FilePath>
- </File>
- <File>
- <FileName>i2c_core.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\i2c\i2c_core.c</FilePath>
- </File>
- <File>
- <FileName>i2c_dev.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\i2c\i2c_dev.c</FilePath>
- </File>
- <File>
- <FileName>i2c-bit-ops.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\i2c\i2c-bit-ops.c</FilePath>
- </File>
- <File>
<FileName>pin.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\misc\pin.c</FilePath>
</File>
<File>
- <FileName>adc.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\misc\adc.c</FilePath>
- </File>
- <File>
- <FileName>rt_drv_pwm.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\misc\rt_drv_pwm.c</FilePath>
- </File>
- <File>
- <FileName>pm.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\pm\pm.c</FilePath>
- </File>
- <File>
- <FileName>rtc.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\rtc\rtc.c</FilePath>
- </File>
- <File>
<FileName>serial.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\serial\serial.c</FilePath>
</File>
<File>
- <FileName>spi_core.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\spi\spi_core.c</FilePath>
- </File>
- <File>
- <FileName>spi_dev.c</FileName>
+ <FileName>waitqueue.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\spi\spi_dev.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\waitqueue.c</FilePath>
</File>
<File>
- <FileName>completion.c</FileName>
+ <FileName>pipe.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\completion.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\pipe.c</FilePath>
</File>
<File>
<FileName>dataqueue.c</FileName>
@@ -567,9 +448,9 @@
<FilePath>..\..\..\components\drivers\src\dataqueue.c</FilePath>
</File>
<File>
- <FileName>pipe.c</FileName>
+ <FileName>ringbuffer.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\pipe.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\ringbuffer.c</FilePath>
</File>
<File>
<FileName>ringblk_buf.c</FileName>
@@ -577,19 +458,14 @@
<FilePath>..\..\..\components\drivers\src\ringblk_buf.c</FilePath>
</File>
<File>
- <FileName>ringbuffer.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\ringbuffer.c</FilePath>
- </File>
- <File>
- <FileName>waitqueue.c</FileName>
+ <FileName>workqueue.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\waitqueue.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\workqueue.c</FilePath>
</File>
<File>
- <FileName>workqueue.c</FileName>
+ <FileName>completion.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\workqueue.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\completion.c</FilePath>
</File>
</Files>
</Group>
@@ -597,11 +473,6 @@
<GroupName>Drivers</GroupName>
<Files>
<File>
- <FileName>board.c</FileName>
- <FileType>1</FileType>
- <FilePath>drivers\board.c</FilePath>
- </File>
- <File>
<FileName>drv_gpio.c</FileName>
<FileType>1</FileType>
<FilePath>drivers\drv_gpio.c</FilePath>
@@ -611,6 +482,11 @@
<FileType>1</FileType>
<FilePath>drivers\drv_uart.c</FilePath>
</File>
+ <File>
+ <FileName>board.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>drivers\board.c</FilePath>
+ </File>
</Files>
</Group>
<Group>
@@ -622,14 +498,14 @@
<FilePath>..\..\..\components\finsh\shell.c</FilePath>
</File>
<File>
- <FileName>cmd.c</FileName>
+ <FileName>msh.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\finsh\cmd.c</FilePath>
+ <FilePath>..\..\..\components\finsh\msh.c</FilePath>
</File>
<File>
- <FileName>msh.c</FileName>
+ <FileName>cmd.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\finsh\msh.c</FilePath>
+ <FilePath>..\..\..\components\finsh\cmd.c</FilePath>
</File>
</Files>
</Group>
@@ -637,14 +513,9 @@
<GroupName>Kernel</GroupName>
<Files>
<File>
- <FileName>clock.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\src\clock.c</FilePath>
- </File>
- <File>
- <FileName>components.c</FileName>
+ <FileName>ipc.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\components.c</FilePath>
+ <FilePath>..\..\..\src\ipc.c</FilePath>
</File>
<File>
<FileName>device.c</FileName>
@@ -652,49 +523,49 @@
<FilePath>..\..\..\src\device.c</FilePath>
</File>
<File>
- <FileName>idle.c</FileName>
+ <FileName>object.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\idle.c</FilePath>
+ <FilePath>..\..\..\src\object.c</FilePath>
</File>
<File>
- <FileName>ipc.c</FileName>
+ <FileName>kservice.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\ipc.c</FilePath>
+ <FilePath>..\..\..\src\kservice.c</FilePath>
</File>
<File>
- <FileName>irq.c</FileName>
+ <FileName>scheduler.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\irq.c</FilePath>
+ <FilePath>..\..\..\src\scheduler.c</FilePath>
</File>
<File>
- <FileName>kservice.c</FileName>
+ <FileName>idle.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\kservice.c</FilePath>
+ <FilePath>..\..\..\src\idle.c</FilePath>
</File>
<File>
- <FileName>mem.c</FileName>
+ <FileName>irq.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\mem.c</FilePath>
+ <FilePath>..\..\..\src\irq.c</FilePath>
</File>
<File>
- <FileName>mempool.c</FileName>
+ <FileName>components.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\mempool.c</FilePath>
+ <FilePath>..\..\..\src\components.c</FilePath>
</File>
<File>
- <FileName>object.c</FileName>
+ <FileName>timer.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\object.c</FilePath>
+ <FilePath>..\..\..\src\timer.c</FilePath>
</File>
<File>
- <FileName>scheduler.c</FileName>
+ <FileName>mempool.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\scheduler.c</FilePath>
+ <FilePath>..\..\..\src\mempool.c</FilePath>
</File>
<File>
- <FileName>signal.c</FileName>
+ <FileName>mem.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\signal.c</FilePath>
+ <FilePath>..\..\..\src\mem.c</FilePath>
</File>
<File>
<FileName>thread.c</FileName>
@@ -702,104 +573,114 @@
<FilePath>..\..\..\src\thread.c</FilePath>
</File>
<File>
- <FileName>timer.c</FileName>
+ <FileName>clock.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\timer.c</FilePath>
+ <FilePath>..\..\..\src\clock.c</FilePath>
</File>
</Files>
</Group>
<Group>
- <GroupName>Libraries</GroupName>
+ <GroupName>libc</GroupName>
<Files>
<File>
- <FileName>ald_acmp.c</FileName>
+ <FileName>time.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_acmp.c</FilePath>
+ <FilePath>..\..\..\components\libc\compilers\common\time.c</FilePath>
</File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Libraries</GroupName>
+ <Files>
<File>
- <FileName>ald_adc.c</FileName>
+ <FileName>ald_dma.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_adc.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_dma.c</FilePath>
</File>
<File>
- <FileName>ald_bkpc.c</FileName>
+ <FileName>ald_crc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_bkpc.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_crc.c</FilePath>
</File>
<File>
- <FileName>ald_calc.c</FileName>
+ <FileName>utils.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_calc.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\utils.c</FilePath>
</File>
<File>
- <FileName>ald_can.c</FileName>
+ <FileName>ald_flash_ext.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_can.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_flash_ext.c</FilePath>
</File>
<File>
- <FileName>ald_cmu.c</FileName>
+ <FileName>ald_trng.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_cmu.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_trng.c</FilePath>
</File>
<File>
- <FileName>ald_crc.c</FileName>
+ <FileName>ald_pmu.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_crc.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_pmu.c</FilePath>
</File>
<File>
- <FileName>ald_crypt.c</FileName>
+ <FileName>ald_i2c.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_crypt.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_i2c.c</FilePath>
</File>
<File>
- <FileName>ald_dma.c</FileName>
+ <FileName>ald_can.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_dma.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_can.c</FilePath>
</File>
<File>
- <FileName>ald_flash.c</FileName>
+ <FileName>ald_crypt.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_flash.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_crypt.c</FilePath>
</File>
<File>
- <FileName>ald_flash_ext.c</FileName>
+ <FileName>ald_spi.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_flash_ext.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_spi.c</FilePath>
</File>
<File>
- <FileName>ald_gpio.c</FileName>
+ <FileName>ald_rtc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_gpio.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_rtc.c</FilePath>
</File>
<File>
- <FileName>ald_i2c.c</FileName>
+ <FileName>ald_iap.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_i2c.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_iap.c</FilePath>
</File>
<File>
- <FileName>ald_iap.c</FileName>
+ <FileName>startup_es32f065x.s</FileName>
+ <FileType>2</FileType>
+ <FilePath>libraries\CMSIS\Device\EastSoft\ES32F065x\Startup\keil\startup_es32f065x.s</FilePath>
+ </File>
+ <File>
+ <FileName>ald_usart.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_iap.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_usart.c</FilePath>
</File>
<File>
- <FileName>ald_pis.c</FileName>
+ <FileName>ald_uart.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_pis.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_uart.c</FilePath>
</File>
<File>
- <FileName>ald_pmu.c</FileName>
+ <FileName>ald_tsense.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_pmu.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_tsense.c</FilePath>
</File>
<File>
- <FileName>ald_rmu.c</FileName>
+ <FileName>ald_wdt.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_rmu.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_wdt.c</FilePath>
</File>
<File>
- <FileName>ald_rtc.c</FileName>
+ <FileName>ald_flash.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_rtc.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_flash.c</FilePath>
</File>
<File>
<FileName>ald_smartcard.c</FileName>
@@ -807,49 +688,49 @@
<FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_smartcard.c</FilePath>
</File>
<File>
- <FileName>ald_spi.c</FileName>
+ <FileName>ald_pis.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_spi.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_pis.c</FilePath>
</File>
<File>
- <FileName>ald_timer.c</FileName>
+ <FileName>ald_cmu.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_timer.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_cmu.c</FilePath>
</File>
<File>
- <FileName>ald_trng.c</FileName>
+ <FileName>ald_rmu.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_trng.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_rmu.c</FilePath>
</File>
<File>
- <FileName>ald_tsense.c</FileName>
+ <FileName>ald_acmp.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_tsense.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_acmp.c</FilePath>
</File>
<File>
- <FileName>ald_uart.c</FileName>
+ <FileName>ald_calc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_uart.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_calc.c</FilePath>
</File>
<File>
- <FileName>ald_usart.c</FileName>
+ <FileName>ald_gpio.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_usart.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_gpio.c</FilePath>
</File>
<File>
- <FileName>ald_wdt.c</FileName>
+ <FileName>ald_timer.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_wdt.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_timer.c</FilePath>
</File>
<File>
- <FileName>utils.c</FileName>
+ <FileName>ald_adc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\utils.c</FilePath>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_adc.c</FilePath>
</File>
<File>
- <FileName>startup_es32f065x.s</FileName>
- <FileType>2</FileType>
- <FilePath>libraries\CMSIS\Device\EastSoft\ES32F065x\Startup\keil\startup_es32f065x.s</FilePath>
+ <FileName>ald_bkpc.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>libraries\ES32F065x_ALD_StdPeriph_Driver\Source\ald_bkpc.c</FilePath>
</File>
</Files>
</Group>
diff --git a/bsp/essemi/es32f0654/rtconfig.h b/bsp/essemi/es32f0654/rtconfig.h
index 3a173aaa59..9b50643265 100644
--- a/bsp/essemi/es32f0654/rtconfig.h
+++ b/bsp/essemi/es32f0654/rtconfig.h
@@ -76,16 +76,7 @@
#define RT_PIPE_BUFSZ 512
#define RT_USING_SERIAL
#define RT_SERIAL_RB_BUFSZ 64
-#define RT_USING_CAN
-#define RT_USING_HWTIMER
-#define RT_USING_I2C
-#define RT_USING_I2C_BITOPS
#define RT_USING_PIN
-#define RT_USING_ADC
-#define RT_USING_PWM
-#define RT_USING_PM
-#define RT_USING_RTC
-#define RT_USING_SPI
/* Using USB */
diff --git a/bsp/essemi/es32f369x/.config b/bsp/essemi/es32f369x/.config
index af456dc765..5e47c69c47 100644
--- a/bsp/essemi/es32f369x/.config
+++ b/bsp/essemi/es32f369x/.config
@@ -19,8 +19,9 @@ CONFIG_RT_USING_OVERFLOW_CHECK=y
CONFIG_RT_USING_HOOK=y
CONFIG_RT_USING_IDLE_HOOK=y
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
-CONFIG_IDLE_THREAD_STACK_SIZE=256
+CONFIG_IDLE_THREAD_STACK_SIZE=512
# CONFIG_RT_USING_TIMER_SOFT is not set
+# CONFIG_RT_KSERVICE_USING_STDLIB is not set
CONFIG_RT_DEBUG=y
CONFIG_RT_DEBUG_COLOR=y
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
@@ -42,7 +43,7 @@ CONFIG_RT_USING_MUTEX=y
CONFIG_RT_USING_EVENT=y
CONFIG_RT_USING_MAILBOX=y
CONFIG_RT_USING_MESSAGEQUEUE=y
-# CONFIG_RT_USING_SIGNALS is not set
+CONFIG_RT_USING_SIGNALS=y
#
# Memory Management
@@ -52,6 +53,7 @@ CONFIG_RT_USING_MEMPOOL=y
# CONFIG_RT_USING_NOHEAP is not set
CONFIG_RT_USING_SMALL_MEM=y
# CONFIG_RT_USING_SLAB is not set
+# CONFIG_RT_USING_USERHEAP is not set
# CONFIG_RT_USING_MEMTRACE is not set
CONFIG_RT_USING_HEAP=y
@@ -114,31 +116,21 @@ CONFIG_RT_PIPE_BUFSZ=512
CONFIG_RT_USING_SERIAL=y
# CONFIG_RT_SERIAL_USING_DMA is not set
CONFIG_RT_SERIAL_RB_BUFSZ=64
-CONFIG_RT_USING_CAN=y
-# CONFIG_RT_CAN_USING_HDR is not set
-CONFIG_RT_USING_HWTIMER=y
+# CONFIG_RT_USING_CAN is not set
+# CONFIG_RT_USING_HWTIMER is not set
# CONFIG_RT_USING_CPUTIME is not set
-CONFIG_RT_USING_I2C=y
-# CONFIG_RT_I2C_DEBUG is not set
-CONFIG_RT_USING_I2C_BITOPS=y
-# CONFIG_RT_I2C_BITOPS_DEBUG is not set
+# CONFIG_RT_USING_I2C is not set
+# CONFIG_RT_USING_PHY is not set
CONFIG_RT_USING_PIN=y
-CONFIG_RT_USING_ADC=y
+# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set
-CONFIG_RT_USING_PWM=y
+# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
-CONFIG_RT_USING_PM=y
-CONFIG_RT_USING_RTC=y
-# CONFIG_RT_USING_ALARM is not set
-# CONFIG_RT_USING_SOFT_RTC is not set
+# CONFIG_RT_USING_PM is not set
+# CONFIG_RT_USING_RTC is not set
# CONFIG_RT_USING_SDIO is not set
-CONFIG_RT_USING_SPI=y
-# CONFIG_RT_USING_QSPI is not set
-# CONFIG_RT_USING_SPI_MSD is not set
-# CONFIG_RT_USING_SFUD is not set
-# CONFIG_RT_USING_ENC28J60 is not set
-# CONFIG_RT_USING_SPI_WIFI is not set
+# CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
@@ -159,7 +151,7 @@ CONFIG_RT_USING_SPI=y
#
# CONFIG_RT_USING_LIBC is not set
# CONFIG_RT_USING_PTHREADS is not set
-# CONFIG_RT_LIBC_USING_TIME is not set
+CONFIG_RT_LIBC_USING_TIME=y
#
# Network
@@ -305,6 +297,8 @@ CONFIG_RT_USING_SPI=y
# CONFIG_PKG_USING_WAVPLAYER is not set
# CONFIG_PKG_USING_TJPGD is not set
# CONFIG_PKG_USING_HELIX is not set
+# CONFIG_PKG_USING_AZUREGUIX is not set
+# CONFIG_PKG_USING_TOUCHGFX2RTT is not set
#
# tools packages
@@ -319,6 +313,7 @@ CONFIG_RT_USING_SPI=y
# CONFIG_PKG_USING_ADBD is not set
# CONFIG_PKG_USING_COREMARK is not set
# CONFIG_PKG_USING_DHRYSTONE is not set
+# CONFIG_PKG_USING_MEMORYPERF is not set
# CONFIG_PKG_USING_NR_MICRO_SHELL is not set
# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set
# CONFIG_PKG_USING_LUNAR_CALENDAR is not set
@@ -326,6 +321,10 @@ CONFIG_RT_USING_SPI=y
# CONFIG_PKG_USING_GPS_RMC is not set
# CONFIG_PKG_USING_URLENCODE is not set
# CONFIG_PKG_USING_UMCN is not set
+# CONFIG_PKG_USING_LWRB2RTT is not set
+# CONFIG_PKG_USING_CPU_USAGE is not set
+# CONFIG_PKG_USING_GBK2UTF8 is not set
+# CONFIG_PKG_USING_VCONSOLE is not set
#
# system packages
@@ -352,7 +351,16 @@ CONFIG_RT_USING_SPI=y
# CONFIG_PKG_USING_RAMDISK is not set
# CONFIG_PKG_USING_MININI is not set
# CONFIG_PKG_USING_QBOOT is not set
+
+#
+# Micrium: Micrium software products porting for RT-Thread
+#
# CONFIG_PKG_USING_UCOSIII_WRAPPER is not set
+# CONFIG_PKG_USING_UCOSII_WRAPPER is not set
+# CONFIG_PKG_USING_UC_CRC is not set
+# CONFIG_PKG_USING_UC_CLK is not set
+# CONFIG_PKG_USING_UC_COMMON is not set
+# CONFIG_PKG_USING_UC_MODBUS is not set
# CONFIG_PKG_USING_PPOOL is not set
#
@@ -408,6 +416,10 @@ CONFIG_RT_USING_SPI=y
# CONFIG_PKG_USING_WK2124 is not set
# CONFIG_PKG_USING_LY68L6400 is not set
# CONFIG_PKG_USING_DM9051 is not set
+# CONFIG_PKG_USING_SSD1306 is not set
+# CONFIG_PKG_USING_QKEY is not set
+# CONFIG_PKG_USING_RS485 is not set
+# CONFIG_PKG_USING_NES is not set
#
# miscellaneous packages
@@ -417,6 +429,7 @@ CONFIG_RT_USING_SPI=y
# CONFIG_PKG_USING_FASTLZ is not set
# CONFIG_PKG_USING_MINILZO is not set
# CONFIG_PKG_USING_QUICKLZ is not set
+# CONFIG_PKG_USING_LZMA is not set
# CONFIG_PKG_USING_MULTIBUTTON is not set
# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
# CONFIG_PKG_USING_CANFESTIVAL is not set
@@ -437,17 +450,23 @@ CONFIG_RT_USING_SPI=y
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
# CONFIG_PKG_USING_HELLO is not set
# CONFIG_PKG_USING_VI is not set
+# CONFIG_PKG_USING_KI is not set
# CONFIG_PKG_USING_NNOM is not set
# CONFIG_PKG_USING_LIBANN is not set
# CONFIG_PKG_USING_ELAPACK is not set
# CONFIG_PKG_USING_ARMv7M_DWT is not set
# CONFIG_PKG_USING_VT100 is not set
-# CONFIG_PKG_USING_TETRIS is not set
# CONFIG_PKG_USING_ULAPACK is not set
# CONFIG_PKG_USING_UKAL is not set
# CONFIG_PKG_USING_CRCLIB is not set
+
+#
+# games: games run on RT-Thread console
+#
# CONFIG_PKG_USING_THREES is not set
# CONFIG_PKG_USING_2048 is not set
+# CONFIG_PKG_USING_SNAKE is not set
+# CONFIG_PKG_USING_TETRIS is not set
# CONFIG_PKG_USING_LWGPS is not set
# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
CONFIG_SOC_ES32F3696LT=y
@@ -487,12 +506,13 @@ CONFIG_BSP_USING_UART0=y
#
# CAN Drivers
#
-# CONFIG_BSP_USING_CAN is not set
+# CONFIG_BSP_USING_CAN0 is not set
#
# ADC Drivers
#
-# CONFIG_BSP_USING_ADC is not set
+# CONFIG_BSP_USING_ADC0 is not set
+# CONFIG_BSP_USING_ADC1 is not set
#
# RTC Drivers
@@ -500,16 +520,26 @@ CONFIG_BSP_USING_UART0=y
# CONFIG_BSP_USING_RTC is not set
#
-# HWtimer Drivers
+# HWTIMER Drivers
#
-# CONFIG_BSP_USING_HWTIMER0 is not set
-# CONFIG_BSP_USING_HWTIMER1 is not set
+# CONFIG_BSP_USING_AD16C4T0_HWTIMER is not set
+# CONFIG_BSP_USING_AD16C4T1_HWTIMER is not set
+# CONFIG_BSP_USING_GP32C4T0_HWTIMER is not set
+# CONFIG_BSP_USING_GP32C4T1_HWTIMER is not set
+# CONFIG_BSP_USING_GP16C4T0_HWTIMER is not set
+# CONFIG_BSP_USING_GP16C4T1_HWTIMER is not set
+# CONFIG_BSP_USING_BS16T0_HWTIMER is not set
+# CONFIG_BSP_USING_BS16T1_HWTIMER is not set
#
# PWM Drivers
#
-# CONFIG_BSP_USING_PWM0 is not set
-# CONFIG_BSP_USING_PWM1 is not set
+# CONFIG_BSP_USING_AD16C4T0_PWM is not set
+# CONFIG_BSP_USING_AD16C4T1_PWM is not set
+# CONFIG_BSP_USING_GP32C4T0_PWM is not set
+# CONFIG_BSP_USING_GP32C4T1_PWM is not set
+# CONFIG_BSP_USING_GP16C4T0_PWM is not set
+# CONFIG_BSP_USING_GP16C4T1_PWM is not set
#
# PM Drivers
diff --git a/bsp/essemi/es32f369x/drivers/ES/Kconfig b/bsp/essemi/es32f369x/drivers/ES/Kconfig
new file mode 100644
index 0000000000..9ba55d110e
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/Kconfig
@@ -0,0 +1,197 @@
+menu "UART Drivers"
+
+ config BSP_USING_UART0
+ bool "Register UART0 "
+ select RT_USING_SERIAL
+ default y
+
+ config BSP_USING_UART1
+ bool "Register UART1 "
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_UART2
+ bool "Register UART2 "
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_UART3
+ bool "Register UART3 "
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_UART4
+ bool "Register UART4 "
+ select RT_USING_SERIAL
+ default n
+
+ config BSP_USING_UART5
+ bool "Register UART5 "
+ select RT_USING_SERIAL
+ default n
+
+endmenu
+
+menu "SPI Drivers"
+
+ config BSP_USING_SPI0
+ bool "Register SPI0 "
+ select RT_USING_SPI
+ select RT_USING_PIN
+ default n
+
+ config BSP_USING_SPI1
+ bool "Register SPI1 "
+ select RT_USING_SPI
+ select RT_USING_PIN
+ default n
+
+ config BSP_USING_SPI2
+ bool "Register SPI2 "
+ select RT_USING_SPI
+ select RT_USING_PIN
+ default n
+
+endmenu
+
+menu "I2C Drivers"
+
+ config BSP_USING_I2C0
+ bool "Register I2C0 "
+ select RT_USING_I2C
+ default n
+
+ config BSP_USING_I2C1
+ bool "Register I2C1 "
+ select RT_USING_I2C
+ default n
+
+endmenu
+
+menu "CAN Drivers"
+
+ config BSP_USING_CAN0
+ bool "Register CAN0 "
+ select RT_USING_CAN
+ select RT_CAN_USING_HDR
+ select BSP_USING_CAN
+ default n
+
+endmenu
+
+menu "ADC Drivers"
+
+ config BSP_USING_ADC0
+ bool "Register ADC0 "
+ select RT_USING_ADC
+ default n
+
+ config BSP_USING_ADC1
+ bool "Register ADC1 "
+ select RT_USING_ADC
+ default n
+
+endmenu
+
+menu "RTC Drivers"
+
+ config BSP_USING_RTC
+ bool "Register RTC "
+ select RT_USING_RTC
+ default n
+
+endmenu
+
+menu "HWTIMER Drivers"
+
+ config BSP_USING_AD16C4T0_HWTIMER
+ bool "Register HWTIMER0 "
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_AD16C4T1_HWTIMER
+ bool "Register HWTIMER1 "
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_GP32C4T0_HWTIMER
+ bool "Register HWTIMER2 "
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_GP32C4T1_HWTIMER
+ bool "Register HWTIMER3 "
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_GP16C4T0_HWTIMER
+ bool "Register HWTIMER4 "
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_GP16C4T1_HWTIMER
+ bool "Register HWTIMER5 "
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_BS16T0_HWTIMER
+ bool "Register HWTIMER6 "
+ select RT_USING_HWTIMER
+ default n
+
+ config BSP_USING_BS16T1_HWTIMER
+ bool "Register HWTIMER7 "
+ select RT_USING_HWTIMER
+ default n
+
+endmenu
+
+menu "PWM Drivers"
+
+ config BSP_USING_AD16C4T0_PWM
+ bool "Register PWM0 "
+ select RT_USING_PWM
+ default n
+ depends on !BSP_USING_AD16C4T0_HWTIMER
+
+ config BSP_USING_AD16C4T1_PWM
+ bool "Register PWM1 "
+ select RT_USING_PWM
+ default n
+ depends on !BSP_USING_AD16C4T1_HWTIMER
+
+ config BSP_USING_GP32C4T0_PWM
+ bool "Register PWM2 "
+ select RT_USING_PWM
+ default n
+ depends on !BSP_USING_GP32C4T0_HWTIMER
+
+ config BSP_USING_GP32C4T1_PWM
+ bool "Register PWM3 "
+ select RT_USING_PWM
+ default n
+ depends on !BSP_USING_GP32C4T1_HWTIMER
+
+ config BSP_USING_GP16C4T0_PWM
+ bool "Register PWM4 "
+ select RT_USING_PWM
+ default n
+ depends on !BSP_USING_GP16C4T0_HWTIMER
+
+ config BSP_USING_GP16C4T1_PWM
+ bool "Register PWM5 "
+ select RT_USING_PWM
+ default n
+ depends on !BSP_USING_GP16C4T1_HWTIMER
+
+endmenu
+
+menu "PM Drivers"
+
+ config BSP_USING_PM
+ bool "Register PM "
+ select RT_USING_PM
+ default n
+
+endmenu
+
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_adc.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_adc.h
new file mode 100644
index 0000000000..772f7a0df0
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_adc.h
@@ -0,0 +1,97 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_ADC_H__
+#define __ES_CONF_INFO_ADC_H__
+
+#include "es_conf_info_map.h"
+
+#include <ald_adc.h>
+
+
+#define ES_C_ADC_CLK_DIV_1 ADC_CKDIV_1
+#define ES_C_ADC_CLK_DIV_2 ADC_CKDIV_2
+#define ES_C_ADC_CLK_DIV_4 ADC_CKDIV_4
+#define ES_C_ADC_CLK_DIV_8 ADC_CKDIV_8
+#define ES_C_ADC_CLK_DIV_16 ADC_CKDIV_16
+#define ES_C_ADC_CLK_DIV_32 ADC_CKDIV_32
+#define ES_C_ADC_CLK_DIV_64 ADC_CKDIV_64
+#define ES_C_ADC_CLK_DIV_128 ADC_CKDIV_128
+
+#define ES_C_ADC_ALIGN_RIGHT ADC_DATAALIGN_RIGHT
+#define ES_C_ADC_ALIGN_LEFT ADC_DATAALIGN_LEFT
+
+#define ES_C_ADC_CONV_BIT_6 ADC_CONV_BIT_6
+#define ES_C_ADC_CONV_BIT_8 ADC_CONV_BIT_8
+#define ES_C_ADC_CONV_BIT_10 ADC_CONV_BIT_10
+#define ES_C_ADC_CONV_BIT_12 ADC_CONV_BIT_12
+
+#define ES_C_ADC_SAMPLE_TIME_1 ADC_SAMPLETIME_1
+#define ES_C_ADC_SAMPLE_TIME_2 ADC_SAMPLETIME_2
+#define ES_C_ADC_SAMPLE_TIME_4 ADC_SAMPLETIME_4
+#define ES_C_ADC_SAMPLE_TIME_15 ADC_SAMPLETIME_15
+
+/* ADC 配置 */
+
+/* codes_main */
+
+
+#define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
+#define ES_ADC1_ALIGN ES_C_ADC_ALIGN_RIGHT
+#define ES_ADC1_DATA_BIT ES_C_ADC_CONV_BIT_12
+#define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
+
+#ifndef ES_DEVICE_NAME_ADC0
+#define ES_DEVICE_NAME_ADC0 "adc0"
+#endif
+#ifndef ES_DEVICE_NAME_ADC1
+#define ES_DEVICE_NAME_ADC1 "adc1"
+#endif
+
+#ifndef ES_ADC0_CLK_DIV
+#define ES_ADC0_CLK_DIV ES_C_ADC_CLK_DIV_128
+#endif
+#ifndef ES_ADC0_ALIGN
+#define ES_ADC0_ALIGN ES_C_ADC_ALIGN_RIGHT
+#endif
+#ifndef ES_ADC0_DATA_BIT
+#define ES_ADC0_DATA_BIT ES_C_ADC_CONV_BIT_12
+#endif
+#ifndef ES_ADC0_NCH_SAMPLETIME
+#define ES_ADC0_NCH_SAMPLETIME ES_C_ADC_SAMPLE_TIME_4
+#endif
+
+#ifndef ES_ADC1_CLK_DIV
+#define ES_ADC1_CLK_DIV ES_C_ADC_CLK_DIV_128
+#endif
+#ifndef ES_ADC1_ALIGN
+#define ES_ADC1_ALIGN ES_C_ADC_ALIGN_RIGHT
+#endif
+#ifndef ES_ADC1_DATA_BIT
+#define ES_ADC1_DATA_BIT ES_C_ADC_CONV_BIT_12
+#endif
+#ifndef ES_ADC1_NCH_SAMPLETIME
+#define ES_ADC1_NCH_SAMPLETIME ES_C_ADC_SAMPLE_TIME_4
+#endif
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_can.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_can.h
new file mode 100644
index 0000000000..46df1ed054
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_can.h
@@ -0,0 +1,73 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_CAN_H__
+#define __ES_CONF_INFO_CAN_H__
+
+#include "es_conf_info_map.h"
+#include <ald_can.h>
+#include <ald_gpio.h>
+
+
+/*默认的CAN硬件过滤器的编号 0 */
+#define ES_C_CAN_DEFAULT_FILTER_NUMBER 0
+
+/*硬件过滤器,过滤帧类型*/
+#define ES_C_CAN_FILTER_FRAME_TYPE 0
+
+
+#define ES_C_CAN_SJW_NUM_1 CAN_SJW_1
+#define ES_C_CAN_SJW_NUM_2 CAN_SJW_2
+#define ES_C_CAN_SJW_NUM_3 CAN_SJW_3
+#define ES_C_CAN_SJW_NUM_4 CAN_SJW_4
+
+
+
+/* CAN 配置 */
+
+/* codes_main */
+
+
+
+#ifndef ES_DEVICE_NAME_CAN0
+#define ES_DEVICE_NAME_CAN0 "can0"
+#endif
+
+#ifndef ES_CAN0_AUTO_BAN_RE_T
+#define ES_CAN0_AUTO_BAN_RE_T ES_C_ENABLE
+#endif
+#ifndef ES_CAN0_SPEED
+#define ES_CAN0_SPEED 1000000
+#endif
+#ifndef ES_CAN0_SJW
+#define ES_CAN0_SJW ES_C_CAN_SJW_NUM_4
+#endif
+
+#define ES_CAN0_CONFIG \
+{ \
+ ES_CAN0_SPEED, \
+ RT_CANMSG_BOX_SZ, \
+ RT_CANSND_BOX_NUM, \
+ RT_CAN_MODE_NORMAL, \
+};
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_cmu.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_cmu.h
new file mode 100644
index 0000000000..1c5e6a829a
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_cmu.h
@@ -0,0 +1,89 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_CMU_H__
+#define __ES_CONF_INFO_CMU_H__
+
+
+#include <ald_cmu.h>
+
+
+/* 时钟树 配置 */
+
+#define ES_C_MUL_9 CMU_PLL1_OUTPUT_36M
+#define ES_C_MUL_12 CMU_PLL1_OUTPUT_48M
+#define ES_C_MUL_18 CMU_PLL1_OUTPUT_72M
+#define ES_C_MUL_24 CMU_PLL1_OUTPUT_96M
+
+#define ES_C_DIV_1 CMU_DIV_1
+#define ES_C_DIV_2 CMU_DIV_2
+#define ES_C_DIV_4 CMU_DIV_4
+#define ES_C_DIV_8 CMU_DIV_8
+#define ES_C_DIV_16 CMU_DIV_16
+#define ES_C_DIV_32 CMU_DIV_32
+#define ES_C_DIV_64 CMU_DIV_64
+#define ES_C_DIV_128 CMU_DIV_128
+#define ES_C_DIV_256 CMU_DIV_256
+#define ES_C_DIV_512 CMU_DIV_512
+#define ES_C_DIV_1024 CMU_DIV_1024
+#define ES_C_DIV_2048 CMU_DIV_2048
+#define ES_C_DIV_4096 CMU_DIV_4096
+
+#define ES_C_HOSC_DIV_1 CMU_PLL1_INPUT_HOSC
+#define ES_C_HOSC_DIV_2 CMU_PLL1_INPUT_HOSC_2
+#define ES_C_HOSC_DIV_3 CMU_PLL1_INPUT_HOSC_3
+#define ES_C_HOSC_DIV_4 CMU_PLL1_INPUT_HOSC_4
+#define ES_C_HOSC_DIV_5 CMU_PLL1_INPUT_HOSC_5
+#define ES_C_HOSC_DIV_6 CMU_PLL1_INPUT_HOSC_6
+#define ES_C_HRC_DIV_6 CMU_PLL1_INPUT_HRC_6
+
+
+
+
+
+#define ES_PLL1_REFER_CLK ES_C_HOSC_DIV_3
+#define ES_PLL1_OUT_CLK ES_C_MUL_18
+#define ES_CMU_PLL1_EN ES_C_ENABLE
+#define ES_CMU_PLL1_SAFE_EN ES_C_DISABLE
+#define ES_CMU_LOSC_EN ES_C_ENABLE
+#define ES_CMU_LRC_EN ES_C_ENABLE
+#define ES_CMU_HOSC_EN ES_C_ENABLE
+#define ES_CMU_HRC_EN ES_C_ENABLE
+#define ES_CMU_SYS_DIV ES_C_DIV_1
+#define ES_CMU_HCLK_1_DIV ES_C_DIV_2
+#define ES_CMU_HCLK_2_DIV ES_C_DIV_2
+#define ES_CMU_PCLK_1_DIV ES_C_DIV_2
+#define ES_CMU_PCLK_2_DIV ES_C_DIV_4
+#define ES_SYS_CLK_SOURSE CMU_CLOCK_PLL1
+#define ES_PLL_CLK 72000000
+#define ES_SYS_SOURCE_CLK 72000000
+#define ES_SYS_CLK 72000000
+#define ES_PCLK1_CLK 36000000
+#define ES_PCLK2_CLK 18000000
+#define ES_HCLK1_CLK 36000000
+#define ES_HCLK2_CLK 36000000
+#define ES_CMU_EXTERN_CLK_LOSC 32768
+#define ES_CMU_EXTERN_CLK_HOSC 12000000
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_gpio.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_gpio.h
new file mode 100644
index 0000000000..7748e5fda2
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_gpio.h
@@ -0,0 +1,5157 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_GPIO_H__
+#define __ES_CONF_INFO_GPIO_H__
+
+#include "es_conf_info_map.h"
+
+#include <rthw.h>
+#include <rtdevice.h>
+#include <ald_cmu.h>
+
+/* GPIO 配置 */
+
+typedef struct {
+ uint8_t pin;
+ uint8_t pin_mode;
+ uint8_t pin_level;
+ uint8_t irq_en;
+ uint8_t irq_mode;
+ void (*callback)(void *arg);
+} gpio_conf_t;
+
+/*参数的定义*/
+
+#define ES_C_GPIO_LEVEL_HIGH PIN_HIGH
+#define ES_C_GPIO_LEVEL_LOW PIN_LOW
+
+#define ES_C_GPIO_MODE_OUTPUT PIN_MODE_OUTPUT
+#define ES_C_GPIO_MODE_INPUT PIN_MODE_INPUT
+#define ES_C_GPIO_MODE_INPUT_PULLUP PIN_MODE_INPUT_PULLUP
+#define ES_C_GPIO_MODE_INPUT_PULLDOWN PIN_MODE_INPUT_PULLDOWN
+#define ES_C_GPIO_MODE_OUTPUT_OD PIN_MODE_OUTPUT_OD
+
+#define ES_C_GPIO_IRQ_ENABLE PIN_IRQ_ENABLE
+#define ES_C_GPIO_IRQ_DISABLE PIN_IRQ_DISABLE
+
+#define ES_C_GPIO_IRQ_MODE_FALL PIN_IRQ_MODE_FALLING
+#define ES_C_GPIO_IRQ_MODE_RISE PIN_IRQ_MODE_RISING
+#define ES_C_GPIO_IRQ_MODE_R_F PIN_IRQ_MODE_RISING_FALLING
+
+
+
+
+
+/* codes_main */
+
+
+
+
+#ifndef ES_DEVICE_NAME_PIN
+#define ES_DEVICE_NAME_PIN "pin"
+#endif
+
+/*GPIO外部中断回调函数控制需要,补充是否中断*/
+#if 11111
+
+#ifndef ES_INIT_GPIO_A_0_IRQ_EN
+#define ES_INIT_GPIO_A_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_1_IRQ_EN
+#define ES_INIT_GPIO_A_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_2_IRQ_EN
+#define ES_INIT_GPIO_A_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_3_IRQ_EN
+#define ES_INIT_GPIO_A_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_4_IRQ_EN
+#define ES_INIT_GPIO_A_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_5_IRQ_EN
+#define ES_INIT_GPIO_A_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_6_IRQ_EN
+#define ES_INIT_GPIO_A_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_7_IRQ_EN
+#define ES_INIT_GPIO_A_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_8_IRQ_EN
+#define ES_INIT_GPIO_A_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_9_IRQ_EN
+#define ES_INIT_GPIO_A_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_10_IRQ_EN
+#define ES_INIT_GPIO_A_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_11_IRQ_EN
+#define ES_INIT_GPIO_A_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_12_IRQ_EN
+#define ES_INIT_GPIO_A_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_13_IRQ_EN
+#define ES_INIT_GPIO_A_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_14_IRQ_EN
+#define ES_INIT_GPIO_A_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_A_15_IRQ_EN
+#define ES_INIT_GPIO_A_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_0_IRQ_EN
+#define ES_INIT_GPIO_B_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_1_IRQ_EN
+#define ES_INIT_GPIO_B_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_2_IRQ_EN
+#define ES_INIT_GPIO_B_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_3_IRQ_EN
+#define ES_INIT_GPIO_B_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_4_IRQ_EN
+#define ES_INIT_GPIO_B_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_5_IRQ_EN
+#define ES_INIT_GPIO_B_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_6_IRQ_EN
+#define ES_INIT_GPIO_B_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_7_IRQ_EN
+#define ES_INIT_GPIO_B_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_8_IRQ_EN
+#define ES_INIT_GPIO_B_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_9_IRQ_EN
+#define ES_INIT_GPIO_B_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_10_IRQ_EN
+#define ES_INIT_GPIO_B_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_11_IRQ_EN
+#define ES_INIT_GPIO_B_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_12_IRQ_EN
+#define ES_INIT_GPIO_B_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_13_IRQ_EN
+#define ES_INIT_GPIO_B_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_14_IRQ_EN
+#define ES_INIT_GPIO_B_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_B_15_IRQ_EN
+#define ES_INIT_GPIO_B_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_0_IRQ_EN
+#define ES_INIT_GPIO_C_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_1_IRQ_EN
+#define ES_INIT_GPIO_C_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_2_IRQ_EN
+#define ES_INIT_GPIO_C_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_3_IRQ_EN
+#define ES_INIT_GPIO_C_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_4_IRQ_EN
+#define ES_INIT_GPIO_C_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_5_IRQ_EN
+#define ES_INIT_GPIO_C_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_6_IRQ_EN
+#define ES_INIT_GPIO_C_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_7_IRQ_EN
+#define ES_INIT_GPIO_C_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_8_IRQ_EN
+#define ES_INIT_GPIO_C_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_9_IRQ_EN
+#define ES_INIT_GPIO_C_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_10_IRQ_EN
+#define ES_INIT_GPIO_C_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_11_IRQ_EN
+#define ES_INIT_GPIO_C_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_12_IRQ_EN
+#define ES_INIT_GPIO_C_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_13_IRQ_EN
+#define ES_INIT_GPIO_C_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_14_IRQ_EN
+#define ES_INIT_GPIO_C_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_C_15_IRQ_EN
+#define ES_INIT_GPIO_C_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_0_IRQ_EN
+#define ES_INIT_GPIO_D_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_1_IRQ_EN
+#define ES_INIT_GPIO_D_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_2_IRQ_EN
+#define ES_INIT_GPIO_D_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_3_IRQ_EN
+#define ES_INIT_GPIO_D_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_4_IRQ_EN
+#define ES_INIT_GPIO_D_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_5_IRQ_EN
+#define ES_INIT_GPIO_D_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_6_IRQ_EN
+#define ES_INIT_GPIO_D_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_7_IRQ_EN
+#define ES_INIT_GPIO_D_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_8_IRQ_EN
+#define ES_INIT_GPIO_D_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_9_IRQ_EN
+#define ES_INIT_GPIO_D_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_10_IRQ_EN
+#define ES_INIT_GPIO_D_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_11_IRQ_EN
+#define ES_INIT_GPIO_D_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_12_IRQ_EN
+#define ES_INIT_GPIO_D_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_13_IRQ_EN
+#define ES_INIT_GPIO_D_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_14_IRQ_EN
+#define ES_INIT_GPIO_D_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_D_15_IRQ_EN
+#define ES_INIT_GPIO_D_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_0_IRQ_EN
+#define ES_INIT_GPIO_E_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_1_IRQ_EN
+#define ES_INIT_GPIO_E_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_2_IRQ_EN
+#define ES_INIT_GPIO_E_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_3_IRQ_EN
+#define ES_INIT_GPIO_E_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_4_IRQ_EN
+#define ES_INIT_GPIO_E_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_5_IRQ_EN
+#define ES_INIT_GPIO_E_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_6_IRQ_EN
+#define ES_INIT_GPIO_E_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_7_IRQ_EN
+#define ES_INIT_GPIO_E_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_8_IRQ_EN
+#define ES_INIT_GPIO_E_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_9_IRQ_EN
+#define ES_INIT_GPIO_E_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_10_IRQ_EN
+#define ES_INIT_GPIO_E_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_11_IRQ_EN
+#define ES_INIT_GPIO_E_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_12_IRQ_EN
+#define ES_INIT_GPIO_E_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_13_IRQ_EN
+#define ES_INIT_GPIO_E_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_14_IRQ_EN
+#define ES_INIT_GPIO_E_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_E_15_IRQ_EN
+#define ES_INIT_GPIO_E_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_0_IRQ_EN
+#define ES_INIT_GPIO_F_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_1_IRQ_EN
+#define ES_INIT_GPIO_F_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_2_IRQ_EN
+#define ES_INIT_GPIO_F_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_3_IRQ_EN
+#define ES_INIT_GPIO_F_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_4_IRQ_EN
+#define ES_INIT_GPIO_F_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_5_IRQ_EN
+#define ES_INIT_GPIO_F_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_6_IRQ_EN
+#define ES_INIT_GPIO_F_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_7_IRQ_EN
+#define ES_INIT_GPIO_F_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_8_IRQ_EN
+#define ES_INIT_GPIO_F_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_9_IRQ_EN
+#define ES_INIT_GPIO_F_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_10_IRQ_EN
+#define ES_INIT_GPIO_F_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_11_IRQ_EN
+#define ES_INIT_GPIO_F_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_12_IRQ_EN
+#define ES_INIT_GPIO_F_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_13_IRQ_EN
+#define ES_INIT_GPIO_F_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_14_IRQ_EN
+#define ES_INIT_GPIO_F_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_F_15_IRQ_EN
+#define ES_INIT_GPIO_F_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_0_IRQ_EN
+#define ES_INIT_GPIO_G_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_1_IRQ_EN
+#define ES_INIT_GPIO_G_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_2_IRQ_EN
+#define ES_INIT_GPIO_G_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_3_IRQ_EN
+#define ES_INIT_GPIO_G_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_4_IRQ_EN
+#define ES_INIT_GPIO_G_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_5_IRQ_EN
+#define ES_INIT_GPIO_G_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_6_IRQ_EN
+#define ES_INIT_GPIO_G_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_7_IRQ_EN
+#define ES_INIT_GPIO_G_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_8_IRQ_EN
+#define ES_INIT_GPIO_G_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_9_IRQ_EN
+#define ES_INIT_GPIO_G_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_10_IRQ_EN
+#define ES_INIT_GPIO_G_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_11_IRQ_EN
+#define ES_INIT_GPIO_G_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_12_IRQ_EN
+#define ES_INIT_GPIO_G_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_13_IRQ_EN
+#define ES_INIT_GPIO_G_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_14_IRQ_EN
+#define ES_INIT_GPIO_G_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_G_15_IRQ_EN
+#define ES_INIT_GPIO_G_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_0_IRQ_EN
+#define ES_INIT_GPIO_H_0_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_1_IRQ_EN
+#define ES_INIT_GPIO_H_1_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_2_IRQ_EN
+#define ES_INIT_GPIO_H_2_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_3_IRQ_EN
+#define ES_INIT_GPIO_H_3_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_4_IRQ_EN
+#define ES_INIT_GPIO_H_4_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_5_IRQ_EN
+#define ES_INIT_GPIO_H_5_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_6_IRQ_EN
+#define ES_INIT_GPIO_H_6_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_7_IRQ_EN
+#define ES_INIT_GPIO_H_7_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_8_IRQ_EN
+#define ES_INIT_GPIO_H_8_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_9_IRQ_EN
+#define ES_INIT_GPIO_H_9_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_10_IRQ_EN
+#define ES_INIT_GPIO_H_10_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_11_IRQ_EN
+#define ES_INIT_GPIO_H_11_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_12_IRQ_EN
+#define ES_INIT_GPIO_H_12_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_13_IRQ_EN
+#define ES_INIT_GPIO_H_13_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_14_IRQ_EN
+#define ES_INIT_GPIO_H_14_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#ifndef ES_INIT_GPIO_H_15_IRQ_EN
+#define ES_INIT_GPIO_H_15_IRQ_EN ES_C_GPIO_IRQ_DISABLE
+#endif
+
+#endif //11111
+
+
+
+/*是否需要 GPIO外部中断回调函数 (控制函数本体+声明)*/
+#if 11111
+
+#if (ES_INIT_GPIO_A_0_IRQ_EN)||(ES_INIT_GPIO_B_0_IRQ_EN)||(ES_INIT_GPIO_C_0_IRQ_EN)||(ES_INIT_GPIO_D_0_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_0_IRQ_EN)||(ES_INIT_GPIO_F_0_IRQ_EN)||(ES_INIT_GPIO_G_0_IRQ_EN)||(ES_INIT_GPIO_H_0_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_0
+#endif
+
+#if (ES_INIT_GPIO_A_1_IRQ_EN)||(ES_INIT_GPIO_B_1_IRQ_EN)||(ES_INIT_GPIO_C_1_IRQ_EN)||(ES_INIT_GPIO_D_1_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_1_IRQ_EN)||(ES_INIT_GPIO_F_1_IRQ_EN)||(ES_INIT_GPIO_G_1_IRQ_EN)||(ES_INIT_GPIO_H_1_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_1
+#endif
+
+#if (ES_INIT_GPIO_A_2_IRQ_EN)||(ES_INIT_GPIO_B_2_IRQ_EN)||(ES_INIT_GPIO_C_2_IRQ_EN)||(ES_INIT_GPIO_D_2_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_2_IRQ_EN)||(ES_INIT_GPIO_F_2_IRQ_EN)||(ES_INIT_GPIO_G_2_IRQ_EN)||(ES_INIT_GPIO_H_2_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_2
+#endif
+
+#if (ES_INIT_GPIO_A_3_IRQ_EN)||(ES_INIT_GPIO_B_3_IRQ_EN)||(ES_INIT_GPIO_C_3_IRQ_EN)||(ES_INIT_GPIO_D_3_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_3_IRQ_EN)||(ES_INIT_GPIO_F_3_IRQ_EN)||(ES_INIT_GPIO_G_3_IRQ_EN)||(ES_INIT_GPIO_H_3_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_3
+#endif
+
+#if (ES_INIT_GPIO_A_4_IRQ_EN)||(ES_INIT_GPIO_B_4_IRQ_EN)||(ES_INIT_GPIO_C_4_IRQ_EN)||(ES_INIT_GPIO_D_4_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_4_IRQ_EN)||(ES_INIT_GPIO_F_4_IRQ_EN)||(ES_INIT_GPIO_G_4_IRQ_EN)||(ES_INIT_GPIO_H_4_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_4
+#endif
+
+#if (ES_INIT_GPIO_A_5_IRQ_EN)||(ES_INIT_GPIO_B_5_IRQ_EN)||(ES_INIT_GPIO_C_5_IRQ_EN)||(ES_INIT_GPIO_D_5_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_5_IRQ_EN)||(ES_INIT_GPIO_F_5_IRQ_EN)||(ES_INIT_GPIO_G_5_IRQ_EN)||(ES_INIT_GPIO_H_5_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_5
+#endif
+
+#if (ES_INIT_GPIO_A_6_IRQ_EN)||(ES_INIT_GPIO_B_6_IRQ_EN)||(ES_INIT_GPIO_C_6_IRQ_EN)||(ES_INIT_GPIO_D_6_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_6_IRQ_EN)||(ES_INIT_GPIO_F_6_IRQ_EN)||(ES_INIT_GPIO_G_6_IRQ_EN)||(ES_INIT_GPIO_H_6_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_6
+#endif
+
+#if (ES_INIT_GPIO_A_7_IRQ_EN)||(ES_INIT_GPIO_B_7_IRQ_EN)||(ES_INIT_GPIO_C_7_IRQ_EN)||(ES_INIT_GPIO_D_7_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_7_IRQ_EN)||(ES_INIT_GPIO_F_7_IRQ_EN)||(ES_INIT_GPIO_G_7_IRQ_EN)||(ES_INIT_GPIO_H_7_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_7
+#endif
+
+#if (ES_INIT_GPIO_A_8_IRQ_EN)||(ES_INIT_GPIO_B_8_IRQ_EN)||(ES_INIT_GPIO_C_8_IRQ_EN)||(ES_INIT_GPIO_D_8_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_8_IRQ_EN)||(ES_INIT_GPIO_F_8_IRQ_EN)||(ES_INIT_GPIO_G_8_IRQ_EN)||(ES_INIT_GPIO_H_8_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_8
+#endif
+
+#if (ES_INIT_GPIO_A_9_IRQ_EN)||(ES_INIT_GPIO_B_9_IRQ_EN)||(ES_INIT_GPIO_C_9_IRQ_EN)||(ES_INIT_GPIO_D_9_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_9_IRQ_EN)||(ES_INIT_GPIO_F_9_IRQ_EN)||(ES_INIT_GPIO_G_9_IRQ_EN)||(ES_INIT_GPIO_H_9_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_9
+#endif
+
+#if (ES_INIT_GPIO_A_10_IRQ_EN)||(ES_INIT_GPIO_B_10_IRQ_EN)||(ES_INIT_GPIO_C_10_IRQ_EN)||(ES_INIT_GPIO_D_10_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_10_IRQ_EN)||(ES_INIT_GPIO_F_10_IRQ_EN)||(ES_INIT_GPIO_G_10_IRQ_EN)||(ES_INIT_GPIO_H_10_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_10
+#endif
+
+#if (ES_INIT_GPIO_A_11_IRQ_EN)||(ES_INIT_GPIO_B_11_IRQ_EN)||(ES_INIT_GPIO_C_11_IRQ_EN)||(ES_INIT_GPIO_D_11_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_11_IRQ_EN)||(ES_INIT_GPIO_F_11_IRQ_EN)||(ES_INIT_GPIO_G_11_IRQ_EN)||(ES_INIT_GPIO_H_11_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_11
+#endif
+
+#if (ES_INIT_GPIO_A_12_IRQ_EN)||(ES_INIT_GPIO_B_12_IRQ_EN)||(ES_INIT_GPIO_C_12_IRQ_EN)||(ES_INIT_GPIO_D_12_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_12_IRQ_EN)||(ES_INIT_GPIO_F_12_IRQ_EN)||(ES_INIT_GPIO_G_12_IRQ_EN)||(ES_INIT_GPIO_H_12_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_12
+#endif
+
+#if (ES_INIT_GPIO_A_13_IRQ_EN)||(ES_INIT_GPIO_B_13_IRQ_EN)||(ES_INIT_GPIO_C_13_IRQ_EN)||(ES_INIT_GPIO_D_13_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_13_IRQ_EN)||(ES_INIT_GPIO_F_13_IRQ_EN)||(ES_INIT_GPIO_G_13_IRQ_EN)||(ES_INIT_GPIO_H_13_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_13
+#endif
+
+#if (ES_INIT_GPIO_A_14_IRQ_EN)||(ES_INIT_GPIO_B_14_IRQ_EN)||(ES_INIT_GPIO_C_14_IRQ_EN)||(ES_INIT_GPIO_D_14_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_14_IRQ_EN)||(ES_INIT_GPIO_F_14_IRQ_EN)||(ES_INIT_GPIO_G_14_IRQ_EN)||(ES_INIT_GPIO_H_14_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_14
+#endif
+
+#if (ES_INIT_GPIO_A_15_IRQ_EN)||(ES_INIT_GPIO_B_15_IRQ_EN)||(ES_INIT_GPIO_C_15_IRQ_EN)||(ES_INIT_GPIO_D_15_IRQ_EN)|| \
+ (ES_INIT_GPIO_E_15_IRQ_EN)||(ES_INIT_GPIO_F_15_IRQ_EN)||(ES_INIT_GPIO_G_15_IRQ_EN)||(ES_INIT_GPIO_H_15_IRQ_EN)
+#define ES_CONF_EXTI_IRQ_15
+#endif
+
+#endif //11111
+
+
+/*GPIO外部中断 声明*/
+#if 11111
+
+#ifdef ES_CONF_EXTI_IRQ_0
+void irq_pin0_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_1
+void irq_pin1_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_2
+void irq_pin2_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_3
+void irq_pin3_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_4
+void irq_pin4_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_5
+void irq_pin5_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_6
+void irq_pin6_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_7
+void irq_pin7_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_8
+void irq_pin8_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_9
+void irq_pin9_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_10
+void irq_pin10_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_11
+void irq_pin11_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_12
+void irq_pin12_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_13
+void irq_pin13_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_14
+void irq_pin14_callback(void* arg);
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_15
+void irq_pin15_callback(void* arg);
+#endif
+
+
+#endif //11111
+
+
+
+
+/*是否有配置的管脚*/
+#if defined(ES_INIT_PIN_GPIO_A_0) || defined(ES_INIT_PIN_GPIO_A_1) || defined(ES_INIT_PIN_GPIO_A_2) || defined(ES_INIT_PIN_GPIO_A_3) || \
+ defined(ES_INIT_PIN_GPIO_A_4) || defined(ES_INIT_PIN_GPIO_A_5) || defined(ES_INIT_PIN_GPIO_A_6) || defined(ES_INIT_PIN_GPIO_A_7) || \
+ defined(ES_INIT_PIN_GPIO_A_8) || defined(ES_INIT_PIN_GPIO_A_9) || defined(ES_INIT_PIN_GPIO_A_10) || defined(ES_INIT_PIN_GPIO_A_11) || \
+ defined(ES_INIT_PIN_GPIO_A_12) || defined(ES_INIT_PIN_GPIO_A_13) || defined(ES_INIT_PIN_GPIO_A_14) || defined(ES_INIT_PIN_GPIO_A_15) || \
+ defined(ES_INIT_PIN_GPIO_B_0) || defined(ES_INIT_PIN_GPIO_B_1) || defined(ES_INIT_PIN_GPIO_B_2) || defined(ES_INIT_PIN_GPIO_B_3) || \
+ defined(ES_INIT_PIN_GPIO_B_4) || defined(ES_INIT_PIN_GPIO_B_5) || defined(ES_INIT_PIN_GPIO_B_6) || defined(ES_INIT_PIN_GPIO_B_7) || \
+ defined(ES_INIT_PIN_GPIO_B_8) || defined(ES_INIT_PIN_GPIO_B_9) || defined(ES_INIT_PIN_GPIO_B_10) || defined(ES_INIT_PIN_GPIO_B_11) || \
+ defined(ES_INIT_PIN_GPIO_B_12) || defined(ES_INIT_PIN_GPIO_B_13) || defined(ES_INIT_PIN_GPIO_B_14) || defined(ES_INIT_PIN_GPIO_B_15) || \
+ defined(ES_INIT_PIN_GPIO_C_0) || defined(ES_INIT_PIN_GPIO_C_1) || defined(ES_INIT_PIN_GPIO_C_2) || defined(ES_INIT_PIN_GPIO_C_3) || \
+ defined(ES_INIT_PIN_GPIO_C_4) || defined(ES_INIT_PIN_GPIO_C_5) || defined(ES_INIT_PIN_GPIO_C_6) || defined(ES_INIT_PIN_GPIO_C_7) || \
+ defined(ES_INIT_PIN_GPIO_C_8) || defined(ES_INIT_PIN_GPIO_C_9) || defined(ES_INIT_PIN_GPIO_C_10) || defined(ES_INIT_PIN_GPIO_C_11) || \
+ defined(ES_INIT_PIN_GPIO_C_12) || defined(ES_INIT_PIN_GPIO_C_13) || defined(ES_INIT_PIN_GPIO_C_14) || defined(ES_INIT_PIN_GPIO_C_15) || \
+ defined(ES_INIT_PIN_GPIO_D_0) || defined(ES_INIT_PIN_GPIO_D_1) || defined(ES_INIT_PIN_GPIO_D_2) || defined(ES_INIT_PIN_GPIO_D_3) || \
+ defined(ES_INIT_PIN_GPIO_D_4) || defined(ES_INIT_PIN_GPIO_D_5) || defined(ES_INIT_PIN_GPIO_D_6) || defined(ES_INIT_PIN_GPIO_D_7) || \
+ defined(ES_INIT_PIN_GPIO_D_8) || defined(ES_INIT_PIN_GPIO_D_9) || defined(ES_INIT_PIN_GPIO_D_10) || defined(ES_INIT_PIN_GPIO_D_11) || \
+ defined(ES_INIT_PIN_GPIO_D_12) || defined(ES_INIT_PIN_GPIO_D_13) || defined(ES_INIT_PIN_GPIO_D_14) || defined(ES_INIT_PIN_GPIO_D_15) || \
+ defined(ES_INIT_PIN_GPIO_E_0) || defined(ES_INIT_PIN_GPIO_E_1) || defined(ES_INIT_PIN_GPIO_E_2) || defined(ES_INIT_PIN_GPIO_E_3) || \
+ defined(ES_INIT_PIN_GPIO_E_4) || defined(ES_INIT_PIN_GPIO_E_5) || defined(ES_INIT_PIN_GPIO_E_6) || defined(ES_INIT_PIN_GPIO_E_7) || \
+ defined(ES_INIT_PIN_GPIO_E_8) || defined(ES_INIT_PIN_GPIO_E_9) || defined(ES_INIT_PIN_GPIO_E_10) || defined(ES_INIT_PIN_GPIO_E_11) || \
+ defined(ES_INIT_PIN_GPIO_E_12) || defined(ES_INIT_PIN_GPIO_E_13) || defined(ES_INIT_PIN_GPIO_E_14) || defined(ES_INIT_PIN_GPIO_E_15) || \
+ defined(ES_INIT_PIN_GPIO_F_0) || defined(ES_INIT_PIN_GPIO_F_1) || defined(ES_INIT_PIN_GPIO_F_2) || defined(ES_INIT_PIN_GPIO_F_3) || \
+ defined(ES_INIT_PIN_GPIO_F_4) || defined(ES_INIT_PIN_GPIO_F_5) || defined(ES_INIT_PIN_GPIO_F_6) || defined(ES_INIT_PIN_GPIO_F_7) || \
+ defined(ES_INIT_PIN_GPIO_F_8) || defined(ES_INIT_PIN_GPIO_F_9) || defined(ES_INIT_PIN_GPIO_F_10) || defined(ES_INIT_PIN_GPIO_F_11) || \
+ defined(ES_INIT_PIN_GPIO_F_12) || defined(ES_INIT_PIN_GPIO_F_13) || defined(ES_INIT_PIN_GPIO_F_14) || defined(ES_INIT_PIN_GPIO_F_15) || \
+ defined(ES_INIT_PIN_GPIO_G_0) || defined(ES_INIT_PIN_GPIO_G_1) || defined(ES_INIT_PIN_GPIO_G_2) || defined(ES_INIT_PIN_GPIO_G_3) || \
+ defined(ES_INIT_PIN_GPIO_G_4) || defined(ES_INIT_PIN_GPIO_G_5) || defined(ES_INIT_PIN_GPIO_G_6) || defined(ES_INIT_PIN_GPIO_G_7) || \
+ defined(ES_INIT_PIN_GPIO_G_8) || defined(ES_INIT_PIN_GPIO_G_9) || defined(ES_INIT_PIN_GPIO_G_10) || defined(ES_INIT_PIN_GPIO_G_11) || \
+ defined(ES_INIT_PIN_GPIO_G_12) || defined(ES_INIT_PIN_GPIO_G_13) || defined(ES_INIT_PIN_GPIO_G_14) || defined(ES_INIT_PIN_GPIO_G_15) || \
+ defined(ES_INIT_PIN_GPIO_H_0) || defined(ES_INIT_PIN_GPIO_H_1) || defined(ES_INIT_PIN_GPIO_H_2) || defined(ES_INIT_PIN_GPIO_H_3) || \
+ defined(ES_INIT_PIN_GPIO_H_4) || defined(ES_INIT_PIN_GPIO_H_5) || defined(ES_INIT_PIN_GPIO_H_6) || defined(ES_INIT_PIN_GPIO_H_7) || \
+ defined(ES_INIT_PIN_GPIO_H_8) || defined(ES_INIT_PIN_GPIO_H_9) || defined(ES_INIT_PIN_GPIO_H_10) || defined(ES_INIT_PIN_GPIO_H_11) || \
+ defined(ES_INIT_PIN_GPIO_H_12) || defined(ES_INIT_PIN_GPIO_H_13) || defined(ES_INIT_PIN_GPIO_H_14) || defined(ES_INIT_PIN_GPIO_H_15)
+
+#define ES_INIT_GPIOS
+
+#endif
+
+
+#ifdef ES_INIT_GPIOS
+
+static gpio_conf_t gpio_conf_all[] =
+{
+
+#ifdef ES_INIT_PIN_GPIO_A_0
+
+ {
+ ES_PIN_GPIO_A_0 ,
+
+#ifdef ES_INIT_GPIO_A_0_MODE
+ ES_INIT_GPIO_A_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_0_LEVEL
+ ES_INIT_GPIO_A_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_0_IRQ_MODE
+ ES_INIT_GPIO_A_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_1
+
+ {
+ ES_PIN_GPIO_A_1 ,
+
+#ifdef ES_INIT_GPIO_A_1_MODE
+ ES_INIT_GPIO_A_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_1_LEVEL
+ ES_INIT_GPIO_A_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_1_IRQ_MODE
+ ES_INIT_GPIO_A_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_2
+
+ {
+ ES_PIN_GPIO_A_2 ,
+
+#ifdef ES_INIT_GPIO_A_2_MODE
+ ES_INIT_GPIO_A_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_2_LEVEL
+ ES_INIT_GPIO_A_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_2_IRQ_MODE
+ ES_INIT_GPIO_A_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_3
+
+ {
+ ES_PIN_GPIO_A_3 ,
+
+#ifdef ES_INIT_GPIO_A_3_MODE
+ ES_INIT_GPIO_A_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_3_LEVEL
+ ES_INIT_GPIO_A_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_3_IRQ_MODE
+ ES_INIT_GPIO_A_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_4
+
+ {
+ ES_PIN_GPIO_A_4 ,
+
+#ifdef ES_INIT_GPIO_A_4_MODE
+ ES_INIT_GPIO_A_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_4_LEVEL
+ ES_INIT_GPIO_A_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_4_IRQ_MODE
+ ES_INIT_GPIO_A_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_5
+
+ {
+ ES_PIN_GPIO_A_5 ,
+
+#ifdef ES_INIT_GPIO_A_5_MODE
+ ES_INIT_GPIO_A_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_5_LEVEL
+ ES_INIT_GPIO_A_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_5_IRQ_MODE
+ ES_INIT_GPIO_A_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_6
+
+ {
+ ES_PIN_GPIO_A_6 ,
+
+#ifdef ES_INIT_GPIO_A_6_MODE
+ ES_INIT_GPIO_A_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_6_LEVEL
+ ES_INIT_GPIO_A_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_6_IRQ_MODE
+ ES_INIT_GPIO_A_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_7
+
+ {
+ ES_PIN_GPIO_A_7 ,
+
+#ifdef ES_INIT_GPIO_A_7_MODE
+ ES_INIT_GPIO_A_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_7_LEVEL
+ ES_INIT_GPIO_A_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_7_IRQ_MODE
+ ES_INIT_GPIO_A_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_8
+
+ {
+ ES_PIN_GPIO_A_8 ,
+
+#ifdef ES_INIT_GPIO_A_8_MODE
+ ES_INIT_GPIO_A_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_8_LEVEL
+ ES_INIT_GPIO_A_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_8_IRQ_MODE
+ ES_INIT_GPIO_A_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_9
+
+ {
+ ES_PIN_GPIO_A_9 ,
+
+#ifdef ES_INIT_GPIO_A_9_MODE
+ ES_INIT_GPIO_A_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_9_LEVEL
+ ES_INIT_GPIO_A_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_9_IRQ_MODE
+ ES_INIT_GPIO_A_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_10
+
+ {
+ ES_PIN_GPIO_A_10 ,
+
+#ifdef ES_INIT_GPIO_A_10_MODE
+ ES_INIT_GPIO_A_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_10_LEVEL
+ ES_INIT_GPIO_A_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_10_IRQ_MODE
+ ES_INIT_GPIO_A_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_11
+
+ {
+ ES_PIN_GPIO_A_11 ,
+
+#ifdef ES_INIT_GPIO_A_11_MODE
+ ES_INIT_GPIO_A_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_11_LEVEL
+ ES_INIT_GPIO_A_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_11_IRQ_MODE
+ ES_INIT_GPIO_A_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_12
+
+ {
+ ES_PIN_GPIO_A_12 ,
+
+#ifdef ES_INIT_GPIO_A_12_MODE
+ ES_INIT_GPIO_A_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_12_LEVEL
+ ES_INIT_GPIO_A_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_12_IRQ_MODE
+ ES_INIT_GPIO_A_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_13
+
+ {
+ ES_PIN_GPIO_A_13 ,
+
+#ifdef ES_INIT_GPIO_A_13_MODE
+ ES_INIT_GPIO_A_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_13_LEVEL
+ ES_INIT_GPIO_A_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_13_IRQ_MODE
+ ES_INIT_GPIO_A_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_14
+
+ {
+ ES_PIN_GPIO_A_14 ,
+
+#ifdef ES_INIT_GPIO_A_14_MODE
+ ES_INIT_GPIO_A_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_14_LEVEL
+ ES_INIT_GPIO_A_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_14_IRQ_MODE
+ ES_INIT_GPIO_A_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_A_15
+
+ {
+ ES_PIN_GPIO_A_15 ,
+
+#ifdef ES_INIT_GPIO_A_15_MODE
+ ES_INIT_GPIO_A_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_A_15_LEVEL
+ ES_INIT_GPIO_A_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_A_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_A_15_IRQ_MODE
+ ES_INIT_GPIO_A_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_A_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_0
+
+ {
+ ES_PIN_GPIO_B_0 ,
+
+#ifdef ES_INIT_GPIO_B_0_MODE
+ ES_INIT_GPIO_B_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_0_LEVEL
+ ES_INIT_GPIO_B_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_0_IRQ_MODE
+ ES_INIT_GPIO_B_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_1
+
+ {
+ ES_PIN_GPIO_B_1 ,
+
+#ifdef ES_INIT_GPIO_B_1_MODE
+ ES_INIT_GPIO_B_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_1_LEVEL
+ ES_INIT_GPIO_B_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_1_IRQ_MODE
+ ES_INIT_GPIO_B_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_2
+
+ {
+ ES_PIN_GPIO_B_2 ,
+
+#ifdef ES_INIT_GPIO_B_2_MODE
+ ES_INIT_GPIO_B_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_2_LEVEL
+ ES_INIT_GPIO_B_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_2_IRQ_MODE
+ ES_INIT_GPIO_B_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_3
+
+ {
+ ES_PIN_GPIO_B_3 ,
+
+#ifdef ES_INIT_GPIO_B_3_MODE
+ ES_INIT_GPIO_B_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_3_LEVEL
+ ES_INIT_GPIO_B_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_3_IRQ_MODE
+ ES_INIT_GPIO_B_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_4
+
+ {
+ ES_PIN_GPIO_B_4 ,
+
+#ifdef ES_INIT_GPIO_B_4_MODE
+ ES_INIT_GPIO_B_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_4_LEVEL
+ ES_INIT_GPIO_B_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_4_IRQ_MODE
+ ES_INIT_GPIO_B_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_5
+
+ {
+ ES_PIN_GPIO_B_5 ,
+
+#ifdef ES_INIT_GPIO_B_5_MODE
+ ES_INIT_GPIO_B_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_5_LEVEL
+ ES_INIT_GPIO_B_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_5_IRQ_MODE
+ ES_INIT_GPIO_B_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_6
+
+ {
+ ES_PIN_GPIO_B_6 ,
+
+#ifdef ES_INIT_GPIO_B_6_MODE
+ ES_INIT_GPIO_B_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_6_LEVEL
+ ES_INIT_GPIO_B_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_6_IRQ_MODE
+ ES_INIT_GPIO_B_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_7
+
+ {
+ ES_PIN_GPIO_B_7 ,
+
+#ifdef ES_INIT_GPIO_B_7_MODE
+ ES_INIT_GPIO_B_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_7_LEVEL
+ ES_INIT_GPIO_B_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_7_IRQ_MODE
+ ES_INIT_GPIO_B_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_8
+
+ {
+ ES_PIN_GPIO_B_8 ,
+
+#ifdef ES_INIT_GPIO_B_8_MODE
+ ES_INIT_GPIO_B_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_8_LEVEL
+ ES_INIT_GPIO_B_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_8_IRQ_MODE
+ ES_INIT_GPIO_B_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_9
+
+ {
+ ES_PIN_GPIO_B_9 ,
+
+#ifdef ES_INIT_GPIO_B_9_MODE
+ ES_INIT_GPIO_B_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_9_LEVEL
+ ES_INIT_GPIO_B_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_9_IRQ_MODE
+ ES_INIT_GPIO_B_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_10
+
+ {
+ ES_PIN_GPIO_B_10 ,
+
+#ifdef ES_INIT_GPIO_B_10_MODE
+ ES_INIT_GPIO_B_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_10_LEVEL
+ ES_INIT_GPIO_B_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_10_IRQ_MODE
+ ES_INIT_GPIO_B_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_11
+
+ {
+ ES_PIN_GPIO_B_11 ,
+
+#ifdef ES_INIT_GPIO_B_11_MODE
+ ES_INIT_GPIO_B_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_11_LEVEL
+ ES_INIT_GPIO_B_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_11_IRQ_MODE
+ ES_INIT_GPIO_B_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_12
+
+ {
+ ES_PIN_GPIO_B_12 ,
+
+#ifdef ES_INIT_GPIO_B_12_MODE
+ ES_INIT_GPIO_B_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_12_LEVEL
+ ES_INIT_GPIO_B_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_12_IRQ_MODE
+ ES_INIT_GPIO_B_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_13
+
+ {
+ ES_PIN_GPIO_B_13 ,
+
+#ifdef ES_INIT_GPIO_B_13_MODE
+ ES_INIT_GPIO_B_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_13_LEVEL
+ ES_INIT_GPIO_B_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_13_IRQ_MODE
+ ES_INIT_GPIO_B_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_14
+
+ {
+ ES_PIN_GPIO_B_14 ,
+
+#ifdef ES_INIT_GPIO_B_14_MODE
+ ES_INIT_GPIO_B_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_14_LEVEL
+ ES_INIT_GPIO_B_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_14_IRQ_MODE
+ ES_INIT_GPIO_B_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_B_15
+
+ {
+ ES_PIN_GPIO_B_15 ,
+
+#ifdef ES_INIT_GPIO_B_15_MODE
+ ES_INIT_GPIO_B_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_B_15_LEVEL
+ ES_INIT_GPIO_B_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_B_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_B_15_IRQ_MODE
+ ES_INIT_GPIO_B_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_B_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_0
+
+ {
+ ES_PIN_GPIO_C_0 ,
+
+#ifdef ES_INIT_GPIO_C_0_MODE
+ ES_INIT_GPIO_C_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_0_LEVEL
+ ES_INIT_GPIO_C_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_0_IRQ_MODE
+ ES_INIT_GPIO_C_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_1
+
+ {
+ ES_PIN_GPIO_C_1 ,
+
+#ifdef ES_INIT_GPIO_C_1_MODE
+ ES_INIT_GPIO_C_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_1_LEVEL
+ ES_INIT_GPIO_C_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_1_IRQ_MODE
+ ES_INIT_GPIO_C_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_2
+
+ {
+ ES_PIN_GPIO_C_2 ,
+
+#ifdef ES_INIT_GPIO_C_2_MODE
+ ES_INIT_GPIO_C_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_2_LEVEL
+ ES_INIT_GPIO_C_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_2_IRQ_MODE
+ ES_INIT_GPIO_C_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_3
+
+ {
+ ES_PIN_GPIO_C_3 ,
+
+#ifdef ES_INIT_GPIO_C_3_MODE
+ ES_INIT_GPIO_C_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_3_LEVEL
+ ES_INIT_GPIO_C_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_3_IRQ_MODE
+ ES_INIT_GPIO_C_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_4
+
+ {
+ ES_PIN_GPIO_C_4 ,
+
+#ifdef ES_INIT_GPIO_C_4_MODE
+ ES_INIT_GPIO_C_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_4_LEVEL
+ ES_INIT_GPIO_C_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_4_IRQ_MODE
+ ES_INIT_GPIO_C_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_5
+
+ {
+ ES_PIN_GPIO_C_5 ,
+
+#ifdef ES_INIT_GPIO_C_5_MODE
+ ES_INIT_GPIO_C_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_5_LEVEL
+ ES_INIT_GPIO_C_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_5_IRQ_MODE
+ ES_INIT_GPIO_C_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_6
+
+ {
+ ES_PIN_GPIO_C_6 ,
+
+#ifdef ES_INIT_GPIO_C_6_MODE
+ ES_INIT_GPIO_C_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_6_LEVEL
+ ES_INIT_GPIO_C_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_6_IRQ_MODE
+ ES_INIT_GPIO_C_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_7
+
+ {
+ ES_PIN_GPIO_C_7 ,
+
+#ifdef ES_INIT_GPIO_C_7_MODE
+ ES_INIT_GPIO_C_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_7_LEVEL
+ ES_INIT_GPIO_C_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_7_IRQ_MODE
+ ES_INIT_GPIO_C_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_8
+
+ {
+ ES_PIN_GPIO_C_8 ,
+
+#ifdef ES_INIT_GPIO_C_8_MODE
+ ES_INIT_GPIO_C_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_8_LEVEL
+ ES_INIT_GPIO_C_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_8_IRQ_MODE
+ ES_INIT_GPIO_C_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_9
+
+ {
+ ES_PIN_GPIO_C_9 ,
+
+#ifdef ES_INIT_GPIO_C_9_MODE
+ ES_INIT_GPIO_C_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_9_LEVEL
+ ES_INIT_GPIO_C_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_9_IRQ_MODE
+ ES_INIT_GPIO_C_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_10
+
+ {
+ ES_PIN_GPIO_C_10 ,
+
+#ifdef ES_INIT_GPIO_C_10_MODE
+ ES_INIT_GPIO_C_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_10_LEVEL
+ ES_INIT_GPIO_C_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_10_IRQ_MODE
+ ES_INIT_GPIO_C_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_11
+
+ {
+ ES_PIN_GPIO_C_11 ,
+
+#ifdef ES_INIT_GPIO_C_11_MODE
+ ES_INIT_GPIO_C_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_11_LEVEL
+ ES_INIT_GPIO_C_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_11_IRQ_MODE
+ ES_INIT_GPIO_C_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_12
+
+ {
+ ES_PIN_GPIO_C_12 ,
+
+#ifdef ES_INIT_GPIO_C_12_MODE
+ ES_INIT_GPIO_C_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_12_LEVEL
+ ES_INIT_GPIO_C_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_12_IRQ_MODE
+ ES_INIT_GPIO_C_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_13
+
+ {
+ ES_PIN_GPIO_C_13 ,
+
+#ifdef ES_INIT_GPIO_C_13_MODE
+ ES_INIT_GPIO_C_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_13_LEVEL
+ ES_INIT_GPIO_C_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_13_IRQ_MODE
+ ES_INIT_GPIO_C_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_14
+
+ {
+ ES_PIN_GPIO_C_14 ,
+
+#ifdef ES_INIT_GPIO_C_14_MODE
+ ES_INIT_GPIO_C_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_14_LEVEL
+ ES_INIT_GPIO_C_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_14_IRQ_MODE
+ ES_INIT_GPIO_C_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_C_15
+
+ {
+ ES_PIN_GPIO_C_15 ,
+
+#ifdef ES_INIT_GPIO_C_15_MODE
+ ES_INIT_GPIO_C_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_C_15_LEVEL
+ ES_INIT_GPIO_C_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_C_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_C_15_IRQ_MODE
+ ES_INIT_GPIO_C_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_C_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_0
+
+ {
+ ES_PIN_GPIO_D_0 ,
+
+#ifdef ES_INIT_GPIO_D_0_MODE
+ ES_INIT_GPIO_D_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_0_LEVEL
+ ES_INIT_GPIO_D_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_0_IRQ_MODE
+ ES_INIT_GPIO_D_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_1
+
+ {
+ ES_PIN_GPIO_D_1 ,
+
+#ifdef ES_INIT_GPIO_D_1_MODE
+ ES_INIT_GPIO_D_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_1_LEVEL
+ ES_INIT_GPIO_D_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_1_IRQ_MODE
+ ES_INIT_GPIO_D_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_2
+
+ {
+ ES_PIN_GPIO_D_2 ,
+
+#ifdef ES_INIT_GPIO_D_2_MODE
+ ES_INIT_GPIO_D_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_2_LEVEL
+ ES_INIT_GPIO_D_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_2_IRQ_MODE
+ ES_INIT_GPIO_D_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_3
+
+ {
+ ES_PIN_GPIO_D_3 ,
+
+#ifdef ES_INIT_GPIO_D_3_MODE
+ ES_INIT_GPIO_D_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_3_LEVEL
+ ES_INIT_GPIO_D_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_3_IRQ_MODE
+ ES_INIT_GPIO_D_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_4
+
+ {
+ ES_PIN_GPIO_D_4 ,
+
+#ifdef ES_INIT_GPIO_D_4_MODE
+ ES_INIT_GPIO_D_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_4_LEVEL
+ ES_INIT_GPIO_D_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_4_IRQ_MODE
+ ES_INIT_GPIO_D_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_5
+
+ {
+ ES_PIN_GPIO_D_5 ,
+
+#ifdef ES_INIT_GPIO_D_5_MODE
+ ES_INIT_GPIO_D_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_5_LEVEL
+ ES_INIT_GPIO_D_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_5_IRQ_MODE
+ ES_INIT_GPIO_D_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_6
+
+ {
+ ES_PIN_GPIO_D_6 ,
+
+#ifdef ES_INIT_GPIO_D_6_MODE
+ ES_INIT_GPIO_D_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_6_LEVEL
+ ES_INIT_GPIO_D_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_6_IRQ_MODE
+ ES_INIT_GPIO_D_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_7
+
+ {
+ ES_PIN_GPIO_D_7 ,
+
+#ifdef ES_INIT_GPIO_D_7_MODE
+ ES_INIT_GPIO_D_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_7_LEVEL
+ ES_INIT_GPIO_D_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_7_IRQ_MODE
+ ES_INIT_GPIO_D_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_8
+
+ {
+ ES_PIN_GPIO_D_8 ,
+
+#ifdef ES_INIT_GPIO_D_8_MODE
+ ES_INIT_GPIO_D_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_8_LEVEL
+ ES_INIT_GPIO_D_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_8_IRQ_MODE
+ ES_INIT_GPIO_D_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_9
+
+ {
+ ES_PIN_GPIO_D_9 ,
+
+#ifdef ES_INIT_GPIO_D_9_MODE
+ ES_INIT_GPIO_D_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_9_LEVEL
+ ES_INIT_GPIO_D_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_9_IRQ_MODE
+ ES_INIT_GPIO_D_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_10
+
+ {
+ ES_PIN_GPIO_D_10 ,
+
+#ifdef ES_INIT_GPIO_D_10_MODE
+ ES_INIT_GPIO_D_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_10_LEVEL
+ ES_INIT_GPIO_D_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_10_IRQ_MODE
+ ES_INIT_GPIO_D_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_11
+
+ {
+ ES_PIN_GPIO_D_11 ,
+
+#ifdef ES_INIT_GPIO_D_11_MODE
+ ES_INIT_GPIO_D_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_11_LEVEL
+ ES_INIT_GPIO_D_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_11_IRQ_MODE
+ ES_INIT_GPIO_D_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_12
+
+ {
+ ES_PIN_GPIO_D_12 ,
+
+#ifdef ES_INIT_GPIO_D_12_MODE
+ ES_INIT_GPIO_D_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_12_LEVEL
+ ES_INIT_GPIO_D_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_12_IRQ_MODE
+ ES_INIT_GPIO_D_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_13
+
+ {
+ ES_PIN_GPIO_D_13 ,
+
+#ifdef ES_INIT_GPIO_D_13_MODE
+ ES_INIT_GPIO_D_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_13_LEVEL
+ ES_INIT_GPIO_D_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_13_IRQ_MODE
+ ES_INIT_GPIO_D_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_14
+
+ {
+ ES_PIN_GPIO_D_14 ,
+
+#ifdef ES_INIT_GPIO_D_14_MODE
+ ES_INIT_GPIO_D_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_14_LEVEL
+ ES_INIT_GPIO_D_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_14_IRQ_MODE
+ ES_INIT_GPIO_D_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_D_15
+
+ {
+ ES_PIN_GPIO_D_15 ,
+
+#ifdef ES_INIT_GPIO_D_15_MODE
+ ES_INIT_GPIO_D_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_D_15_LEVEL
+ ES_INIT_GPIO_D_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_D_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_D_15_IRQ_MODE
+ ES_INIT_GPIO_D_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_D_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_0
+
+ {
+ ES_PIN_GPIO_E_0 ,
+
+#ifdef ES_INIT_GPIO_E_0_MODE
+ ES_INIT_GPIO_E_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_0_LEVEL
+ ES_INIT_GPIO_E_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_0_IRQ_MODE
+ ES_INIT_GPIO_E_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_1
+
+ {
+ ES_PIN_GPIO_E_1 ,
+
+#ifdef ES_INIT_GPIO_E_1_MODE
+ ES_INIT_GPIO_E_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_1_LEVEL
+ ES_INIT_GPIO_E_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_1_IRQ_MODE
+ ES_INIT_GPIO_E_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_2
+
+ {
+ ES_PIN_GPIO_E_2 ,
+
+#ifdef ES_INIT_GPIO_E_2_MODE
+ ES_INIT_GPIO_E_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_2_LEVEL
+ ES_INIT_GPIO_E_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_2_IRQ_MODE
+ ES_INIT_GPIO_E_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_3
+
+ {
+ ES_PIN_GPIO_E_3 ,
+
+#ifdef ES_INIT_GPIO_E_3_MODE
+ ES_INIT_GPIO_E_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_3_LEVEL
+ ES_INIT_GPIO_E_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_3_IRQ_MODE
+ ES_INIT_GPIO_E_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_4
+
+ {
+ ES_PIN_GPIO_E_4 ,
+
+#ifdef ES_INIT_GPIO_E_4_MODE
+ ES_INIT_GPIO_E_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_4_LEVEL
+ ES_INIT_GPIO_E_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_4_IRQ_MODE
+ ES_INIT_GPIO_E_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_5
+
+ {
+ ES_PIN_GPIO_E_5 ,
+
+#ifdef ES_INIT_GPIO_E_5_MODE
+ ES_INIT_GPIO_E_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_5_LEVEL
+ ES_INIT_GPIO_E_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_5_IRQ_MODE
+ ES_INIT_GPIO_E_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_6
+
+ {
+ ES_PIN_GPIO_E_6 ,
+
+#ifdef ES_INIT_GPIO_E_6_MODE
+ ES_INIT_GPIO_E_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_6_LEVEL
+ ES_INIT_GPIO_E_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_6_IRQ_MODE
+ ES_INIT_GPIO_E_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_7
+
+ {
+ ES_PIN_GPIO_E_7 ,
+
+#ifdef ES_INIT_GPIO_E_7_MODE
+ ES_INIT_GPIO_E_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_7_LEVEL
+ ES_INIT_GPIO_E_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_7_IRQ_MODE
+ ES_INIT_GPIO_E_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_8
+
+ {
+ ES_PIN_GPIO_E_8 ,
+
+#ifdef ES_INIT_GPIO_E_8_MODE
+ ES_INIT_GPIO_E_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_8_LEVEL
+ ES_INIT_GPIO_E_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_8_IRQ_MODE
+ ES_INIT_GPIO_E_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_9
+
+ {
+ ES_PIN_GPIO_E_9 ,
+
+#ifdef ES_INIT_GPIO_E_9_MODE
+ ES_INIT_GPIO_E_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_9_LEVEL
+ ES_INIT_GPIO_E_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_9_IRQ_MODE
+ ES_INIT_GPIO_E_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_10
+
+ {
+ ES_PIN_GPIO_E_10 ,
+
+#ifdef ES_INIT_GPIO_E_10_MODE
+ ES_INIT_GPIO_E_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_10_LEVEL
+ ES_INIT_GPIO_E_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_10_IRQ_MODE
+ ES_INIT_GPIO_E_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_11
+
+ {
+ ES_PIN_GPIO_E_11 ,
+
+#ifdef ES_INIT_GPIO_E_11_MODE
+ ES_INIT_GPIO_E_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_11_LEVEL
+ ES_INIT_GPIO_E_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_11_IRQ_MODE
+ ES_INIT_GPIO_E_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_12
+
+ {
+ ES_PIN_GPIO_E_12 ,
+
+#ifdef ES_INIT_GPIO_E_12_MODE
+ ES_INIT_GPIO_E_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_12_LEVEL
+ ES_INIT_GPIO_E_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_12_IRQ_MODE
+ ES_INIT_GPIO_E_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_13
+
+ {
+ ES_PIN_GPIO_E_13 ,
+
+#ifdef ES_INIT_GPIO_E_13_MODE
+ ES_INIT_GPIO_E_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_13_LEVEL
+ ES_INIT_GPIO_E_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_13_IRQ_MODE
+ ES_INIT_GPIO_E_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_14
+
+ {
+ ES_PIN_GPIO_E_14 ,
+
+#ifdef ES_INIT_GPIO_E_14_MODE
+ ES_INIT_GPIO_E_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_14_LEVEL
+ ES_INIT_GPIO_E_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_14_IRQ_MODE
+ ES_INIT_GPIO_E_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_E_15
+
+ {
+ ES_PIN_GPIO_E_15 ,
+
+#ifdef ES_INIT_GPIO_E_15_MODE
+ ES_INIT_GPIO_E_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_E_15_LEVEL
+ ES_INIT_GPIO_E_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_E_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_E_15_IRQ_MODE
+ ES_INIT_GPIO_E_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_E_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_0
+
+ {
+ ES_PIN_GPIO_F_0 ,
+
+#ifdef ES_INIT_GPIO_F_0_MODE
+ ES_INIT_GPIO_F_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_0_LEVEL
+ ES_INIT_GPIO_F_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_0_IRQ_MODE
+ ES_INIT_GPIO_F_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_1
+
+ {
+ ES_PIN_GPIO_F_1 ,
+
+#ifdef ES_INIT_GPIO_F_1_MODE
+ ES_INIT_GPIO_F_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_1_LEVEL
+ ES_INIT_GPIO_F_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_1_IRQ_MODE
+ ES_INIT_GPIO_F_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_2
+
+ {
+ ES_PIN_GPIO_F_2 ,
+
+#ifdef ES_INIT_GPIO_F_2_MODE
+ ES_INIT_GPIO_F_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_2_LEVEL
+ ES_INIT_GPIO_F_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_2_IRQ_MODE
+ ES_INIT_GPIO_F_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_3
+
+ {
+ ES_PIN_GPIO_F_3 ,
+
+#ifdef ES_INIT_GPIO_F_3_MODE
+ ES_INIT_GPIO_F_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_3_LEVEL
+ ES_INIT_GPIO_F_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_3_IRQ_MODE
+ ES_INIT_GPIO_F_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_4
+
+ {
+ ES_PIN_GPIO_F_4 ,
+
+#ifdef ES_INIT_GPIO_F_4_MODE
+ ES_INIT_GPIO_F_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_4_LEVEL
+ ES_INIT_GPIO_F_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_4_IRQ_MODE
+ ES_INIT_GPIO_F_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_5
+
+ {
+ ES_PIN_GPIO_F_5 ,
+
+#ifdef ES_INIT_GPIO_F_5_MODE
+ ES_INIT_GPIO_F_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_5_LEVEL
+ ES_INIT_GPIO_F_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_5_IRQ_MODE
+ ES_INIT_GPIO_F_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_6
+
+ {
+ ES_PIN_GPIO_F_6 ,
+
+#ifdef ES_INIT_GPIO_F_6_MODE
+ ES_INIT_GPIO_F_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_6_LEVEL
+ ES_INIT_GPIO_F_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_6_IRQ_MODE
+ ES_INIT_GPIO_F_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_7
+
+ {
+ ES_PIN_GPIO_F_7 ,
+
+#ifdef ES_INIT_GPIO_F_7_MODE
+ ES_INIT_GPIO_F_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_7_LEVEL
+ ES_INIT_GPIO_F_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_7_IRQ_MODE
+ ES_INIT_GPIO_F_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_8
+
+ {
+ ES_PIN_GPIO_F_8 ,
+
+#ifdef ES_INIT_GPIO_F_8_MODE
+ ES_INIT_GPIO_F_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_8_LEVEL
+ ES_INIT_GPIO_F_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_8_IRQ_MODE
+ ES_INIT_GPIO_F_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_9
+
+ {
+ ES_PIN_GPIO_F_9 ,
+
+#ifdef ES_INIT_GPIO_F_9_MODE
+ ES_INIT_GPIO_F_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_9_LEVEL
+ ES_INIT_GPIO_F_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_9_IRQ_MODE
+ ES_INIT_GPIO_F_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_10
+
+ {
+ ES_PIN_GPIO_F_10 ,
+
+#ifdef ES_INIT_GPIO_F_10_MODE
+ ES_INIT_GPIO_F_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_10_LEVEL
+ ES_INIT_GPIO_F_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_10_IRQ_MODE
+ ES_INIT_GPIO_F_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_11
+
+ {
+ ES_PIN_GPIO_F_11 ,
+
+#ifdef ES_INIT_GPIO_F_11_MODE
+ ES_INIT_GPIO_F_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_11_LEVEL
+ ES_INIT_GPIO_F_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_11_IRQ_MODE
+ ES_INIT_GPIO_F_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_12
+
+ {
+ ES_PIN_GPIO_F_12 ,
+
+#ifdef ES_INIT_GPIO_F_12_MODE
+ ES_INIT_GPIO_F_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_12_LEVEL
+ ES_INIT_GPIO_F_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_12_IRQ_MODE
+ ES_INIT_GPIO_F_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_13
+
+ {
+ ES_PIN_GPIO_F_13 ,
+
+#ifdef ES_INIT_GPIO_F_13_MODE
+ ES_INIT_GPIO_F_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_13_LEVEL
+ ES_INIT_GPIO_F_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_13_IRQ_MODE
+ ES_INIT_GPIO_F_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_14
+
+ {
+ ES_PIN_GPIO_F_14 ,
+
+#ifdef ES_INIT_GPIO_F_14_MODE
+ ES_INIT_GPIO_F_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_14_LEVEL
+ ES_INIT_GPIO_F_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_14_IRQ_MODE
+ ES_INIT_GPIO_F_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_F_15
+
+ {
+ ES_PIN_GPIO_F_15 ,
+
+#ifdef ES_INIT_GPIO_F_15_MODE
+ ES_INIT_GPIO_F_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_F_15_LEVEL
+ ES_INIT_GPIO_F_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_F_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_F_15_IRQ_MODE
+ ES_INIT_GPIO_F_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_F_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_0
+
+ {
+ ES_PIN_GPIO_G_0 ,
+
+#ifdef ES_INIT_GPIO_G_0_MODE
+ ES_INIT_GPIO_G_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_0_LEVEL
+ ES_INIT_GPIO_G_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_0_IRQ_MODE
+ ES_INIT_GPIO_G_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_1
+
+ {
+ ES_PIN_GPIO_G_1 ,
+
+#ifdef ES_INIT_GPIO_G_1_MODE
+ ES_INIT_GPIO_G_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_1_LEVEL
+ ES_INIT_GPIO_G_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_1_IRQ_MODE
+ ES_INIT_GPIO_G_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_2
+
+ {
+ ES_PIN_GPIO_G_2 ,
+
+#ifdef ES_INIT_GPIO_G_2_MODE
+ ES_INIT_GPIO_G_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_2_LEVEL
+ ES_INIT_GPIO_G_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_2_IRQ_MODE
+ ES_INIT_GPIO_G_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_3
+
+ {
+ ES_PIN_GPIO_G_3 ,
+
+#ifdef ES_INIT_GPIO_G_3_MODE
+ ES_INIT_GPIO_G_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_3_LEVEL
+ ES_INIT_GPIO_G_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_3_IRQ_MODE
+ ES_INIT_GPIO_G_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_4
+
+ {
+ ES_PIN_GPIO_G_4 ,
+
+#ifdef ES_INIT_GPIO_G_4_MODE
+ ES_INIT_GPIO_G_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_4_LEVEL
+ ES_INIT_GPIO_G_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_4_IRQ_MODE
+ ES_INIT_GPIO_G_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_5
+
+ {
+ ES_PIN_GPIO_G_5 ,
+
+#ifdef ES_INIT_GPIO_G_5_MODE
+ ES_INIT_GPIO_G_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_5_LEVEL
+ ES_INIT_GPIO_G_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_5_IRQ_MODE
+ ES_INIT_GPIO_G_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_6
+
+ {
+ ES_PIN_GPIO_G_6 ,
+
+#ifdef ES_INIT_GPIO_G_6_MODE
+ ES_INIT_GPIO_G_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_6_LEVEL
+ ES_INIT_GPIO_G_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_6_IRQ_MODE
+ ES_INIT_GPIO_G_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_7
+
+ {
+ ES_PIN_GPIO_G_7 ,
+
+#ifdef ES_INIT_GPIO_G_7_MODE
+ ES_INIT_GPIO_G_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_7_LEVEL
+ ES_INIT_GPIO_G_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_7_IRQ_MODE
+ ES_INIT_GPIO_G_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_8
+
+ {
+ ES_PIN_GPIO_G_8 ,
+
+#ifdef ES_INIT_GPIO_G_8_MODE
+ ES_INIT_GPIO_G_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_8_LEVEL
+ ES_INIT_GPIO_G_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_8_IRQ_MODE
+ ES_INIT_GPIO_G_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_9
+
+ {
+ ES_PIN_GPIO_G_9 ,
+
+#ifdef ES_INIT_GPIO_G_9_MODE
+ ES_INIT_GPIO_G_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_9_LEVEL
+ ES_INIT_GPIO_G_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_9_IRQ_MODE
+ ES_INIT_GPIO_G_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_10
+
+ {
+ ES_PIN_GPIO_G_10 ,
+
+#ifdef ES_INIT_GPIO_G_10_MODE
+ ES_INIT_GPIO_G_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_10_LEVEL
+ ES_INIT_GPIO_G_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_10_IRQ_MODE
+ ES_INIT_GPIO_G_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_11
+
+ {
+ ES_PIN_GPIO_G_11 ,
+
+#ifdef ES_INIT_GPIO_G_11_MODE
+ ES_INIT_GPIO_G_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_11_LEVEL
+ ES_INIT_GPIO_G_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_11_IRQ_MODE
+ ES_INIT_GPIO_G_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_12
+
+ {
+ ES_PIN_GPIO_G_12 ,
+
+#ifdef ES_INIT_GPIO_G_12_MODE
+ ES_INIT_GPIO_G_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_12_LEVEL
+ ES_INIT_GPIO_G_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_12_IRQ_MODE
+ ES_INIT_GPIO_G_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_13
+
+ {
+ ES_PIN_GPIO_G_13 ,
+
+#ifdef ES_INIT_GPIO_G_13_MODE
+ ES_INIT_GPIO_G_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_13_LEVEL
+ ES_INIT_GPIO_G_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_13_IRQ_MODE
+ ES_INIT_GPIO_G_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_14
+
+ {
+ ES_PIN_GPIO_G_14 ,
+
+#ifdef ES_INIT_GPIO_G_14_MODE
+ ES_INIT_GPIO_G_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_14_LEVEL
+ ES_INIT_GPIO_G_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_14_IRQ_MODE
+ ES_INIT_GPIO_G_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_G_15
+
+ {
+ ES_PIN_GPIO_G_15 ,
+
+#ifdef ES_INIT_GPIO_G_15_MODE
+ ES_INIT_GPIO_G_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_G_15_LEVEL
+ ES_INIT_GPIO_G_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_G_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_G_15_IRQ_MODE
+ ES_INIT_GPIO_G_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_G_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_0
+
+ {
+ ES_PIN_GPIO_H_0 ,
+
+#ifdef ES_INIT_GPIO_H_0_MODE
+ ES_INIT_GPIO_H_0_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_0_LEVEL
+ ES_INIT_GPIO_H_0_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_0_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_0_IRQ_MODE
+ ES_INIT_GPIO_H_0_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_0_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin0_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_1
+
+ {
+ ES_PIN_GPIO_H_1 ,
+
+#ifdef ES_INIT_GPIO_H_1_MODE
+ ES_INIT_GPIO_H_1_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_1_LEVEL
+ ES_INIT_GPIO_H_1_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_1_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_1_IRQ_MODE
+ ES_INIT_GPIO_H_1_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_1_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin1_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_2
+
+ {
+ ES_PIN_GPIO_H_2 ,
+
+#ifdef ES_INIT_GPIO_H_2_MODE
+ ES_INIT_GPIO_H_2_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_2_LEVEL
+ ES_INIT_GPIO_H_2_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_2_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_2_IRQ_MODE
+ ES_INIT_GPIO_H_2_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_2_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin2_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_3
+
+ {
+ ES_PIN_GPIO_H_3 ,
+
+#ifdef ES_INIT_GPIO_H_3_MODE
+ ES_INIT_GPIO_H_3_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_3_LEVEL
+ ES_INIT_GPIO_H_3_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_3_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_3_IRQ_MODE
+ ES_INIT_GPIO_H_3_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_3_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin3_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_4
+
+ {
+ ES_PIN_GPIO_H_4 ,
+
+#ifdef ES_INIT_GPIO_H_4_MODE
+ ES_INIT_GPIO_H_4_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_4_LEVEL
+ ES_INIT_GPIO_H_4_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_4_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_4_IRQ_MODE
+ ES_INIT_GPIO_H_4_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_4_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin4_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_5
+
+ {
+ ES_PIN_GPIO_H_5 ,
+
+#ifdef ES_INIT_GPIO_H_5_MODE
+ ES_INIT_GPIO_H_5_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_5_LEVEL
+ ES_INIT_GPIO_H_5_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_5_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_5_IRQ_MODE
+ ES_INIT_GPIO_H_5_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_5_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin5_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_6
+
+ {
+ ES_PIN_GPIO_H_6 ,
+
+#ifdef ES_INIT_GPIO_H_6_MODE
+ ES_INIT_GPIO_H_6_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_6_LEVEL
+ ES_INIT_GPIO_H_6_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_6_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_6_IRQ_MODE
+ ES_INIT_GPIO_H_6_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_6_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin6_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_7
+
+ {
+ ES_PIN_GPIO_H_7 ,
+
+#ifdef ES_INIT_GPIO_H_7_MODE
+ ES_INIT_GPIO_H_7_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_7_LEVEL
+ ES_INIT_GPIO_H_7_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_7_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_7_IRQ_MODE
+ ES_INIT_GPIO_H_7_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_7_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin7_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_8
+
+ {
+ ES_PIN_GPIO_H_8 ,
+
+#ifdef ES_INIT_GPIO_H_8_MODE
+ ES_INIT_GPIO_H_8_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_8_LEVEL
+ ES_INIT_GPIO_H_8_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_8_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_8_IRQ_MODE
+ ES_INIT_GPIO_H_8_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_8_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin8_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_9
+
+ {
+ ES_PIN_GPIO_H_9 ,
+
+#ifdef ES_INIT_GPIO_H_9_MODE
+ ES_INIT_GPIO_H_9_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_9_LEVEL
+ ES_INIT_GPIO_H_9_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_9_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_9_IRQ_MODE
+ ES_INIT_GPIO_H_9_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_9_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin9_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_10
+
+ {
+ ES_PIN_GPIO_H_10 ,
+
+#ifdef ES_INIT_GPIO_H_10_MODE
+ ES_INIT_GPIO_H_10_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_10_LEVEL
+ ES_INIT_GPIO_H_10_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_10_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_10_IRQ_MODE
+ ES_INIT_GPIO_H_10_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_10_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin10_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_11
+
+ {
+ ES_PIN_GPIO_H_11 ,
+
+#ifdef ES_INIT_GPIO_H_11_MODE
+ ES_INIT_GPIO_H_11_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_11_LEVEL
+ ES_INIT_GPIO_H_11_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_11_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_11_IRQ_MODE
+ ES_INIT_GPIO_H_11_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_11_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin11_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_12
+
+ {
+ ES_PIN_GPIO_H_12 ,
+
+#ifdef ES_INIT_GPIO_H_12_MODE
+ ES_INIT_GPIO_H_12_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_12_LEVEL
+ ES_INIT_GPIO_H_12_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_12_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_12_IRQ_MODE
+ ES_INIT_GPIO_H_12_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_12_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin12_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_13
+
+ {
+ ES_PIN_GPIO_H_13 ,
+
+#ifdef ES_INIT_GPIO_H_13_MODE
+ ES_INIT_GPIO_H_13_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_13_LEVEL
+ ES_INIT_GPIO_H_13_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_13_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_13_IRQ_MODE
+ ES_INIT_GPIO_H_13_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_13_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin13_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_14
+
+ {
+ ES_PIN_GPIO_H_14 ,
+
+#ifdef ES_INIT_GPIO_H_14_MODE
+ ES_INIT_GPIO_H_14_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_14_LEVEL
+ ES_INIT_GPIO_H_14_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_14_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_14_IRQ_MODE
+ ES_INIT_GPIO_H_14_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_14_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin14_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+#ifdef ES_INIT_PIN_GPIO_H_15
+
+ {
+ ES_PIN_GPIO_H_15 ,
+
+#ifdef ES_INIT_GPIO_H_15_MODE
+ ES_INIT_GPIO_H_15_MODE ,
+#else
+ ES_C_GPIO_MODE_OUTPUT ,
+#endif
+
+#ifdef ES_INIT_GPIO_H_15_LEVEL
+ ES_INIT_GPIO_H_15_LEVEL ,
+#else
+ ES_C_GPIO_LEVEL_HIGH ,
+#endif
+
+ ES_INIT_GPIO_H_15_IRQ_EN ,
+
+#ifdef ES_INIT_GPIO_H_15_IRQ_MODE
+ ES_INIT_GPIO_H_15_IRQ_MODE ,
+#else
+ ES_C_GPIO_IRQ_MODE_RISE ,
+#endif
+
+#if (ES_INIT_GPIO_H_15_IRQ_EN == ES_C_GPIO_IRQ_ENABLE)
+ irq_pin15_callback ,
+#else
+ RT_NULL ,
+#endif
+ },
+
+#endif
+
+
+
+};
+
+#endif
+
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_hwtimer.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_hwtimer.h
new file mode 100644
index 0000000000..f71afb3b95
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_hwtimer.h
@@ -0,0 +1,102 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_HWTIMER_H__
+#define __ES_CONF_INFO_HWTIMER_H__
+
+#include <ald_cmu.h>
+#include <ald_timer.h>
+
+#define ES_C_HWTIMER_MODE_UP HWTIMER_CNTMODE_UP
+#define ES_C_HWTIMER_MODE_DOWN HWTIMER_CNTMODE_DW
+
+/* HWTIMER 配置 */
+
+/* codes_main */
+
+
+
+#ifndef ES_AD16C4T0_HWTIMER_MODE
+#define ES_AD16C4T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_AD16C4T1_HWTIMER_MODE
+#define ES_AD16C4T1_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_GP32C4T0_HWTIMER_MODE
+#define ES_GP32C4T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_GP32C4T1_HWTIMER_MODE
+#define ES_GP32C4T1_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_GP16C4T0_HWTIMER_MODE
+#define ES_GP16C4T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_GP16C4T1_HWTIMER_MODE
+#define ES_GP16C4T1_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_BS16T0_HWTIMER_MODE
+#define ES_BS16T0_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+#ifndef ES_BS16T1_HWTIMER_MODE
+#define ES_BS16T1_HWTIMER_MODE ES_C_HWTIMER_MODE_UP
+#endif
+
+
+
+
+#define ES_AD16C4T0_HWTIMER_PRES 1
+#define ES_AD16C4T1_HWTIMER_PRES 1
+#define ES_GP16C4T0_HWTIMER_PRES 1
+#define ES_GP16C4T1_HWTIMER_PRES 1
+#define ES_GP32C4T0_HWTIMER_PRES 1
+#define ES_GP32C4T1_HWTIMER_PRES 1
+#define ES_BS16T0_HWTIMER_PRES 1
+#define ES_BS16T1_HWTIMER_PRES 1
+
+#ifndef ES_DEVICE_NAME_AD16C4T0_HWTIMER
+#define ES_DEVICE_NAME_AD16C4T0_HWTIMER "timer0"
+#endif
+#ifndef ES_DEVICE_NAME_AD16C4T1_HWTIMER
+#define ES_DEVICE_NAME_AD16C4T1_HWTIMER "timer1"
+#endif
+#ifndef ES_DEVICE_NAME_GP32C4T0_HWTIMER
+#define ES_DEVICE_NAME_GP32C4T0_HWTIMER "timer2"
+#endif
+#ifndef ES_DEVICE_NAME_GP32C4T1_HWTIMER
+#define ES_DEVICE_NAME_GP32C4T1_HWTIMER "timer3"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C4T0_HWTIMER
+#define ES_DEVICE_NAME_GP16C4T0_HWTIMER "timer4"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C4T1_HWTIMER
+#define ES_DEVICE_NAME_GP16C4T1_HWTIMER "timer5"
+#endif
+#ifndef ES_DEVICE_NAME_BS16T0_HWTIMER
+#define ES_DEVICE_NAME_BS16T0_HWTIMER "timer6"
+#endif
+#ifndef ES_DEVICE_NAME_BS16T1_HWTIMER
+#define ES_DEVICE_NAME_BS16T1_HWTIMER "timer7"
+#endif
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_i2c.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_i2c.h
new file mode 100644
index 0000000000..65310fce01
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_i2c.h
@@ -0,0 +1,95 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_I2C_H__
+#define __ES_CONF_INFO_I2C_H__
+
+#include "es_conf_info_map.h"
+#include <ald_i2c.h>
+#include <ald_gpio.h>
+#include <rtdbg.h>
+
+#define ES_C_I2C_STRETCH I2C_NOSTRETCH_DISABLE
+#define ES_C_I2C_NO_STRETCH I2C_NOSTRETCH_ENABLE
+
+#define ES_C_I2C_GENERALCALL I2C_GENERALCALL_ENABLE
+#define ES_C_I2C_NO_GENERALCALL I2C_GENERALCALL_DISABLE
+
+
+#define ES_C_I2C_ADDR_7_MODE I2C_ADDR_7BIT
+#define ES_C_I2C_ADDR_10_MODE I2C_ADDR_10BIT
+
+
+/* I2C 配置 */
+
+
+
+/* codes_main */
+
+
+
+
+
+#ifndef ES_DEVICE_NAME_I2C0
+#define ES_DEVICE_NAME_I2C0 "i2c0"
+#endif
+
+#ifndef ES_DEVICE_NAME_I2C1
+#define ES_DEVICE_NAME_I2C1 "i2c1"
+#endif
+
+#ifndef ES_I2C0_CLK_SPEED
+#define ES_I2C0_CLK_SPEED 100000
+#endif
+#ifndef ES_I2C0_OWN_ADDR1
+#define ES_I2C0_OWN_ADDR1 0x20
+#endif
+#ifndef ES_I2C0_GENERAL_CALL
+#define ES_I2C0_GENERAL_CALL ES_C_I2C_NO_GENERALCALL
+#endif
+#ifndef ES_I2C0_STRETCH
+#define ES_I2C0_STRETCH ES_C_I2C_STRETCH
+#endif
+#ifndef ES_I2C0_ADDR_MODE
+#define ES_I2C0_ADDR_MODE ES_C_I2C_ADDR_7_MODE
+#endif
+
+#ifndef ES_I2C1_CLK_SPEED
+#define ES_I2C1_CLK_SPEED 100000
+#endif
+#ifndef ES_I2C1_OWN_ADDR1
+#define ES_I2C1_OWN_ADDR1 0x20
+#endif
+#ifndef ES_I2C1_GENERAL_CALL
+#define ES_I2C1_GENERAL_CALL ES_C_I2C_NO_GENERALCALL
+#endif
+#ifndef ES_I2C1_STRETCH
+#define ES_I2C1_STRETCH ES_C_I2C_STRETCH
+#endif
+#ifndef ES_I2C1_ADDR_MODE
+#define ES_I2C1_ADDR_MODE ES_C_I2C_ADDR_7_MODE
+#endif
+
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_map.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_map.h
new file mode 100644
index 0000000000..f25123227b
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_map.h
@@ -0,0 +1,2876 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __es_conf_info_map_H__
+#define __es_conf_info_map_H__
+
+#include <ald_gpio.h>
+
+
+
+#define __ES_PIN(index, gpio, gpio_index) {index, GPIO##gpio, GPIO_PIN_##gpio_index}
+#define __ES_PIN_DEFAULT {-1, 0, 0}
+
+struct pin_index
+{
+ int index;
+ GPIO_TypeDef *gpio;
+ uint32_t pin;
+};
+
+
+#define ES_GPIO_ADC_CH0_GPIO GPIOC
+#define ES_GPIO_ADC_CH1_GPIO GPIOC
+#define ES_GPIO_ADC_CH2_GPIO GPIOC
+#define ES_GPIO_ADC_CH3_GPIO GPIOC
+#define ES_GPIO_ADC_CH4_GPIO GPIOA
+#define ES_GPIO_ADC_CH5_GPIO GPIOA
+#define ES_GPIO_ADC_CH6_GPIO GPIOA
+#define ES_GPIO_ADC_CH7_GPIO GPIOA
+#define ES_GPIO_ADC_CH8_GPIO GPIOA
+#define ES_GPIO_ADC_CH9_GPIO GPIOA
+#define ES_GPIO_ADC_CH10_GPIO GPIOA
+#define ES_GPIO_ADC_CH11_GPIO GPIOA
+#define ES_GPIO_ADC_CH12_GPIO GPIOC
+#define ES_GPIO_ADC_CH13_GPIO GPIOC
+#define ES_GPIO_ADC_CH14_GPIO GPIOB
+#define ES_GPIO_ADC_CH15_GPIO GPIOB
+
+#define ES_GPIO_ADC_CH0_PIN GPIO_PIN_0
+#define ES_GPIO_ADC_CH1_PIN GPIO_PIN_1
+#define ES_GPIO_ADC_CH2_PIN GPIO_PIN_2
+#define ES_GPIO_ADC_CH3_PIN GPIO_PIN_3
+#define ES_GPIO_ADC_CH4_PIN GPIO_PIN_0
+#define ES_GPIO_ADC_CH5_PIN GPIO_PIN_1
+#define ES_GPIO_ADC_CH6_PIN GPIO_PIN_2
+#define ES_GPIO_ADC_CH7_PIN GPIO_PIN_3
+#define ES_GPIO_ADC_CH8_PIN GPIO_PIN_4
+#define ES_GPIO_ADC_CH9_PIN GPIO_PIN_5
+#define ES_GPIO_ADC_CH10_PIN GPIO_PIN_6
+#define ES_GPIO_ADC_CH11_PIN GPIO_PIN_7
+#define ES_GPIO_ADC_CH12_PIN GPIO_PIN_4
+#define ES_GPIO_ADC_CH13_PIN GPIO_PIN_5
+#define ES_GPIO_ADC_CH14_PIN GPIO_PIN_0
+#define ES_GPIO_ADC_CH15_PIN GPIO_PIN_1
+
+
+
+static const struct pin_index pins[] =
+{
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN(2, C, 13),
+ __ES_PIN(3, C, 14),
+ __ES_PIN(4, C, 15),
+ __ES_PIN(5, H, 0),
+ __ES_PIN(6, H, 1),
+ __ES_PIN_DEFAULT,
+ __ES_PIN(8, C, 0),
+ __ES_PIN(9, C, 1),
+ __ES_PIN(10, C, 2),
+ __ES_PIN(11, C, 3),
+ __ES_PIN(12, H, 3),
+ __ES_PIN(13, H, 4),
+ __ES_PIN(14, A, 0),
+ __ES_PIN(15, A, 1),
+ __ES_PIN(16, A, 2),
+ __ES_PIN(17, A, 3),
+ __ES_PIN(18, F, 0),
+ __ES_PIN(19, F, 1),
+ __ES_PIN(20, A, 4),
+ __ES_PIN(21, A, 5),
+ __ES_PIN(22, A, 6),
+ __ES_PIN(23, A, 7),
+ __ES_PIN(24, C, 4),
+ __ES_PIN(25, C, 5),
+ __ES_PIN(26, B, 0),
+ __ES_PIN(27, B, 1),
+ __ES_PIN(28, B, 2),
+ __ES_PIN(29, B, 10),
+ __ES_PIN(30, B, 11),
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN(33, B, 12),
+ __ES_PIN(34, B, 13),
+ __ES_PIN(35, B, 14),
+ __ES_PIN(36, B, 15),
+ __ES_PIN(37, C, 6),
+ __ES_PIN(38, C, 7),
+ __ES_PIN(39, C, 8),
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN(46, A, 13),
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+ __ES_PIN(49, A, 14),
+ __ES_PIN(50, A, 15),
+ __ES_PIN(51, C, 10),
+ __ES_PIN(52, C, 11),
+ __ES_PIN(53, C, 12),
+ __ES_PIN(54, D, 2),
+ __ES_PIN(55, B, 3),
+ __ES_PIN(56, B, 4),
+ __ES_PIN(57, B, 5),
+ __ES_PIN(58, B, 6),
+ __ES_PIN(59, B, 7),
+ __ES_PIN(60, H, 2),
+ __ES_PIN(61, B, 8),
+ __ES_PIN(62, B, 9),
+ __ES_PIN_DEFAULT,
+ __ES_PIN_DEFAULT,
+};
+
+#define ES_PIN_GPIO_C_13 2
+#define ES_PIN_GPIO_C_14 3
+#define ES_PIN_GPIO_C_15 4
+#define ES_PIN_GPIO_H_0 5
+#define ES_PIN_GPIO_H_1 6
+#define ES_PIN_GPIO_C_0 8
+#define ES_PIN_GPIO_C_1 9
+#define ES_PIN_GPIO_C_2 10
+#define ES_PIN_GPIO_C_3 11
+#define ES_PIN_GPIO_H_3 12
+#define ES_PIN_GPIO_H_4 13
+#define ES_PIN_GPIO_A_0 14
+#define ES_PIN_GPIO_A_1 15
+#define ES_PIN_GPIO_A_2 16
+#define ES_PIN_GPIO_A_3 17
+#define ES_PIN_GPIO_F_0 18
+#define ES_PIN_GPIO_F_1 19
+#define ES_PIN_GPIO_A_4 20
+#define ES_PIN_GPIO_A_5 21
+#define ES_PIN_GPIO_A_6 22
+#define ES_PIN_GPIO_A_7 23
+#define ES_PIN_GPIO_C_4 24
+#define ES_PIN_GPIO_C_5 25
+#define ES_PIN_GPIO_B_0 26
+#define ES_PIN_GPIO_B_1 27
+#define ES_PIN_GPIO_B_2 28
+#define ES_PIN_GPIO_B_10 29
+#define ES_PIN_GPIO_B_11 30
+#define ES_PIN_GPIO_B_12 33
+#define ES_PIN_GPIO_B_13 34
+#define ES_PIN_GPIO_B_14 35
+#define ES_PIN_GPIO_B_15 36
+#define ES_PIN_GPIO_C_6 37
+#define ES_PIN_GPIO_C_7 38
+#define ES_PIN_GPIO_C_8 39
+#define ES_PIN_GPIO_A_13 46
+#define ES_PIN_GPIO_A_14 49
+#define ES_PIN_GPIO_A_15 50
+#define ES_PIN_GPIO_C_10 51
+#define ES_PIN_GPIO_C_11 52
+#define ES_PIN_GPIO_C_12 53
+#define ES_PIN_GPIO_D_2 54
+#define ES_PIN_GPIO_B_3 55
+#define ES_PIN_GPIO_B_4 56
+#define ES_PIN_GPIO_B_5 57
+#define ES_PIN_GPIO_B_6 58
+#define ES_PIN_GPIO_B_7 59
+#define ES_PIN_GPIO_H_2 60
+#define ES_PIN_GPIO_B_8 61
+#define ES_PIN_GPIO_B_9 62
+
+
+
+/* UART_TX */
+
+
+#ifndef ES_UART0_TX_GPIO_FUNC
+#define ES_UART0_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_TX_GPIO_PORT
+#define ES_UART0_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_TX_GPIO_PIN
+#define ES_UART0_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART0_TX_PIN
+#ifdef ES_PIN_GPIO_B_10
+#define ES_UART0_TX_PIN ES_PIN_GPIO_B_10
+#endif
+#endif
+
+#ifndef ES_UART0_TX_GPIO_FUNC
+#define ES_UART0_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_TX_GPIO_PORT
+#define ES_UART0_TX_GPIO_PORT GPIOH
+#endif
+#ifndef ES_UART0_TX_GPIO_PIN
+#define ES_UART0_TX_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART0_TX_PIN
+#ifdef ES_PIN_GPIO_H_0
+#define ES_UART0_TX_PIN ES_PIN_GPIO_H_0
+#endif
+#endif
+
+#ifndef ES_UART0_TX_GPIO_FUNC
+#define ES_UART0_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_TX_GPIO_PORT
+#define ES_UART0_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_TX_GPIO_PIN
+#define ES_UART0_TX_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_UART0_TX_PIN
+#ifdef ES_PIN_GPIO_D_8
+#define ES_UART0_TX_PIN ES_PIN_GPIO_D_8
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_C_0
+#define ES_UART1_TX_PIN ES_PIN_GPIO_C_0
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_A_13
+#define ES_UART1_TX_PIN ES_PIN_GPIO_A_13
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_C_10
+#define ES_UART1_TX_PIN ES_PIN_GPIO_C_10
+#endif
+#endif
+
+#ifndef ES_UART1_TX_GPIO_FUNC
+#define ES_UART1_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_TX_GPIO_PORT
+#define ES_UART1_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART1_TX_GPIO_PIN
+#define ES_UART1_TX_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_UART1_TX_PIN
+#ifdef ES_PIN_GPIO_D_5
+#define ES_UART1_TX_PIN ES_PIN_GPIO_D_5
+#endif
+#endif
+
+#ifndef ES_UART2_TX_GPIO_FUNC
+#define ES_UART2_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_TX_GPIO_PORT
+#define ES_UART2_TX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_TX_GPIO_PIN
+#define ES_UART2_TX_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART2_TX_PIN
+#ifdef ES_PIN_GPIO_E_2
+#define ES_UART2_TX_PIN ES_PIN_GPIO_E_2
+#endif
+#endif
+
+#ifndef ES_UART2_TX_GPIO_FUNC
+#define ES_UART2_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_TX_GPIO_PORT
+#define ES_UART2_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART2_TX_GPIO_PIN
+#define ES_UART2_TX_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART2_TX_PIN
+#ifdef ES_PIN_GPIO_C_12
+#define ES_UART2_TX_PIN ES_PIN_GPIO_C_12
+#endif
+#endif
+
+#ifndef ES_UART2_TX_GPIO_FUNC
+#define ES_UART2_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_TX_GPIO_PORT
+#define ES_UART2_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART2_TX_GPIO_PIN
+#define ES_UART2_TX_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART2_TX_PIN
+#ifdef ES_PIN_GPIO_B_3
+#define ES_UART2_TX_PIN ES_PIN_GPIO_B_3
+#endif
+#endif
+
+#ifndef ES_UART3_TX_GPIO_FUNC
+#define ES_UART3_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_TX_GPIO_PORT
+#define ES_UART3_TX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART3_TX_GPIO_PIN
+#define ES_UART3_TX_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART3_TX_PIN
+#ifdef ES_PIN_GPIO_C_4
+#define ES_UART3_TX_PIN ES_PIN_GPIO_C_4
+#endif
+#endif
+
+#ifndef ES_UART3_TX_GPIO_FUNC
+#define ES_UART3_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_TX_GPIO_PORT
+#define ES_UART3_TX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_TX_GPIO_PIN
+#define ES_UART3_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART3_TX_PIN
+#ifdef ES_PIN_GPIO_E_10
+#define ES_UART3_TX_PIN ES_PIN_GPIO_E_10
+#endif
+#endif
+
+#ifndef ES_UART3_TX_GPIO_FUNC
+#define ES_UART3_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_TX_GPIO_PORT
+#define ES_UART3_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART3_TX_GPIO_PIN
+#define ES_UART3_TX_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_UART3_TX_PIN
+#ifdef ES_PIN_GPIO_D_14
+#define ES_UART3_TX_PIN ES_PIN_GPIO_D_14
+#endif
+#endif
+
+#ifndef ES_UART4_TX_GPIO_FUNC
+#define ES_UART4_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART4_TX_GPIO_PORT
+#define ES_UART4_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART4_TX_GPIO_PIN
+#define ES_UART4_TX_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_UART4_TX_PIN
+#ifdef ES_PIN_GPIO_B_6
+#define ES_UART4_TX_PIN ES_PIN_GPIO_B_6
+#endif
+#endif
+
+#ifndef ES_UART4_TX_GPIO_FUNC
+#define ES_UART4_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART4_TX_GPIO_PORT
+#define ES_UART4_TX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_TX_GPIO_PIN
+#define ES_UART4_TX_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART4_TX_PIN
+#ifdef ES_PIN_GPIO_E_10
+#define ES_UART4_TX_PIN ES_PIN_GPIO_E_10
+#endif
+#endif
+
+#ifndef ES_UART5_TX_GPIO_FUNC
+#define ES_UART5_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART5_TX_GPIO_PORT
+#define ES_UART5_TX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART5_TX_GPIO_PIN
+#define ES_UART5_TX_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART5_TX_PIN
+#ifdef ES_PIN_GPIO_A_2
+#define ES_UART5_TX_PIN ES_PIN_GPIO_A_2
+#endif
+#endif
+
+#ifndef ES_UART5_TX_GPIO_FUNC
+#define ES_UART5_TX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART5_TX_GPIO_PORT
+#define ES_UART5_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART5_TX_GPIO_PIN
+#define ES_UART5_TX_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_UART5_TX_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_UART5_TX_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+#ifndef ES_UART5_TX_GPIO_FUNC
+#define ES_UART5_TX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART5_TX_GPIO_PORT
+#define ES_UART5_TX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART5_TX_GPIO_PIN
+#define ES_UART5_TX_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_UART5_TX_PIN
+#ifdef ES_PIN_GPIO_D_5
+#define ES_UART5_TX_PIN ES_PIN_GPIO_D_5
+#endif
+#endif
+
+
+/* UART_RX */
+
+
+#ifndef ES_UART0_RX_GPIO_FUNC
+#define ES_UART0_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_RX_GPIO_PORT
+#define ES_UART0_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_RX_GPIO_PIN
+#define ES_UART0_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART0_RX_PIN
+#ifdef ES_PIN_GPIO_B_11
+#define ES_UART0_RX_PIN ES_PIN_GPIO_B_11
+#endif
+#endif
+
+#ifndef ES_UART0_RX_GPIO_FUNC
+#define ES_UART0_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_RX_GPIO_PORT
+#define ES_UART0_RX_GPIO_PORT GPIOH
+#endif
+#ifndef ES_UART0_RX_GPIO_PIN
+#define ES_UART0_RX_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART0_RX_PIN
+#ifdef ES_PIN_GPIO_H_1
+#define ES_UART0_RX_PIN ES_PIN_GPIO_H_1
+#endif
+#endif
+
+#ifndef ES_UART0_RX_GPIO_FUNC
+#define ES_UART0_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_RX_GPIO_PORT
+#define ES_UART0_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_RX_GPIO_PIN
+#define ES_UART0_RX_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_UART0_RX_PIN
+#ifdef ES_PIN_GPIO_D_9
+#define ES_UART0_RX_PIN ES_PIN_GPIO_D_9
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_C_1
+#define ES_UART1_RX_PIN ES_PIN_GPIO_C_1
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_A_14
+#define ES_UART1_RX_PIN ES_PIN_GPIO_A_14
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_C_11
+#define ES_UART1_RX_PIN ES_PIN_GPIO_C_11
+#endif
+#endif
+
+#ifndef ES_UART1_RX_GPIO_FUNC
+#define ES_UART1_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RX_GPIO_PORT
+#define ES_UART1_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART1_RX_GPIO_PIN
+#define ES_UART1_RX_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_UART1_RX_PIN
+#ifdef ES_PIN_GPIO_D_6
+#define ES_UART1_RX_PIN ES_PIN_GPIO_D_6
+#endif
+#endif
+
+#ifndef ES_UART2_RX_GPIO_FUNC
+#define ES_UART2_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_RX_GPIO_PORT
+#define ES_UART2_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART2_RX_GPIO_PIN
+#define ES_UART2_RX_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART2_RX_PIN
+#ifdef ES_PIN_GPIO_B_4
+#define ES_UART2_RX_PIN ES_PIN_GPIO_B_4
+#endif
+#endif
+
+#ifndef ES_UART2_RX_GPIO_FUNC
+#define ES_UART2_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_RX_GPIO_PORT
+#define ES_UART2_RX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_RX_GPIO_PIN
+#define ES_UART2_RX_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART2_RX_PIN
+#ifdef ES_PIN_GPIO_E_3
+#define ES_UART2_RX_PIN ES_PIN_GPIO_E_3
+#endif
+#endif
+
+#ifndef ES_UART2_RX_GPIO_FUNC
+#define ES_UART2_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_RX_GPIO_PORT
+#define ES_UART2_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART2_RX_GPIO_PIN
+#define ES_UART2_RX_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART2_RX_PIN
+#ifdef ES_PIN_GPIO_D_2
+#define ES_UART2_RX_PIN ES_PIN_GPIO_D_2
+#endif
+#endif
+
+#ifndef ES_UART3_RX_GPIO_FUNC
+#define ES_UART3_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_RX_GPIO_PORT
+#define ES_UART3_RX_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART3_RX_GPIO_PIN
+#define ES_UART3_RX_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_UART3_RX_PIN
+#ifdef ES_PIN_GPIO_C_5
+#define ES_UART3_RX_PIN ES_PIN_GPIO_C_5
+#endif
+#endif
+
+#ifndef ES_UART3_RX_GPIO_FUNC
+#define ES_UART3_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_RX_GPIO_PORT
+#define ES_UART3_RX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_RX_GPIO_PIN
+#define ES_UART3_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART3_RX_PIN
+#ifdef ES_PIN_GPIO_E_11
+#define ES_UART3_RX_PIN ES_PIN_GPIO_E_11
+#endif
+#endif
+
+#ifndef ES_UART3_RX_GPIO_FUNC
+#define ES_UART3_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_RX_GPIO_PORT
+#define ES_UART3_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART3_RX_GPIO_PIN
+#define ES_UART3_RX_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART3_RX_PIN
+#ifdef ES_PIN_GPIO_D_13
+#define ES_UART3_RX_PIN ES_PIN_GPIO_D_13
+#endif
+#endif
+
+#ifndef ES_UART4_RX_GPIO_FUNC
+#define ES_UART4_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART4_RX_GPIO_PORT
+#define ES_UART4_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART4_RX_GPIO_PIN
+#define ES_UART4_RX_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_UART4_RX_PIN
+#ifdef ES_PIN_GPIO_B_7
+#define ES_UART4_RX_PIN ES_PIN_GPIO_B_7
+#endif
+#endif
+
+#ifndef ES_UART4_RX_GPIO_FUNC
+#define ES_UART4_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART4_RX_GPIO_PORT
+#define ES_UART4_RX_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_RX_GPIO_PIN
+#define ES_UART4_RX_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART4_RX_PIN
+#ifdef ES_PIN_GPIO_E_11
+#define ES_UART4_RX_PIN ES_PIN_GPIO_E_11
+#endif
+#endif
+
+#ifndef ES_UART5_RX_GPIO_FUNC
+#define ES_UART5_RX_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART5_RX_GPIO_PORT
+#define ES_UART5_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART5_RX_GPIO_PIN
+#define ES_UART5_RX_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_UART5_RX_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_UART5_RX_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+#ifndef ES_UART5_RX_GPIO_FUNC
+#define ES_UART5_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART5_RX_GPIO_PORT
+#define ES_UART5_RX_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART5_RX_GPIO_PIN
+#define ES_UART5_RX_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART5_RX_PIN
+#ifdef ES_PIN_GPIO_A_3
+#define ES_UART5_RX_PIN ES_PIN_GPIO_A_3
+#endif
+#endif
+
+#ifndef ES_UART5_RX_GPIO_FUNC
+#define ES_UART5_RX_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART5_RX_GPIO_PORT
+#define ES_UART5_RX_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART5_RX_GPIO_PIN
+#define ES_UART5_RX_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_UART5_RX_PIN
+#ifdef ES_PIN_GPIO_D_6
+#define ES_UART5_RX_PIN ES_PIN_GPIO_D_6
+#endif
+#endif
+
+
+/* UART_RTS */
+
+
+#ifndef ES_UART0_RTS_GPIO_FUNC
+#define ES_UART0_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_RTS_GPIO_PORT
+#define ES_UART0_RTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_RTS_GPIO_PIN
+#define ES_UART0_RTS_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_UART0_RTS_PIN
+#ifdef ES_PIN_GPIO_B_14
+#define ES_UART0_RTS_PIN ES_PIN_GPIO_B_14
+#endif
+#endif
+
+#ifndef ES_UART0_RTS_GPIO_FUNC
+#define ES_UART0_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_RTS_GPIO_PORT
+#define ES_UART0_RTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_RTS_GPIO_PIN
+#define ES_UART0_RTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART0_RTS_PIN
+#ifdef ES_PIN_GPIO_D_12
+#define ES_UART0_RTS_PIN ES_PIN_GPIO_D_12
+#endif
+#endif
+
+#ifndef ES_UART1_RTS_GPIO_FUNC
+#define ES_UART1_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RTS_GPIO_PORT
+#define ES_UART1_RTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RTS_GPIO_PIN
+#define ES_UART1_RTS_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART1_RTS_PIN
+#ifdef ES_PIN_GPIO_C_3
+#define ES_UART1_RTS_PIN ES_PIN_GPIO_C_3
+#endif
+#endif
+
+#ifndef ES_UART1_RTS_GPIO_FUNC
+#define ES_UART1_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_RTS_GPIO_PORT
+#define ES_UART1_RTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_RTS_GPIO_PIN
+#define ES_UART1_RTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART1_RTS_PIN
+#ifdef ES_PIN_GPIO_C_12
+#define ES_UART1_RTS_PIN ES_PIN_GPIO_C_12
+#endif
+#endif
+
+#ifndef ES_UART2_RTS_GPIO_FUNC
+#define ES_UART2_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_RTS_GPIO_PORT
+#define ES_UART2_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_RTS_GPIO_PIN
+#define ES_UART2_RTS_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_UART2_RTS_PIN
+#ifdef ES_PIN_GPIO_E_5
+#define ES_UART2_RTS_PIN ES_PIN_GPIO_E_5
+#endif
+#endif
+
+#ifndef ES_UART2_RTS_GPIO_FUNC
+#define ES_UART2_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_RTS_GPIO_PORT
+#define ES_UART2_RTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART2_RTS_GPIO_PIN
+#define ES_UART2_RTS_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_UART2_RTS_PIN
+#ifdef ES_PIN_GPIO_C_10
+#define ES_UART2_RTS_PIN ES_PIN_GPIO_C_10
+#endif
+#endif
+
+#ifndef ES_UART3_RTS_GPIO_FUNC
+#define ES_UART3_RTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_RTS_GPIO_PORT
+#define ES_UART3_RTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART3_RTS_GPIO_PIN
+#define ES_UART3_RTS_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART3_RTS_PIN
+#ifdef ES_PIN_GPIO_B_1
+#define ES_UART3_RTS_PIN ES_PIN_GPIO_B_1
+#endif
+#endif
+
+#ifndef ES_UART3_RTS_GPIO_FUNC
+#define ES_UART3_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_RTS_GPIO_PORT
+#define ES_UART3_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_RTS_GPIO_PIN
+#define ES_UART3_RTS_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART3_RTS_PIN
+#ifdef ES_PIN_GPIO_E_13
+#define ES_UART3_RTS_PIN ES_PIN_GPIO_E_13
+#endif
+#endif
+
+#ifndef ES_UART4_RTS_GPIO_FUNC
+#define ES_UART4_RTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART4_RTS_GPIO_PORT
+#define ES_UART4_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_RTS_GPIO_PIN
+#define ES_UART4_RTS_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART4_RTS_PIN
+#ifdef ES_PIN_GPIO_E_13
+#define ES_UART4_RTS_PIN ES_PIN_GPIO_E_13
+#endif
+#endif
+
+#ifndef ES_UART4_RTS_GPIO_FUNC
+#define ES_UART4_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART4_RTS_GPIO_PORT
+#define ES_UART4_RTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_RTS_GPIO_PIN
+#define ES_UART4_RTS_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART4_RTS_PIN
+#ifdef ES_PIN_GPIO_E_1
+#define ES_UART4_RTS_PIN ES_PIN_GPIO_E_1
+#endif
+#endif
+
+#ifndef ES_UART5_RTS_GPIO_FUNC
+#define ES_UART5_RTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART5_RTS_GPIO_PORT
+#define ES_UART5_RTS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART5_RTS_GPIO_PIN
+#define ES_UART5_RTS_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_UART5_RTS_PIN
+#ifdef ES_PIN_GPIO_A_1
+#define ES_UART5_RTS_PIN ES_PIN_GPIO_A_1
+#endif
+#endif
+
+#ifndef ES_UART5_RTS_GPIO_FUNC
+#define ES_UART5_RTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART5_RTS_GPIO_PORT
+#define ES_UART5_RTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART5_RTS_GPIO_PIN
+#define ES_UART5_RTS_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART5_RTS_PIN
+#ifdef ES_PIN_GPIO_D_4
+#define ES_UART5_RTS_PIN ES_PIN_GPIO_D_4
+#endif
+#endif
+
+
+/* UART_CTS */
+
+
+#ifndef ES_UART0_CTS_GPIO_FUNC
+#define ES_UART0_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART0_CTS_GPIO_PORT
+#define ES_UART0_CTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART0_CTS_GPIO_PIN
+#define ES_UART0_CTS_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_UART0_CTS_PIN
+#ifdef ES_PIN_GPIO_B_13
+#define ES_UART0_CTS_PIN ES_PIN_GPIO_B_13
+#endif
+#endif
+
+#ifndef ES_UART0_CTS_GPIO_FUNC
+#define ES_UART0_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART0_CTS_GPIO_PORT
+#define ES_UART0_CTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART0_CTS_GPIO_PIN
+#define ES_UART0_CTS_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART0_CTS_PIN
+#ifdef ES_PIN_GPIO_D_11
+#define ES_UART0_CTS_PIN ES_PIN_GPIO_D_11
+#endif
+#endif
+
+#ifndef ES_UART1_CTS_GPIO_FUNC
+#define ES_UART1_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_CTS_GPIO_PORT
+#define ES_UART1_CTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART1_CTS_GPIO_PIN
+#define ES_UART1_CTS_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART1_CTS_PIN
+#ifdef ES_PIN_GPIO_C_2
+#define ES_UART1_CTS_PIN ES_PIN_GPIO_C_2
+#endif
+#endif
+
+#ifndef ES_UART1_CTS_GPIO_FUNC
+#define ES_UART1_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART1_CTS_GPIO_PORT
+#define ES_UART1_CTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART1_CTS_GPIO_PIN
+#define ES_UART1_CTS_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_UART1_CTS_PIN
+#ifdef ES_PIN_GPIO_D_2
+#define ES_UART1_CTS_PIN ES_PIN_GPIO_D_2
+#endif
+#endif
+
+#ifndef ES_UART2_CTS_GPIO_FUNC
+#define ES_UART2_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART2_CTS_GPIO_PORT
+#define ES_UART2_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART2_CTS_GPIO_PIN
+#define ES_UART2_CTS_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART2_CTS_PIN
+#ifdef ES_PIN_GPIO_E_4
+#define ES_UART2_CTS_PIN ES_PIN_GPIO_E_4
+#endif
+#endif
+
+#ifndef ES_UART2_CTS_GPIO_FUNC
+#define ES_UART2_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART2_CTS_GPIO_PORT
+#define ES_UART2_CTS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_UART2_CTS_GPIO_PIN
+#define ES_UART2_CTS_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_UART2_CTS_PIN
+#ifdef ES_PIN_GPIO_C_11
+#define ES_UART2_CTS_PIN ES_PIN_GPIO_C_11
+#endif
+#endif
+
+#ifndef ES_UART3_CTS_GPIO_FUNC
+#define ES_UART3_CTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART3_CTS_GPIO_PORT
+#define ES_UART3_CTS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_UART3_CTS_GPIO_PIN
+#define ES_UART3_CTS_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART3_CTS_PIN
+#ifdef ES_PIN_GPIO_B_0
+#define ES_UART3_CTS_PIN ES_PIN_GPIO_B_0
+#endif
+#endif
+
+#ifndef ES_UART3_CTS_GPIO_FUNC
+#define ES_UART3_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART3_CTS_GPIO_PORT
+#define ES_UART3_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART3_CTS_GPIO_PIN
+#define ES_UART3_CTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART3_CTS_PIN
+#ifdef ES_PIN_GPIO_E_12
+#define ES_UART3_CTS_PIN ES_PIN_GPIO_E_12
+#endif
+#endif
+
+#ifndef ES_UART4_CTS_GPIO_FUNC
+#define ES_UART4_CTS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART4_CTS_GPIO_PORT
+#define ES_UART4_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_CTS_GPIO_PIN
+#define ES_UART4_CTS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_UART4_CTS_PIN
+#ifdef ES_PIN_GPIO_E_12
+#define ES_UART4_CTS_PIN ES_PIN_GPIO_E_12
+#endif
+#endif
+
+#ifndef ES_UART4_CTS_GPIO_FUNC
+#define ES_UART4_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART4_CTS_GPIO_PORT
+#define ES_UART4_CTS_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_CTS_GPIO_PIN
+#define ES_UART4_CTS_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART4_CTS_PIN
+#ifdef ES_PIN_GPIO_E_0
+#define ES_UART4_CTS_PIN ES_PIN_GPIO_E_0
+#endif
+#endif
+
+#ifndef ES_UART5_CTS_GPIO_FUNC
+#define ES_UART5_CTS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART5_CTS_GPIO_PORT
+#define ES_UART5_CTS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART5_CTS_GPIO_PIN
+#define ES_UART5_CTS_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART5_CTS_PIN
+#ifdef ES_PIN_GPIO_A_0
+#define ES_UART5_CTS_PIN ES_PIN_GPIO_A_0
+#endif
+#endif
+
+#ifndef ES_UART5_CTS_GPIO_FUNC
+#define ES_UART5_CTS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART5_CTS_GPIO_PORT
+#define ES_UART5_CTS_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART5_CTS_GPIO_PIN
+#define ES_UART5_CTS_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_UART5_CTS_PIN
+#ifdef ES_PIN_GPIO_D_3
+#define ES_UART5_CTS_PIN ES_PIN_GPIO_D_3
+#endif
+#endif
+
+
+/* UART_CK */
+
+
+#ifndef ES_UART4_CK_GPIO_FUNC
+#define ES_UART4_CK_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART4_CK_GPIO_PORT
+#define ES_UART4_CK_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_CK_GPIO_PIN
+#define ES_UART4_CK_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_UART4_CK_PIN
+#ifdef ES_PIN_GPIO_E_6
+#define ES_UART4_CK_PIN ES_PIN_GPIO_E_6
+#endif
+#endif
+
+#ifndef ES_UART4_CK_GPIO_FUNC
+#define ES_UART4_CK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART4_CK_GPIO_PORT
+#define ES_UART4_CK_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART4_CK_GPIO_PIN
+#define ES_UART4_CK_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_UART4_CK_PIN
+#ifdef ES_PIN_GPIO_E_7
+#define ES_UART4_CK_PIN ES_PIN_GPIO_E_7
+#endif
+#endif
+
+#ifndef ES_UART5_CK_GPIO_FUNC
+#define ES_UART5_CK_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_UART5_CK_GPIO_PORT
+#define ES_UART5_CK_GPIO_PORT GPIOA
+#endif
+#ifndef ES_UART5_CK_GPIO_PIN
+#define ES_UART5_CK_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_UART5_CK_PIN
+#ifdef ES_PIN_GPIO_A_4
+#define ES_UART5_CK_PIN ES_PIN_GPIO_A_4
+#endif
+#endif
+
+#ifndef ES_UART5_CK_GPIO_FUNC
+#define ES_UART5_CK_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_UART5_CK_GPIO_PORT
+#define ES_UART5_CK_GPIO_PORT GPIOD
+#endif
+#ifndef ES_UART5_CK_GPIO_PIN
+#define ES_UART5_CK_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_UART5_CK_PIN
+#ifdef ES_PIN_GPIO_D_7
+#define ES_UART5_CK_PIN ES_PIN_GPIO_D_7
+#endif
+#endif
+
+#ifndef ES_UART5_CK_GPIO_FUNC
+#define ES_UART5_CK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_UART5_CK_GPIO_PORT
+#define ES_UART5_CK_GPIO_PORT GPIOE
+#endif
+#ifndef ES_UART5_CK_GPIO_PIN
+#define ES_UART5_CK_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_UART5_CK_PIN
+#ifdef ES_PIN_GPIO_E_0
+#define ES_UART5_CK_PIN ES_PIN_GPIO_E_0
+#endif
+#endif
+
+
+/* USART_TX */
+
+
+
+/* USART_RX */
+
+
+
+/* USART_RTS */
+
+
+
+/* USART_CTS */
+
+
+
+/* USART_CK */
+
+
+
+/* I2C_SCL */
+
+
+#ifndef ES_I2C0_SCL_GPIO_FUNC
+#define ES_I2C0_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PORT
+#define ES_I2C0_SCL_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PIN
+#define ES_I2C0_SCL_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_I2C0_SCL_PIN
+#ifdef ES_PIN_GPIO_B_6
+#define ES_I2C0_SCL_PIN ES_PIN_GPIO_B_6
+#endif
+#endif
+
+#ifndef ES_I2C0_SCL_GPIO_FUNC
+#define ES_I2C0_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PORT
+#define ES_I2C0_SCL_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SCL_GPIO_PIN
+#define ES_I2C0_SCL_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_I2C0_SCL_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_I2C0_SCL_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+#ifndef ES_I2C1_SCL_GPIO_FUNC
+#define ES_I2C1_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PORT
+#define ES_I2C1_SCL_GPIO_PORT GPIOA
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PIN
+#define ES_I2C1_SCL_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_I2C1_SCL_PIN
+#ifdef ES_PIN_GPIO_A_5
+#define ES_I2C1_SCL_PIN ES_PIN_GPIO_A_5
+#endif
+#endif
+
+#ifndef ES_I2C1_SCL_GPIO_FUNC
+#define ES_I2C1_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PORT
+#define ES_I2C1_SCL_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PIN
+#define ES_I2C1_SCL_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_I2C1_SCL_PIN
+#ifdef ES_PIN_GPIO_B_10
+#define ES_I2C1_SCL_PIN ES_PIN_GPIO_B_10
+#endif
+#endif
+
+#ifndef ES_I2C1_SCL_GPIO_FUNC
+#define ES_I2C1_SCL_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PORT
+#define ES_I2C1_SCL_GPIO_PORT GPIOH
+#endif
+#ifndef ES_I2C1_SCL_GPIO_PIN
+#define ES_I2C1_SCL_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_I2C1_SCL_PIN
+#ifdef ES_PIN_GPIO_H_0
+#define ES_I2C1_SCL_PIN ES_PIN_GPIO_H_0
+#endif
+#endif
+
+
+/* I2C_SDA */
+
+
+#ifndef ES_I2C0_SDA_GPIO_FUNC
+#define ES_I2C0_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PORT
+#define ES_I2C0_SDA_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PIN
+#define ES_I2C0_SDA_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_I2C0_SDA_PIN
+#ifdef ES_PIN_GPIO_B_7
+#define ES_I2C0_SDA_PIN ES_PIN_GPIO_B_7
+#endif
+#endif
+
+#ifndef ES_I2C0_SDA_GPIO_FUNC
+#define ES_I2C0_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PORT
+#define ES_I2C0_SDA_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C0_SDA_GPIO_PIN
+#define ES_I2C0_SDA_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_I2C0_SDA_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_I2C0_SDA_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+#ifndef ES_I2C1_SDA_GPIO_FUNC
+#define ES_I2C1_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PORT
+#define ES_I2C1_SDA_GPIO_PORT GPIOA
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PIN
+#define ES_I2C1_SDA_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_I2C1_SDA_PIN
+#ifdef ES_PIN_GPIO_A_6
+#define ES_I2C1_SDA_PIN ES_PIN_GPIO_A_6
+#endif
+#endif
+
+#ifndef ES_I2C1_SDA_GPIO_FUNC
+#define ES_I2C1_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PORT
+#define ES_I2C1_SDA_GPIO_PORT GPIOB
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PIN
+#define ES_I2C1_SDA_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_I2C1_SDA_PIN
+#ifdef ES_PIN_GPIO_B_11
+#define ES_I2C1_SDA_PIN ES_PIN_GPIO_B_11
+#endif
+#endif
+
+#ifndef ES_I2C1_SDA_GPIO_FUNC
+#define ES_I2C1_SDA_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PORT
+#define ES_I2C1_SDA_GPIO_PORT GPIOH
+#endif
+#ifndef ES_I2C1_SDA_GPIO_PIN
+#define ES_I2C1_SDA_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_I2C1_SDA_PIN
+#ifdef ES_PIN_GPIO_H_1
+#define ES_I2C1_SDA_PIN ES_PIN_GPIO_H_1
+#endif
+#endif
+
+
+/* SPI_MISO */
+
+
+#ifndef ES_SPI0_MISO_GPIO_FUNC
+#define ES_SPI0_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PORT
+#define ES_SPI0_MISO_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PIN
+#define ES_SPI0_MISO_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI0_MISO_PIN
+#ifdef ES_PIN_GPIO_B_4
+#define ES_SPI0_MISO_PIN ES_PIN_GPIO_B_4
+#endif
+#endif
+
+#ifndef ES_SPI0_MISO_GPIO_FUNC
+#define ES_SPI0_MISO_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PORT
+#define ES_SPI0_MISO_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PIN
+#define ES_SPI0_MISO_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_SPI0_MISO_PIN
+#ifdef ES_PIN_GPIO_A_6
+#define ES_SPI0_MISO_PIN ES_PIN_GPIO_A_6
+#endif
+#endif
+
+#ifndef ES_SPI0_MISO_GPIO_FUNC
+#define ES_SPI0_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PORT
+#define ES_SPI0_MISO_GPIO_PORT GPIOD
+#endif
+#ifndef ES_SPI0_MISO_GPIO_PIN
+#define ES_SPI0_MISO_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI0_MISO_PIN
+#ifdef ES_PIN_GPIO_D_4
+#define ES_SPI0_MISO_PIN ES_PIN_GPIO_D_4
+#endif
+#endif
+
+#ifndef ES_SPI1_MISO_GPIO_FUNC
+#define ES_SPI1_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PORT
+#define ES_SPI1_MISO_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PIN
+#define ES_SPI1_MISO_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_SPI1_MISO_PIN
+#ifdef ES_PIN_GPIO_C_2
+#define ES_SPI1_MISO_PIN ES_PIN_GPIO_C_2
+#endif
+#endif
+
+#ifndef ES_SPI1_MISO_GPIO_FUNC
+#define ES_SPI1_MISO_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PORT
+#define ES_SPI1_MISO_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_MISO_GPIO_PIN
+#define ES_SPI1_MISO_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_SPI1_MISO_PIN
+#ifdef ES_PIN_GPIO_B_14
+#define ES_SPI1_MISO_PIN ES_PIN_GPIO_B_14
+#endif
+#endif
+
+#ifndef ES_SPI2_MISO_GPIO_FUNC
+#define ES_SPI2_MISO_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_SPI2_MISO_GPIO_PORT
+#define ES_SPI2_MISO_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI2_MISO_GPIO_PIN
+#define ES_SPI2_MISO_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI2_MISO_PIN
+#ifdef ES_PIN_GPIO_B_4
+#define ES_SPI2_MISO_PIN ES_PIN_GPIO_B_4
+#endif
+#endif
+
+#ifndef ES_SPI2_MISO_GPIO_FUNC
+#define ES_SPI2_MISO_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_SPI2_MISO_GPIO_PORT
+#define ES_SPI2_MISO_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI2_MISO_GPIO_PIN
+#define ES_SPI2_MISO_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_SPI2_MISO_PIN
+#ifdef ES_PIN_GPIO_B_0
+#define ES_SPI2_MISO_PIN ES_PIN_GPIO_B_0
+#endif
+#endif
+
+
+/* SPI_MOSI */
+
+
+#ifndef ES_SPI0_MOSI_GPIO_FUNC
+#define ES_SPI0_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PORT
+#define ES_SPI0_MOSI_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PIN
+#define ES_SPI0_MOSI_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_SPI0_MOSI_PIN
+#ifdef ES_PIN_GPIO_B_5
+#define ES_SPI0_MOSI_PIN ES_PIN_GPIO_B_5
+#endif
+#endif
+
+#ifndef ES_SPI0_MOSI_GPIO_FUNC
+#define ES_SPI0_MOSI_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PORT
+#define ES_SPI0_MOSI_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PIN
+#define ES_SPI0_MOSI_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_SPI0_MOSI_PIN
+#ifdef ES_PIN_GPIO_A_7
+#define ES_SPI0_MOSI_PIN ES_PIN_GPIO_A_7
+#endif
+#endif
+
+#ifndef ES_SPI0_MOSI_GPIO_FUNC
+#define ES_SPI0_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PORT
+#define ES_SPI0_MOSI_GPIO_PORT GPIOD
+#endif
+#ifndef ES_SPI0_MOSI_GPIO_PIN
+#define ES_SPI0_MOSI_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_SPI0_MOSI_PIN
+#ifdef ES_PIN_GPIO_D_7
+#define ES_SPI0_MOSI_PIN ES_PIN_GPIO_D_7
+#endif
+#endif
+
+#ifndef ES_SPI1_MOSI_GPIO_FUNC
+#define ES_SPI1_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PORT
+#define ES_SPI1_MOSI_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PIN
+#define ES_SPI1_MOSI_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_SPI1_MOSI_PIN
+#ifdef ES_PIN_GPIO_C_3
+#define ES_SPI1_MOSI_PIN ES_PIN_GPIO_C_3
+#endif
+#endif
+
+#ifndef ES_SPI1_MOSI_GPIO_FUNC
+#define ES_SPI1_MOSI_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PORT
+#define ES_SPI1_MOSI_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_MOSI_GPIO_PIN
+#define ES_SPI1_MOSI_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_SPI1_MOSI_PIN
+#ifdef ES_PIN_GPIO_B_15
+#define ES_SPI1_MOSI_PIN ES_PIN_GPIO_B_15
+#endif
+#endif
+
+#ifndef ES_SPI2_MOSI_GPIO_FUNC
+#define ES_SPI2_MOSI_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_SPI2_MOSI_GPIO_PORT
+#define ES_SPI2_MOSI_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI2_MOSI_GPIO_PIN
+#define ES_SPI2_MOSI_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_SPI2_MOSI_PIN
+#ifdef ES_PIN_GPIO_B_5
+#define ES_SPI2_MOSI_PIN ES_PIN_GPIO_B_5
+#endif
+#endif
+
+#ifndef ES_SPI2_MOSI_GPIO_FUNC
+#define ES_SPI2_MOSI_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_SPI2_MOSI_GPIO_PORT
+#define ES_SPI2_MOSI_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI2_MOSI_GPIO_PIN
+#define ES_SPI2_MOSI_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_SPI2_MOSI_PIN
+#ifdef ES_PIN_GPIO_B_1
+#define ES_SPI2_MOSI_PIN ES_PIN_GPIO_B_1
+#endif
+#endif
+
+
+/* SPI_SCK */
+
+
+#ifndef ES_SPI0_SCK_GPIO_FUNC
+#define ES_SPI0_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PORT
+#define ES_SPI0_SCK_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PIN
+#define ES_SPI0_SCK_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_SPI0_SCK_PIN
+#ifdef ES_PIN_GPIO_B_3
+#define ES_SPI0_SCK_PIN ES_PIN_GPIO_B_3
+#endif
+#endif
+
+#ifndef ES_SPI0_SCK_GPIO_FUNC
+#define ES_SPI0_SCK_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PORT
+#define ES_SPI0_SCK_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PIN
+#define ES_SPI0_SCK_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_SPI0_SCK_PIN
+#ifdef ES_PIN_GPIO_A_5
+#define ES_SPI0_SCK_PIN ES_PIN_GPIO_A_5
+#endif
+#endif
+
+#ifndef ES_SPI0_SCK_GPIO_FUNC
+#define ES_SPI0_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PORT
+#define ES_SPI0_SCK_GPIO_PORT GPIOD
+#endif
+#ifndef ES_SPI0_SCK_GPIO_PIN
+#define ES_SPI0_SCK_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_SPI0_SCK_PIN
+#ifdef ES_PIN_GPIO_D_3
+#define ES_SPI0_SCK_PIN ES_PIN_GPIO_D_3
+#endif
+#endif
+
+#ifndef ES_SPI1_SCK_GPIO_FUNC
+#define ES_SPI1_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PORT
+#define ES_SPI1_SCK_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PIN
+#define ES_SPI1_SCK_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_SPI1_SCK_PIN
+#ifdef ES_PIN_GPIO_C_1
+#define ES_SPI1_SCK_PIN ES_PIN_GPIO_C_1
+#endif
+#endif
+
+#ifndef ES_SPI1_SCK_GPIO_FUNC
+#define ES_SPI1_SCK_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PORT
+#define ES_SPI1_SCK_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_SCK_GPIO_PIN
+#define ES_SPI1_SCK_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_SPI1_SCK_PIN
+#ifdef ES_PIN_GPIO_B_13
+#define ES_SPI1_SCK_PIN ES_PIN_GPIO_B_13
+#endif
+#endif
+
+#ifndef ES_SPI2_SCK_GPIO_FUNC
+#define ES_SPI2_SCK_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_SPI2_SCK_GPIO_PORT
+#define ES_SPI2_SCK_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI2_SCK_GPIO_PIN
+#define ES_SPI2_SCK_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_SPI2_SCK_PIN
+#ifdef ES_PIN_GPIO_C_5
+#define ES_SPI2_SCK_PIN ES_PIN_GPIO_C_5
+#endif
+#endif
+
+#ifndef ES_SPI2_SCK_GPIO_FUNC
+#define ES_SPI2_SCK_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_SPI2_SCK_GPIO_PORT
+#define ES_SPI2_SCK_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI2_SCK_GPIO_PIN
+#define ES_SPI2_SCK_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_SPI2_SCK_PIN
+#ifdef ES_PIN_GPIO_B_3
+#define ES_SPI2_SCK_PIN ES_PIN_GPIO_B_3
+#endif
+#endif
+
+
+/* SPI_NSS */
+
+
+#ifndef ES_SPI0_NSS_GPIO_FUNC
+#define ES_SPI0_NSS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PORT
+#define ES_SPI0_NSS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PIN
+#define ES_SPI0_NSS_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_SPI0_NSS_PIN
+#ifdef ES_PIN_GPIO_A_15
+#define ES_SPI0_NSS_PIN ES_PIN_GPIO_A_15
+#endif
+#endif
+
+#ifndef ES_SPI0_NSS_GPIO_FUNC
+#define ES_SPI0_NSS_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PORT
+#define ES_SPI0_NSS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI0_NSS_GPIO_PIN
+#define ES_SPI0_NSS_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI0_NSS_PIN
+#ifdef ES_PIN_GPIO_A_4
+#define ES_SPI0_NSS_PIN ES_PIN_GPIO_A_4
+#endif
+#endif
+
+#ifndef ES_SPI1_NSS_GPIO_FUNC
+#define ES_SPI1_NSS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PORT
+#define ES_SPI1_NSS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PIN
+#define ES_SPI1_NSS_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_SPI1_NSS_PIN
+#ifdef ES_PIN_GPIO_C_0
+#define ES_SPI1_NSS_PIN ES_PIN_GPIO_C_0
+#endif
+#endif
+
+#ifndef ES_SPI1_NSS_GPIO_FUNC
+#define ES_SPI1_NSS_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PORT
+#define ES_SPI1_NSS_GPIO_PORT GPIOB
+#endif
+#ifndef ES_SPI1_NSS_GPIO_PIN
+#define ES_SPI1_NSS_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_SPI1_NSS_PIN
+#ifdef ES_PIN_GPIO_B_12
+#define ES_SPI1_NSS_PIN ES_PIN_GPIO_B_12
+#endif
+#endif
+
+#ifndef ES_SPI2_NSS_GPIO_FUNC
+#define ES_SPI2_NSS_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_SPI2_NSS_GPIO_PORT
+#define ES_SPI2_NSS_GPIO_PORT GPIOC
+#endif
+#ifndef ES_SPI2_NSS_GPIO_PIN
+#define ES_SPI2_NSS_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_SPI2_NSS_PIN
+#ifdef ES_PIN_GPIO_C_4
+#define ES_SPI2_NSS_PIN ES_PIN_GPIO_C_4
+#endif
+#endif
+
+#ifndef ES_SPI2_NSS_GPIO_FUNC
+#define ES_SPI2_NSS_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_SPI2_NSS_GPIO_PORT
+#define ES_SPI2_NSS_GPIO_PORT GPIOA
+#endif
+#ifndef ES_SPI2_NSS_GPIO_PIN
+#define ES_SPI2_NSS_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_SPI2_NSS_PIN
+#ifdef ES_PIN_GPIO_A_15
+#define ES_SPI2_NSS_PIN ES_PIN_GPIO_A_15
+#endif
+#endif
+
+
+/* CAN_TX */
+
+
+#ifndef ES_CAN0_TX_GPIO_FUNC
+#define ES_CAN0_TX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_CAN0_TX_GPIO_PORT
+#define ES_CAN0_TX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_CAN0_TX_GPIO_PIN
+#define ES_CAN0_TX_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_CAN0_TX_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_CAN0_TX_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+
+/* CAN_RX */
+
+
+#ifndef ES_CAN0_RX_GPIO_FUNC
+#define ES_CAN0_RX_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_CAN0_RX_GPIO_PORT
+#define ES_CAN0_RX_GPIO_PORT GPIOB
+#endif
+#ifndef ES_CAN0_RX_GPIO_PIN
+#define ES_CAN0_RX_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_CAN0_RX_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_CAN0_RX_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+
+/* AD16C4T_CH1 */
+
+
+#ifndef ES_AD16C4T0_CH1_GPIO_FUNC
+#define ES_AD16C4T0_CH1_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PORT
+#define ES_AD16C4T0_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PIN
+#define ES_AD16C4T0_CH1_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_AD16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_A_7
+#define ES_AD16C4T0_CH1_PIN ES_PIN_GPIO_A_7
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH1_GPIO_FUNC
+#define ES_AD16C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PORT
+#define ES_AD16C4T0_CH1_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH1_GPIO_PIN
+#define ES_AD16C4T0_CH1_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_AD16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_E_9
+#define ES_AD16C4T0_CH1_PIN ES_PIN_GPIO_E_9
+#endif
+#endif
+
+#ifndef ES_AD16C4T1_CH1_GPIO_FUNC
+#define ES_AD16C4T1_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T1_CH1_GPIO_PORT
+#define ES_AD16C4T1_CH1_GPIO_PORT GPIOC
+#endif
+#ifndef ES_AD16C4T1_CH1_GPIO_PIN
+#define ES_AD16C4T1_CH1_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_AD16C4T1_CH1_PIN
+#ifdef ES_PIN_GPIO_C_6
+#define ES_AD16C4T1_CH1_PIN ES_PIN_GPIO_C_6
+#endif
+#endif
+
+
+/* AD16C4T_CH2 */
+
+
+#ifndef ES_AD16C4T0_CH2_GPIO_FUNC
+#define ES_AD16C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH2_GPIO_PORT
+#define ES_AD16C4T0_CH2_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH2_GPIO_PIN
+#define ES_AD16C4T0_CH2_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_AD16C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_E_11
+#define ES_AD16C4T0_CH2_PIN ES_PIN_GPIO_E_11
+#endif
+#endif
+
+#ifndef ES_AD16C4T1_CH2_GPIO_FUNC
+#define ES_AD16C4T1_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T1_CH2_GPIO_PORT
+#define ES_AD16C4T1_CH2_GPIO_PORT GPIOC
+#endif
+#ifndef ES_AD16C4T1_CH2_GPIO_PIN
+#define ES_AD16C4T1_CH2_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_AD16C4T1_CH2_PIN
+#ifdef ES_PIN_GPIO_C_7
+#define ES_AD16C4T1_CH2_PIN ES_PIN_GPIO_C_7
+#endif
+#endif
+
+
+/* AD16C4T_CH3 */
+
+
+#ifndef ES_AD16C4T0_CH3_GPIO_FUNC
+#define ES_AD16C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH3_GPIO_PORT
+#define ES_AD16C4T0_CH3_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH3_GPIO_PIN
+#define ES_AD16C4T0_CH3_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_AD16C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_E_13
+#define ES_AD16C4T0_CH3_PIN ES_PIN_GPIO_E_13
+#endif
+#endif
+
+#ifndef ES_AD16C4T1_CH3_GPIO_FUNC
+#define ES_AD16C4T1_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T1_CH3_GPIO_PORT
+#define ES_AD16C4T1_CH3_GPIO_PORT GPIOC
+#endif
+#ifndef ES_AD16C4T1_CH3_GPIO_PIN
+#define ES_AD16C4T1_CH3_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_AD16C4T1_CH3_PIN
+#ifdef ES_PIN_GPIO_C_8
+#define ES_AD16C4T1_CH3_PIN ES_PIN_GPIO_C_8
+#endif
+#endif
+
+
+/* AD16C4T_CH4 */
+
+
+#ifndef ES_AD16C4T0_CH4_GPIO_FUNC
+#define ES_AD16C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH4_GPIO_PORT
+#define ES_AD16C4T0_CH4_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH4_GPIO_PIN
+#define ES_AD16C4T0_CH4_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_AD16C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_E_14
+#define ES_AD16C4T0_CH4_PIN ES_PIN_GPIO_E_14
+#endif
+#endif
+
+
+/* AD16C4T_CH1N */
+
+
+#ifndef ES_AD16C4T0_CH1N_GPIO_FUNC
+#define ES_AD16C4T0_CH1N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PORT
+#define ES_AD16C4T0_CH1N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PIN
+#define ES_AD16C4T0_CH1N_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_PIN
+#ifdef ES_PIN_GPIO_B_13
+#define ES_AD16C4T0_CH1N_PIN ES_PIN_GPIO_B_13
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_GPIO_FUNC
+#define ES_AD16C4T0_CH1N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PORT
+#define ES_AD16C4T0_CH1N_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH1N_GPIO_PIN
+#define ES_AD16C4T0_CH1N_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_AD16C4T0_CH1N_PIN
+#ifdef ES_PIN_GPIO_E_8
+#define ES_AD16C4T0_CH1N_PIN ES_PIN_GPIO_E_8
+#endif
+#endif
+
+#ifndef ES_AD16C4T1_CH1N_GPIO_FUNC
+#define ES_AD16C4T1_CH1N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T1_CH1N_GPIO_PORT
+#define ES_AD16C4T1_CH1N_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T1_CH1N_GPIO_PIN
+#define ES_AD16C4T1_CH1N_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_AD16C4T1_CH1N_PIN
+#ifdef ES_PIN_GPIO_A_7
+#define ES_AD16C4T1_CH1N_PIN ES_PIN_GPIO_A_7
+#endif
+#endif
+
+
+/* AD16C4T_CH2N */
+
+
+#ifndef ES_AD16C4T0_CH2N_GPIO_FUNC
+#define ES_AD16C4T0_CH2N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PORT
+#define ES_AD16C4T0_CH2N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PIN
+#define ES_AD16C4T0_CH2N_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_PIN
+#ifdef ES_PIN_GPIO_B_14
+#define ES_AD16C4T0_CH2N_PIN ES_PIN_GPIO_B_14
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_GPIO_FUNC
+#define ES_AD16C4T0_CH2N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PORT
+#define ES_AD16C4T0_CH2N_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH2N_GPIO_PIN
+#define ES_AD16C4T0_CH2N_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_AD16C4T0_CH2N_PIN
+#ifdef ES_PIN_GPIO_E_10
+#define ES_AD16C4T0_CH2N_PIN ES_PIN_GPIO_E_10
+#endif
+#endif
+
+#ifndef ES_AD16C4T1_CH2N_GPIO_FUNC
+#define ES_AD16C4T1_CH2N_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_AD16C4T1_CH2N_GPIO_PORT
+#define ES_AD16C4T1_CH2N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T1_CH2N_GPIO_PIN
+#define ES_AD16C4T1_CH2N_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_AD16C4T1_CH2N_PIN
+#ifdef ES_PIN_GPIO_B_0
+#define ES_AD16C4T1_CH2N_PIN ES_PIN_GPIO_B_0
+#endif
+#endif
+
+
+/* AD16C4T_CH3N */
+
+
+#ifndef ES_AD16C4T0_CH3N_GPIO_FUNC
+#define ES_AD16C4T0_CH3N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PORT
+#define ES_AD16C4T0_CH3N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PIN
+#define ES_AD16C4T0_CH3N_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_PIN
+#ifdef ES_PIN_GPIO_B_15
+#define ES_AD16C4T0_CH3N_PIN ES_PIN_GPIO_B_15
+#endif
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_GPIO_FUNC
+#define ES_AD16C4T0_CH3N_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PORT
+#define ES_AD16C4T0_CH3N_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_CH3N_GPIO_PIN
+#define ES_AD16C4T0_CH3N_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_AD16C4T0_CH3N_PIN
+#ifdef ES_PIN_GPIO_E_12
+#define ES_AD16C4T0_CH3N_PIN ES_PIN_GPIO_E_12
+#endif
+#endif
+
+#ifndef ES_AD16C4T1_CH3N_GPIO_FUNC
+#define ES_AD16C4T1_CH3N_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_AD16C4T1_CH3N_GPIO_PORT
+#define ES_AD16C4T1_CH3N_GPIO_PORT GPIOB
+#endif
+#ifndef ES_AD16C4T1_CH3N_GPIO_PIN
+#define ES_AD16C4T1_CH3N_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_AD16C4T1_CH3N_PIN
+#ifdef ES_PIN_GPIO_B_1
+#define ES_AD16C4T1_CH3N_PIN ES_PIN_GPIO_B_1
+#endif
+#endif
+
+
+/* AD16C4T_CH4N */
+
+
+
+/* AD16C4T_ET */
+
+
+#ifndef ES_AD16C4T0_ET_GPIO_FUNC
+#define ES_AD16C4T0_ET_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_AD16C4T0_ET_GPIO_PORT
+#define ES_AD16C4T0_ET_GPIO_PORT GPIOE
+#endif
+#ifndef ES_AD16C4T0_ET_GPIO_PIN
+#define ES_AD16C4T0_ET_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_AD16C4T0_ET_PIN
+#ifdef ES_PIN_GPIO_E_7
+#define ES_AD16C4T0_ET_PIN ES_PIN_GPIO_E_7
+#endif
+#endif
+
+#ifndef ES_AD16C4T1_ET_GPIO_FUNC
+#define ES_AD16C4T1_ET_GPIO_FUNC GPIO_FUNC_4
+#endif
+#ifndef ES_AD16C4T1_ET_GPIO_PORT
+#define ES_AD16C4T1_ET_GPIO_PORT GPIOA
+#endif
+#ifndef ES_AD16C4T1_ET_GPIO_PIN
+#define ES_AD16C4T1_ET_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_AD16C4T1_ET_PIN
+#ifdef ES_PIN_GPIO_A_0
+#define ES_AD16C4T1_ET_PIN ES_PIN_GPIO_A_0
+#endif
+#endif
+
+
+/* GP32C4T_CH1 */
+
+
+#ifndef ES_GP32C4T0_CH1_GPIO_FUNC
+#define ES_GP32C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH1_GPIO_PORT
+#define ES_GP32C4T0_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T0_CH1_GPIO_PIN
+#define ES_GP32C4T0_CH1_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_GP32C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_A_0
+#define ES_GP32C4T0_CH1_PIN ES_PIN_GPIO_A_0
+#endif
+#endif
+
+#ifndef ES_GP32C4T0_CH1_GPIO_FUNC
+#define ES_GP32C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH1_GPIO_PORT
+#define ES_GP32C4T0_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T0_CH1_GPIO_PIN
+#define ES_GP32C4T0_CH1_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_GP32C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_A_15
+#define ES_GP32C4T0_CH1_PIN ES_PIN_GPIO_A_15
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH1_GPIO_FUNC
+#define ES_GP32C4T1_CH1_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP32C4T1_CH1_GPIO_PORT
+#define ES_GP32C4T1_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T1_CH1_GPIO_PIN
+#define ES_GP32C4T1_CH1_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_GP32C4T1_CH1_PIN
+#ifdef ES_PIN_GPIO_A_6
+#define ES_GP32C4T1_CH1_PIN ES_PIN_GPIO_A_6
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH1_GPIO_FUNC
+#define ES_GP32C4T1_CH1_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP32C4T1_CH1_GPIO_PORT
+#define ES_GP32C4T1_CH1_GPIO_PORT GPIOC
+#endif
+#ifndef ES_GP32C4T1_CH1_GPIO_PIN
+#define ES_GP32C4T1_CH1_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_GP32C4T1_CH1_PIN
+#ifdef ES_PIN_GPIO_C_6
+#define ES_GP32C4T1_CH1_PIN ES_PIN_GPIO_C_6
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH1_GPIO_FUNC
+#define ES_GP32C4T1_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T1_CH1_GPIO_PORT
+#define ES_GP32C4T1_CH1_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP32C4T1_CH1_GPIO_PIN
+#define ES_GP32C4T1_CH1_GPIO_PIN GPIO_PIN_4
+#endif
+
+#ifndef ES_GP32C4T1_CH1_PIN
+#ifdef ES_PIN_GPIO_B_4
+#define ES_GP32C4T1_CH1_PIN ES_PIN_GPIO_B_4
+#endif
+#endif
+
+
+/* GP32C4T_CH2 */
+
+
+#ifndef ES_GP32C4T0_CH2_GPIO_FUNC
+#define ES_GP32C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH2_GPIO_PORT
+#define ES_GP32C4T0_CH2_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T0_CH2_GPIO_PIN
+#define ES_GP32C4T0_CH2_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_GP32C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_A_1
+#define ES_GP32C4T0_CH2_PIN ES_PIN_GPIO_A_1
+#endif
+#endif
+
+#ifndef ES_GP32C4T0_CH2_GPIO_FUNC
+#define ES_GP32C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH2_GPIO_PORT
+#define ES_GP32C4T0_CH2_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP32C4T0_CH2_GPIO_PIN
+#define ES_GP32C4T0_CH2_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_GP32C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_B_3
+#define ES_GP32C4T0_CH2_PIN ES_PIN_GPIO_B_3
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH2_GPIO_FUNC
+#define ES_GP32C4T1_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T1_CH2_GPIO_PORT
+#define ES_GP32C4T1_CH2_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP32C4T1_CH2_GPIO_PIN
+#define ES_GP32C4T1_CH2_GPIO_PIN GPIO_PIN_5
+#endif
+
+#ifndef ES_GP32C4T1_CH2_PIN
+#ifdef ES_PIN_GPIO_B_5
+#define ES_GP32C4T1_CH2_PIN ES_PIN_GPIO_B_5
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH2_GPIO_FUNC
+#define ES_GP32C4T1_CH2_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP32C4T1_CH2_GPIO_PORT
+#define ES_GP32C4T1_CH2_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T1_CH2_GPIO_PIN
+#define ES_GP32C4T1_CH2_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_GP32C4T1_CH2_PIN
+#ifdef ES_PIN_GPIO_A_7
+#define ES_GP32C4T1_CH2_PIN ES_PIN_GPIO_A_7
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH2_GPIO_FUNC
+#define ES_GP32C4T1_CH2_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP32C4T1_CH2_GPIO_PORT
+#define ES_GP32C4T1_CH2_GPIO_PORT GPIOC
+#endif
+#ifndef ES_GP32C4T1_CH2_GPIO_PIN
+#define ES_GP32C4T1_CH2_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_GP32C4T1_CH2_PIN
+#ifdef ES_PIN_GPIO_C_7
+#define ES_GP32C4T1_CH2_PIN ES_PIN_GPIO_C_7
+#endif
+#endif
+
+
+/* GP32C4T_CH3 */
+
+
+#ifndef ES_GP32C4T0_CH3_GPIO_FUNC
+#define ES_GP32C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH3_GPIO_PORT
+#define ES_GP32C4T0_CH3_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T0_CH3_GPIO_PIN
+#define ES_GP32C4T0_CH3_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_GP32C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_A_2
+#define ES_GP32C4T0_CH3_PIN ES_PIN_GPIO_A_2
+#endif
+#endif
+
+#ifndef ES_GP32C4T0_CH3_GPIO_FUNC
+#define ES_GP32C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH3_GPIO_PORT
+#define ES_GP32C4T0_CH3_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP32C4T0_CH3_GPIO_PIN
+#define ES_GP32C4T0_CH3_GPIO_PIN GPIO_PIN_10
+#endif
+
+#ifndef ES_GP32C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_B_10
+#define ES_GP32C4T0_CH3_PIN ES_PIN_GPIO_B_10
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH3_GPIO_FUNC
+#define ES_GP32C4T1_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T1_CH3_GPIO_PORT
+#define ES_GP32C4T1_CH3_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP32C4T1_CH3_GPIO_PIN
+#define ES_GP32C4T1_CH3_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_GP32C4T1_CH3_PIN
+#ifdef ES_PIN_GPIO_B_0
+#define ES_GP32C4T1_CH3_PIN ES_PIN_GPIO_B_0
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH3_GPIO_FUNC
+#define ES_GP32C4T1_CH3_GPIO_FUNC GPIO_FUNC_3
+#endif
+#ifndef ES_GP32C4T1_CH3_GPIO_PORT
+#define ES_GP32C4T1_CH3_GPIO_PORT GPIOC
+#endif
+#ifndef ES_GP32C4T1_CH3_GPIO_PIN
+#define ES_GP32C4T1_CH3_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_GP32C4T1_CH3_PIN
+#ifdef ES_PIN_GPIO_C_8
+#define ES_GP32C4T1_CH3_PIN ES_PIN_GPIO_C_8
+#endif
+#endif
+
+
+/* GP32C4T_CH4 */
+
+
+#ifndef ES_GP32C4T0_CH4_GPIO_FUNC
+#define ES_GP32C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH4_GPIO_PORT
+#define ES_GP32C4T0_CH4_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP32C4T0_CH4_GPIO_PIN
+#define ES_GP32C4T0_CH4_GPIO_PIN GPIO_PIN_11
+#endif
+
+#ifndef ES_GP32C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_B_11
+#define ES_GP32C4T0_CH4_PIN ES_PIN_GPIO_B_11
+#endif
+#endif
+
+#ifndef ES_GP32C4T0_CH4_GPIO_FUNC
+#define ES_GP32C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T0_CH4_GPIO_PORT
+#define ES_GP32C4T0_CH4_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T0_CH4_GPIO_PIN
+#define ES_GP32C4T0_CH4_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_GP32C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_A_3
+#define ES_GP32C4T0_CH4_PIN ES_PIN_GPIO_A_3
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_CH4_GPIO_FUNC
+#define ES_GP32C4T1_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T1_CH4_GPIO_PORT
+#define ES_GP32C4T1_CH4_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP32C4T1_CH4_GPIO_PIN
+#define ES_GP32C4T1_CH4_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_GP32C4T1_CH4_PIN
+#ifdef ES_PIN_GPIO_B_1
+#define ES_GP32C4T1_CH4_PIN ES_PIN_GPIO_B_1
+#endif
+#endif
+
+
+/* GP32C4T_ET */
+
+
+#ifndef ES_GP32C4T0_ET_GPIO_FUNC
+#define ES_GP32C4T0_ET_GPIO_FUNC GPIO_FUNC_6
+#endif
+#ifndef ES_GP32C4T0_ET_GPIO_PORT
+#define ES_GP32C4T0_ET_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T0_ET_GPIO_PIN
+#define ES_GP32C4T0_ET_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_GP32C4T0_ET_PIN
+#ifdef ES_PIN_GPIO_A_0
+#define ES_GP32C4T0_ET_PIN ES_PIN_GPIO_A_0
+#endif
+#endif
+
+#ifndef ES_GP32C4T0_ET_GPIO_FUNC
+#define ES_GP32C4T0_ET_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_GP32C4T0_ET_GPIO_PORT
+#define ES_GP32C4T0_ET_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP32C4T0_ET_GPIO_PIN
+#define ES_GP32C4T0_ET_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_GP32C4T0_ET_PIN
+#ifdef ES_PIN_GPIO_A_15
+#define ES_GP32C4T0_ET_PIN ES_PIN_GPIO_A_15
+#endif
+#endif
+
+#ifndef ES_GP32C4T1_ET_GPIO_FUNC
+#define ES_GP32C4T1_ET_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP32C4T1_ET_GPIO_PORT
+#define ES_GP32C4T1_ET_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP32C4T1_ET_GPIO_PIN
+#define ES_GP32C4T1_ET_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_GP32C4T1_ET_PIN
+#ifdef ES_PIN_GPIO_D_2
+#define ES_GP32C4T1_ET_PIN ES_PIN_GPIO_D_2
+#endif
+#endif
+
+
+/* GP16C4T_CH1 */
+
+
+#ifndef ES_GP16C4T0_CH1_GPIO_FUNC
+#define ES_GP16C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PORT
+#define ES_GP16C4T0_CH1_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PIN
+#define ES_GP16C4T0_CH1_GPIO_PIN GPIO_PIN_6
+#endif
+
+#ifndef ES_GP16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_B_6
+#define ES_GP16C4T0_CH1_PIN ES_PIN_GPIO_B_6
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH1_GPIO_FUNC
+#define ES_GP16C4T0_CH1_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PORT
+#define ES_GP16C4T0_CH1_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH1_GPIO_PIN
+#define ES_GP16C4T0_CH1_GPIO_PIN GPIO_PIN_12
+#endif
+
+#ifndef ES_GP16C4T0_CH1_PIN
+#ifdef ES_PIN_GPIO_D_12
+#define ES_GP16C4T0_CH1_PIN ES_PIN_GPIO_D_12
+#endif
+#endif
+
+#ifndef ES_GP16C4T1_CH1_GPIO_FUNC
+#define ES_GP16C4T1_CH1_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_GP16C4T1_CH1_GPIO_PORT
+#define ES_GP16C4T1_CH1_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C4T1_CH1_GPIO_PIN
+#define ES_GP16C4T1_CH1_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_GP16C4T1_CH1_PIN
+#ifdef ES_PIN_GPIO_A_0
+#define ES_GP16C4T1_CH1_PIN ES_PIN_GPIO_A_0
+#endif
+#endif
+
+
+/* GP16C4T_CH2 */
+
+
+#ifndef ES_GP16C4T0_CH2_GPIO_FUNC
+#define ES_GP16C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PORT
+#define ES_GP16C4T0_CH2_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PIN
+#define ES_GP16C4T0_CH2_GPIO_PIN GPIO_PIN_7
+#endif
+
+#ifndef ES_GP16C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_B_7
+#define ES_GP16C4T0_CH2_PIN ES_PIN_GPIO_B_7
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH2_GPIO_FUNC
+#define ES_GP16C4T0_CH2_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PORT
+#define ES_GP16C4T0_CH2_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH2_GPIO_PIN
+#define ES_GP16C4T0_CH2_GPIO_PIN GPIO_PIN_13
+#endif
+
+#ifndef ES_GP16C4T0_CH2_PIN
+#ifdef ES_PIN_GPIO_D_13
+#define ES_GP16C4T0_CH2_PIN ES_PIN_GPIO_D_13
+#endif
+#endif
+
+#ifndef ES_GP16C4T1_CH2_GPIO_FUNC
+#define ES_GP16C4T1_CH2_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_GP16C4T1_CH2_GPIO_PORT
+#define ES_GP16C4T1_CH2_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C4T1_CH2_GPIO_PIN
+#define ES_GP16C4T1_CH2_GPIO_PIN GPIO_PIN_1
+#endif
+
+#ifndef ES_GP16C4T1_CH2_PIN
+#ifdef ES_PIN_GPIO_A_1
+#define ES_GP16C4T1_CH2_PIN ES_PIN_GPIO_A_1
+#endif
+#endif
+
+
+/* GP16C4T_CH3 */
+
+
+#ifndef ES_GP16C4T0_CH3_GPIO_FUNC
+#define ES_GP16C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PORT
+#define ES_GP16C4T0_CH3_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PIN
+#define ES_GP16C4T0_CH3_GPIO_PIN GPIO_PIN_8
+#endif
+
+#ifndef ES_GP16C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_B_8
+#define ES_GP16C4T0_CH3_PIN ES_PIN_GPIO_B_8
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH3_GPIO_FUNC
+#define ES_GP16C4T0_CH3_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PORT
+#define ES_GP16C4T0_CH3_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH3_GPIO_PIN
+#define ES_GP16C4T0_CH3_GPIO_PIN GPIO_PIN_14
+#endif
+
+#ifndef ES_GP16C4T0_CH3_PIN
+#ifdef ES_PIN_GPIO_D_14
+#define ES_GP16C4T0_CH3_PIN ES_PIN_GPIO_D_14
+#endif
+#endif
+
+#ifndef ES_GP16C4T1_CH3_GPIO_FUNC
+#define ES_GP16C4T1_CH3_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_GP16C4T1_CH3_GPIO_PORT
+#define ES_GP16C4T1_CH3_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C4T1_CH3_GPIO_PIN
+#define ES_GP16C4T1_CH3_GPIO_PIN GPIO_PIN_2
+#endif
+
+#ifndef ES_GP16C4T1_CH3_PIN
+#ifdef ES_PIN_GPIO_A_2
+#define ES_GP16C4T1_CH3_PIN ES_PIN_GPIO_A_2
+#endif
+#endif
+
+
+/* GP16C4T_CH4 */
+
+
+#ifndef ES_GP16C4T0_CH4_GPIO_FUNC
+#define ES_GP16C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PORT
+#define ES_GP16C4T0_CH4_GPIO_PORT GPIOB
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PIN
+#define ES_GP16C4T0_CH4_GPIO_PIN GPIO_PIN_9
+#endif
+
+#ifndef ES_GP16C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_B_9
+#define ES_GP16C4T0_CH4_PIN ES_PIN_GPIO_B_9
+#endif
+#endif
+
+#ifndef ES_GP16C4T0_CH4_GPIO_FUNC
+#define ES_GP16C4T0_CH4_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PORT
+#define ES_GP16C4T0_CH4_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T0_CH4_GPIO_PIN
+#define ES_GP16C4T0_CH4_GPIO_PIN GPIO_PIN_15
+#endif
+
+#ifndef ES_GP16C4T0_CH4_PIN
+#ifdef ES_PIN_GPIO_D_15
+#define ES_GP16C4T0_CH4_PIN ES_PIN_GPIO_D_15
+#endif
+#endif
+
+#ifndef ES_GP16C4T1_CH4_GPIO_FUNC
+#define ES_GP16C4T1_CH4_GPIO_FUNC GPIO_FUNC_5
+#endif
+#ifndef ES_GP16C4T1_CH4_GPIO_PORT
+#define ES_GP16C4T1_CH4_GPIO_PORT GPIOA
+#endif
+#ifndef ES_GP16C4T1_CH4_GPIO_PIN
+#define ES_GP16C4T1_CH4_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_GP16C4T1_CH4_PIN
+#ifdef ES_PIN_GPIO_A_3
+#define ES_GP16C4T1_CH4_PIN ES_PIN_GPIO_A_3
+#endif
+#endif
+
+
+/* GP16C4T_ET */
+
+
+#ifndef ES_GP16C4T0_ET_GPIO_FUNC
+#define ES_GP16C4T0_ET_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T0_ET_GPIO_PORT
+#define ES_GP16C4T0_ET_GPIO_PORT GPIOE
+#endif
+#ifndef ES_GP16C4T0_ET_GPIO_PIN
+#define ES_GP16C4T0_ET_GPIO_PIN GPIO_PIN_0
+#endif
+
+#ifndef ES_GP16C4T0_ET_PIN
+#ifdef ES_PIN_GPIO_E_0
+#define ES_GP16C4T0_ET_PIN ES_PIN_GPIO_E_0
+#endif
+#endif
+
+#ifndef ES_GP16C4T1_ET_GPIO_FUNC
+#define ES_GP16C4T1_ET_GPIO_FUNC GPIO_FUNC_2
+#endif
+#ifndef ES_GP16C4T1_ET_GPIO_PORT
+#define ES_GP16C4T1_ET_GPIO_PORT GPIOD
+#endif
+#ifndef ES_GP16C4T1_ET_GPIO_PIN
+#define ES_GP16C4T1_ET_GPIO_PIN GPIO_PIN_3
+#endif
+
+#ifndef ES_GP16C4T1_ET_PIN
+#ifdef ES_PIN_GPIO_D_3
+#define ES_GP16C4T1_ET_PIN ES_PIN_GPIO_D_3
+#endif
+#endif
+
+
+/* GP16C2T_CH1 */
+
+
+
+/* GP16C2T_CH2 */
+
+
+
+/* GP16C2T_CH1N */
+
+
+
+/* GP16C2T_CH2N */
+
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_pm.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_pm.h
new file mode 100644
index 0000000000..580268312c
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_pm.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_PM_H__
+#define __ES_CONF_INFO_PM_H__
+
+#include <ald_cmu.h>
+#include <ald_pmu.h>
+
+#define ES_PMU_SAVE_LOAD_UART
+
+/* PM 配置 */
+
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_pwm.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_pwm.h
new file mode 100644
index 0000000000..86010a80ce
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_pwm.h
@@ -0,0 +1,78 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_PWM_H__
+#define __ES_CONF_INFO_PWM_H__
+
+#include "es_conf_info_map.h"
+#include <ald_cmu.h>
+#include <ald_timer.h>
+#include <ald_gpio.h>
+
+
+#define ES_C_PWM_OC_POL_HIGH TIMER_OC_POLARITY_HIGH
+#define ES_C_PWM_OC_POL_LOW TIMER_OC_POLARITY_LOW
+
+#define ES_C_PWM_OC_MODE_PWM1 TIMER_OC_MODE_PWM1
+#define ES_C_PWM_OC_MODE_PWM2 TIMER_OC_MODE_PWM2
+
+
+
+/* PWM 配置 */
+
+
+/* codes_main */
+
+
+
+#define ES_PWM_OC_POLARITY ES_C_PWM_OC_POL_HIGH
+#define ES_PWM_OC_MODE ES_C_PWM_OC_MODE_PWM2
+
+#ifndef ES_PWM_OC_POLARITY
+#define ES_PWM_OC_POLARITY ES_C_PWM_OC_POL_HIGH
+#endif
+#ifndef ES_PWM_OC_MODE
+#define ES_PWM_OC_MODE ES_C_PWM_OC_MODE_PWM2
+#endif
+
+#ifndef ES_DEVICE_NAME_AD16C4T0_PWM
+#define ES_DEVICE_NAME_AD16C4T0_PWM "pwm0"
+#endif
+#ifndef ES_DEVICE_NAME_AD16C4T1_PWM
+#define ES_DEVICE_NAME_AD16C4T1_PWM "pwm1"
+#endif
+#ifndef ES_DEVICE_NAME_GP32C4T0_PWM
+#define ES_DEVICE_NAME_GP32C4T0_PWM "pwm2"
+#endif
+#ifndef ES_DEVICE_NAME_GP32C4T1_PWM
+#define ES_DEVICE_NAME_GP32C4T1_PWM "pwm3"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C4T0_PWM
+#define ES_DEVICE_NAME_GP16C4T0_PWM "pwm4"
+#endif
+#ifndef ES_DEVICE_NAME_GP16C4T1_PWM
+#define ES_DEVICE_NAME_GP16C4T1_PWM "pwm5"
+#endif
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_rtc.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_rtc.h
new file mode 100644
index 0000000000..2aa8faf9d7
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_rtc.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_RTC_H__
+#define __ES_CONF_INFO_RTC_H__
+
+#include <ald_cmu.h>
+#include <ald_rtc.h>
+
+/* RTC 配置 */
+
+#define ES_C_RTC_SOURCE_LRC RTC_SOURCE_LRC
+#define ES_C_RTC_SOURCE_LOSC RTC_SOURCE_LOSC
+
+#define ES_RTC_CLK_SOURCE ES_C_RTC_SOURCE_LOSC
+
+
+
+
+/* codes_main */
+
+
+#ifndef ES_DEVICE_NAME_RTC
+#define ES_DEVICE_NAME_RTC "rtc"
+#endif
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_select.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_select.h
new file mode 100644
index 0000000000..06a28d6fd0
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_select.h
@@ -0,0 +1,43 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_SELECT_H__
+#define __ES_CONF_INFO_SELECT_H__
+
+
+#define ES_C_ENABLE 1
+#define ES_C_DISABLE 0
+
+
+/* codes_main */
+
+#ifndef ES_USE_ASSERT
+#define ES_USE_ASSERT ES_C_DISABLE
+#endif
+
+
+#if ES_USE_ASSERT
+ #define USE_ASSERT
+#endif
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_spi.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_spi.h
new file mode 100644
index 0000000000..c9cf895aeb
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_spi.h
@@ -0,0 +1,159 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_SPI_H__
+#define __ES_CONF_INFO_SPI_H__
+
+#include "es_conf_info_map.h"
+#include <ald_spi.h>
+#include <ald_gpio.h>
+#include <ald_cmu.h>
+
+/* SPI 配置 */
+
+#define SPI_BUS_CONFIG(_CONF_,_I_) do{_CONF_.mode = 0U; \
+ _CONF_.mode |= ( ES_SPI##_I_##_MASTER_SLAVE | \
+ ES_SPI##_I_##_WIRE_3_4 | \
+ ES_SPI##_I_##_CPHA_1_2 | \
+ ES_SPI##_I_##_CPOL_H_L | \
+ ES_SPI##_I_##_CS | \
+ ES_SPI##_I_##_M_L_SB ); \
+ _CONF_.data_width = ES_SPI##_I_##_DATA_W; \
+ _CONF_.max_hz = ES_SPI##_I_##_MAX_HZ; \
+ }while(0)
+
+
+// spi_config.mode &= ~RT_SPI_SLAVE; /* 主机模式 */
+// spi_config.mode &= ~RT_SPI_3WIRE; /* 4线,双向传输 */
+// spi_config.mode |= RT_SPI_CPHA; /* 第二边沿采样 */
+// spi_config.mode |= RT_SPI_CPOL; /* 空闲高电平 */
+// spi_config.mode |= RT_SPI_NO_CS; /* 禁用软件从机选择管理 */
+// spi_config.mode |= RT_SPI_MSB; /* 高位在前 */
+// spi_config.data_width = 8; /* 数据长度:8 */
+// spi_config.max_hz = 2000000; /* 最快时钟频率 */
+
+#define ES_C_SPI_CLK_POL_HIGH RT_SPI_CPOL
+#define ES_C_SPI_CLK_POL_LOW !RT_SPI_CPOL
+
+#define ES_C_SPI_CLK_PHA_FIRST !RT_SPI_CPHA
+#define ES_C_SPI_CLK_PHA_SECOND RT_SPI_CPHA
+
+#define ES_C_SPI_MSB RT_SPI_MSB
+#define ES_C_SPI_LSB RT_SPI_LSB
+
+#define ES_C_SPI_CS_LOW_LEVEL 0
+#define ES_C_SPI_CS_HIGH_LEVEL 1
+
+/* codes_main */
+
+
+#ifndef ES_DEVICE_NAME_SPI0_BUS
+#define ES_DEVICE_NAME_SPI0_BUS "spi0"
+#endif
+#ifndef ES_DEVICE_NAME_SPI0_DEV0
+#define ES_DEVICE_NAME_SPI0_DEV0 "spi00"
+#endif
+
+#ifndef ES_DEVICE_NAME_SPI1_BUS
+#define ES_DEVICE_NAME_SPI1_BUS "spi1"
+#endif
+#ifndef ES_DEVICE_NAME_SPI1_DEV0
+#define ES_DEVICE_NAME_SPI1_DEV0 "spi10"
+#endif
+
+#ifndef ES_DEVICE_NAME_SPI2_BUS
+#define ES_DEVICE_NAME_SPI2_BUS "spi2"
+#endif
+#ifndef ES_DEVICE_NAME_SPI2_DEV0
+#define ES_DEVICE_NAME_SPI2_DEV0 "spi20"
+#endif
+
+
+#define ES_SPI_CS_LEVEL ES_C_SPI_CS_LOW_LEVEL
+
+#ifndef ES_SPI0_CPHA_1_2
+#define ES_SPI0_CPHA_1_2 ES_C_SPI_CLK_PHA_SECOND
+#endif
+#ifndef ES_SPI0_CPOL_H_L
+#define ES_SPI0_CPOL_H_L ES_C_SPI_CLK_POL_HIGH
+#endif
+#ifndef ES_SPI0_M_L_SB
+#define ES_SPI0_M_L_SB RT_SPI_MSB
+#endif
+#ifndef ES_SPI0_MAX_HZ
+#define ES_SPI0_MAX_HZ 2000000
+#endif
+#ifndef ES_SPI0_NSS_PIN
+#define ES_SPI0_NSS_PIN 0xFFFFFFFF
+#endif
+
+#ifndef ES_SPI1_CPHA_1_2
+#define ES_SPI1_CPHA_1_2 ES_C_SPI_CLK_PHA_SECOND
+#endif
+#ifndef ES_SPI1_CPOL_H_L
+#define ES_SPI1_CPOL_H_L ES_C_SPI_CLK_POL_HIGH
+#endif
+#ifndef ES_SPI1_M_L_SB
+#define ES_SPI1_M_L_SB RT_SPI_MSB
+#endif
+#ifndef ES_SPI1_MAX_HZ
+#define ES_SPI1_MAX_HZ 2000000
+#endif
+#ifndef ES_SPI1_NSS_PIN
+#define ES_SPI1_NSS_PIN 0xFFFFFFFF
+#endif
+
+#ifndef ES_SPI2_CPHA_1_2
+#define ES_SPI2_CPHA_1_2 ES_C_SPI_CLK_PHA_SECOND
+#endif
+#ifndef ES_SPI2_CPOL_H_L
+#define ES_SPI2_CPOL_H_L ES_C_SPI_CLK_POL_HIGH
+#endif
+#ifndef ES_SPI2_M_L_SB
+#define ES_SPI2_M_L_SB RT_SPI_MSB
+#endif
+#ifndef ES_SPI2_MAX_HZ
+#define ES_SPI2_MAX_HZ 2000000
+#endif
+#ifndef ES_SPI2_NSS_PIN
+#define ES_SPI2_NSS_PIN 0xFFFFFFFF
+#endif
+
+
+#define ES_SPI0_MASTER_SLAVE !RT_SPI_SLAVE
+#define ES_SPI0_WIRE_3_4 !RT_SPI_3WIRE
+#define ES_SPI0_CS RT_SPI_NO_CS
+#define ES_SPI0_DATA_W 8
+
+#define ES_SPI1_MASTER_SLAVE !RT_SPI_SLAVE
+#define ES_SPI1_WIRE_3_4 !RT_SPI_3WIRE
+#define ES_SPI1_CS RT_SPI_NO_CS
+#define ES_SPI1_DATA_W 8
+
+#define ES_SPI2_MASTER_SLAVE !RT_SPI_SLAVE
+#define ES_SPI2_WIRE_3_4 !RT_SPI_3WIRE
+#define ES_SPI2_CS RT_SPI_NO_CS
+#define ES_SPI2_DATA_W 8
+
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/ES/es_conf_info_uart.h b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_uart.h
new file mode 100644
index 0000000000..430cb9f599
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/ES/es_conf_info_uart.h
@@ -0,0 +1,205 @@
+/*
+ * Change Logs:
+ * Date Author Notes
+ * 2021-04-20 liuhy the first version
+ *
+ * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ES_CONF_INFO_UART_H__
+#define __ES_CONF_INFO_UART_H__
+
+#include "es_conf_info_map.h"
+#include <ald_gpio.h>
+#include <ald_uart.h>
+#include <ald_cmu.h>
+
+
+
+#define ES_C_UART_PARITY_NONE PARITY_NONE
+#define ES_C_UART_PARITY_ODD PARITY_ODD
+#define ES_C_UART_PARITY_EVEN PARITY_EVEN
+
+#define ES_C_UART_STOP_1 STOP_BITS_1
+#define ES_C_UART_STOP_2 STOP_BITS_2
+
+
+/* UART 配置 */
+
+/* codes_main */
+
+
+
+#ifndef ES_DEVICE_NAME_UART0
+#define ES_DEVICE_NAME_UART0 "uart0"
+#endif
+#ifndef ES_DEVICE_NAME_UART1
+#define ES_DEVICE_NAME_UART1 "uart1"
+#endif
+#ifndef ES_DEVICE_NAME_UART2
+#define ES_DEVICE_NAME_UART2 "uart2"
+#endif
+#ifndef ES_DEVICE_NAME_UART3
+#define ES_DEVICE_NAME_UART3 "uart3"
+#endif
+#ifndef ES_DEVICE_NAME_UART4
+#define ES_DEVICE_NAME_UART4 "uart4"
+#endif
+#ifndef ES_DEVICE_NAME_UART5
+#define ES_DEVICE_NAME_UART5 "uart5"
+#endif
+
+#ifndef ES_CONF_UART0_BAUD_RATE
+#define ES_CONF_UART0_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART0_PARITY
+#define ES_CONF_UART0_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART0_STOP_BITS
+#define ES_CONF_UART0_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART1_BAUD_RATE
+#define ES_CONF_UART1_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART1_PARITY
+#define ES_CONF_UART1_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART1_STOP_BITS
+#define ES_CONF_UART1_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART2_BAUD_RATE
+#define ES_CONF_UART2_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART2_PARITY
+#define ES_CONF_UART2_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART2_STOP_BITS
+#define ES_CONF_UART2_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART3_BAUD_RATE
+#define ES_CONF_UART3_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART3_PARITY
+#define ES_CONF_UART3_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART3_STOP_BITS
+#define ES_CONF_UART3_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART4_BAUD_RATE
+#define ES_CONF_UART4_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART4_PARITY
+#define ES_CONF_UART4_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART4_STOP_BITS
+#define ES_CONF_UART4_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+#ifndef ES_CONF_UART5_BAUD_RATE
+#define ES_CONF_UART5_BAUD_RATE 115200
+#endif
+#ifndef ES_CONF_UART5_PARITY
+#define ES_CONF_UART5_PARITY ES_C_UART_PARITY_NONE
+#endif
+#ifndef ES_CONF_UART5_STOP_BITS
+#define ES_CONF_UART5_STOP_BITS ES_C_UART_STOP_1
+#endif
+
+
+#define ES_UART0_CONFIG \
+{ \
+ ES_CONF_UART0_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART0_STOP_BITS, \
+ ES_CONF_UART0_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART1_CONFIG \
+{ \
+ ES_CONF_UART1_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART1_STOP_BITS, \
+ ES_CONF_UART1_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART2_CONFIG \
+{ \
+ ES_CONF_UART2_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART2_STOP_BITS, \
+ ES_CONF_UART2_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART3_CONFIG \
+{ \
+ ES_CONF_UART3_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART3_STOP_BITS, \
+ ES_CONF_UART3_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART4_CONFIG \
+{ \
+ ES_CONF_UART4_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART4_STOP_BITS, \
+ ES_CONF_UART4_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+
+#define ES_UART5_CONFIG \
+{ \
+ ES_CONF_UART5_BAUD_RATE, \
+ DATA_BITS_8, \
+ ES_CONF_UART5_STOP_BITS, \
+ ES_CONF_UART5_PARITY, \
+ BIT_ORDER_LSB, \
+ NRZ_NORMAL, \
+ RT_SERIAL_RB_BUFSZ, \
+ 0 \
+}
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/Kconfig b/bsp/essemi/es32f369x/drivers/Kconfig
index 4b42e7e074..75cb7bd164 100644
--- a/bsp/essemi/es32f369x/drivers/Kconfig
+++ b/bsp/essemi/es32f369x/drivers/Kconfig
@@ -1,138 +1,36 @@
menu "Hardware Drivers Config"
+
+
menu "On-chip Peripheral Drivers"
config BSP_USING_GPIO
bool "Enable GPIO"
select RT_USING_PIN
default y
- menu "UART Drivers"
- config BSP_USING_UART0
- bool "Enable UART0 PB10/PB11(T/R)"
- select RT_USING_SERIAL
- default n
-
- config BSP_USING_UART1
- bool "Enable UART1 PC10/PC11(T/R)"
- select RT_USING_SERIAL
- default n
-
- config BSP_USING_UART2
- bool "Enable UART2 PC12/PD02(T/R)"
- select RT_USING_SERIAL
- default y
-
- config BSP_USING_UART3
- bool "Enable UART3 PC04/PC05(T/R)"
- select RT_USING_SERIAL
- default n
- depends on !BSP_USING_SPI2
-
- config BSP_USING_UART4
- bool "Enable UART4 PB06/PB07(T/R)"
- select RT_USING_SERIAL
- default n
- depends on !BSP_USING_I2C0
- depends on !BSP_USING_PWM0
-
- config BSP_USING_UART5
- bool "Enable UART5 PB09/PB08(T/R)"
- select RT_USING_SERIAL
- default n
- depends on !BSP_USING_PWM0
- endmenu
-
- menu "SPI Drivers"
- config BSP_USING_SPI0
- bool "Enable SPI0 BUS PB03/PB04/PB05(CLK/MISO/MOSI)"
- select RT_USING_SPI
- select RT_USING_PIN
- default n
-
- config BSP_USING_SPI1
- bool "Enable SPI1 BUS PC01/PC02/PC03(CLK/MISO/MOSI)"
- select RT_USING_SPI
- select RT_USING_PIN
- default n
-
- config BSP_USING_SPI2
- bool "Enable SPI2 BUS PC05/PB00/PB01(CLK/MISO/MOSI)"
- select RT_USING_SPI
- select RT_USING_PIN
- default n
- depends on !BSP_USING_UART3
- endmenu
-
- menu "I2C Drivers"
- config BSP_USING_I2C0
- bool "Enable I2C0 BUS PB06/PB07(SCL/SDA)"
- select RT_USING_I2C
- default n
- depends on !BSP_USING_PWM0
-
- config BSP_USING_I2C1
- bool "Enable I2C1 BUS PA05/PA06(SCL/SDA)"
- select RT_USING_I2C
- default n
- endmenu
-
- menu "CAN Drivers"
- config BSP_USING_CAN
- bool "Enable CAN BUS PB08/PB09(RX/TX)"
- select RT_USING_CAN
- default n
- endmenu
-
- menu "ADC Drivers"
- config BSP_USING_ADC
- bool "Using ADC"
- select RT_USING_ADC
- default n
- endmenu
-
- menu "RTC Drivers"
- config BSP_USING_RTC
- bool "Using RTC"
- select RT_USING_RTC
- default n
- endmenu
+ source "drivers/ES/Kconfig"
- menu "HWtimer Drivers"
- config BSP_USING_HWTIMER0
- bool "Using timer0"
- select RT_USING_HWTIMER
- default n
+ endmenu
- config BSP_USING_HWTIMER1
- bool "Using timer1"
- select RT_USING_HWTIMER
- default n
- endmenu
+ menu "Onboard Peripheral Drivers"
- menu "PWM Drivers"
- config BSP_USING_PWM0
- bool "Using PWM0 PB06/PB07/PB08/PB09"
- select RT_USING_PWM
- default n
- depends on !BSP_USING_CAN
- depends on !BSP_USING_I2C0
+ config BSP_USING_SPI_FLASH
+ bool "Enable SPI FLASH (W25Q64 spi0)"
+ select BSP_USING_SPI
+ select RT_USING_SFUD
+ select RT_SFUD_USING_SFDP
+ default n
- config BSP_USING_PWM1
- bool "Using PWM1 PA00/PA01/PA02/PA03"
- select RT_USING_PWM
- default n
- endmenu
+if BSP_USING_SPI_FLASH
- menu "PM Drivers"
- config BSP_USING_PM
- bool "Using PM"
- select RT_USING_PM
- default n
- endmenu
+ config ES_DEVICE_NAME_SPI_DEV
+ string "The name of spi device (registered)"
+ default "spi00"
- endmenu
-
- menu "Onboard Peripheral Drivers"
+ config ES_DEVICE_NAME_SPI_FALSH_DEV
+ string "The name of spi flash device"
+ default "W25Q64"
+endif
endmenu
@@ -155,13 +53,17 @@ menu "Hardware Drivers Config"
bool "BSP_USING_EXAMPLE_I2C"
default n
+ config BSP_USING_EXAMPLE_I2C_E2PROM
+ bool "BSP_USING_EXAMPLE_I2C_E2PROM"
+ default n
+
config BSP_USING_EXAMPLE_LED_BLINK
bool "BSP_USING_EXAMPLE_LED_BLINK"
- default y
+ default n
config BSP_USING_EXAMPLE_PIN_BEEP
bool "BSP_USING_EXAMPLE_PIN_BEEP"
- default y
+ default n
config BSP_USING_EXAMPLE_PWM_LED
bool "BSP_USING_EXAMPLE_PWM_LED"
@@ -177,7 +79,7 @@ menu "Hardware Drivers Config"
config BSP_USING_EXAMPLE_UART
bool "BSP_USING_EXAMPLE_UART"
- default y
+ default n
config BSP_USING_EXAMPLE_CAN
bool "BSP_USING_EXAMPLE_CAN"
diff --git a/bsp/essemi/es32f369x/drivers/SConscript b/bsp/essemi/es32f369x/drivers/SConscript
index 735ebb37be..b39d545e35 100644
--- a/bsp/essemi/es32f369x/drivers/SConscript
+++ b/bsp/essemi/es32f369x/drivers/SConscript
@@ -15,7 +15,9 @@ if GetDepend('RT_USING_PIN'):
# add serial driver code
if GetDepend('BSP_USING_UART0') or GetDepend('BSP_USING_UART1') or GetDepend('BSP_USING_UART2') or GetDepend('BSP_USING_UART3') or \
- GetDepend('BSP_USING_UART4') or GetDepend('BSP_USING_UART5'):
+ GetDepend('BSP_USING_UART4') or GetDepend('BSP_USING_UART5') or \
+ GetDepend('BSP_USING_USART0') or GetDepend('BSP_USING_USART1') or GetDepend('BSP_USING_USART2') or GetDepend('BSP_USING_USART3') or \
+ GetDepend('BSP_USING_USART4') or GetDepend('BSP_USING_USART5'):
src += ['drv_uart.c']
# add spi driver code
@@ -27,23 +29,32 @@ if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1'):
src += ['drv_i2c.c']
# add can driver code
-if GetDepend('BSP_USING_CAN'):
+if GetDepend('BSP_USING_CAN') or GetDepend('BSP_USING_CAN0') or GetDepend('RT_USING_CAN'):
src += ['drv_can.c']
# add adc driver code
-if GetDepend(['BSP_USING_ADC']):
+if GetDepend(['BSP_USING_ADC0']) or GetDepend('BSP_USING_ADC1'):
src += ['drv_adc.c']
# add rtc driver code
if GetDepend(['BSP_USING_RTC']):
src += ['drv_rtc.c']
+# add spi flash driver code
+if GetDepend('BSP_USING_SPI_FLASH'):
+ src += ['drv_spiflash.c']
+
# add hwtimer driver code
-if GetDepend('BSP_USING_HWTIMER0') or GetDepend('BSP_USING_HWTIMER1'):
+if GetDepend('BSP_USING_AD16C4T0_HWTIMER') or GetDepend('BSP_USING_AD16C4T1_HWTIMER') or \
+ GetDepend('BSP_USING_GP32C4T0_HWTIMER') or GetDepend('BSP_USING_GP32C4T1_HWTIMER') or \
+ GetDepend('BSP_USING_GP16C4T0_HWTIMER') or GetDepend('BSP_USING_GP16C4T1_HWTIMER') or \
+ GetDepend('BSP_USING_BS16T0_HWTIMER') or GetDepend('BSP_USING_BS16T1_HWTIMER'):
src += ['drv_hwtimer.c']
# add pwm driver code
-if GetDepend('BSP_USING_PWM0') or GetDepend('BSP_USING_PWM1'):
+if GetDepend('BSP_USING_AD16C4T0_PWM') or GetDepend('BSP_USING_AD16C4T1_PWM') or \
+ GetDepend('BSP_USING_GP32C4T0_PWM') or GetDepend('BSP_USING_GP32C4T1_PWM') or \
+ GetDepend('BSP_USING_GP16C4T0_PWM') or GetDepend('BSP_USING_GP16C4T1_PWM'):
src += ['drv_pwm.c']
# add pm driver code
@@ -56,7 +67,7 @@ objs = objs + group
src = []
cwd = GetCurrentDir()
-include_path = [cwd]
+include_path = [cwd + '/ES']
if GetDepend('BSP_USING_EXAMPLE_ADC_VOL'):
src += ['bsp_driver_example/adc_vol_sample.c']
@@ -67,6 +78,9 @@ if GetDepend('BSP_USING_EXAMPLE_HWTIMER'):
if GetDepend('BSP_USING_EXAMPLE_I2C'):
src += ['bsp_driver_example/i2c_sample.c']
+if GetDepend('BSP_USING_EXAMPLE_I2C_E2PROM'):
+ src += ['bsp_driver_example/i2c_e2_sample.c']
+
if GetDepend('BSP_USING_EXAMPLE_LED_BLINK'):
src += ['bsp_driver_example/led_blink_sample.c']
diff --git a/bsp/essemi/es32f369x/drivers/board.c b/bsp/essemi/es32f369x/drivers/board.c
index 1c2b834177..ea42df63dc 100644
--- a/bsp/essemi/es32f369x/drivers/board.c
+++ b/bsp/essemi/es32f369x/drivers/board.c
@@ -1,11 +1,24 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
@@ -13,7 +26,6 @@
#include "board.h"
#include "drv_uart.h"
#include "drv_gpio.h"
-#include <ald_cmu.h>
#include <ald_gpio.h>
/**
@@ -42,11 +54,68 @@ void NVIC_Configuration(void)
*******************************************************************************/
void SystemClock_Config(void)
{
- /* hosc 12MHz, from hosc/3 pll to 96MHz */
- ald_cmu_pll1_config(CMU_PLL1_INPUT_HOSC_3, CMU_PLL1_OUTPUT_96M);
- /* SYSCLK 96MHz */
- ald_cmu_clock_config(CMU_CLOCK_PLL1, 96000000);
+
+ SYSCFG_UNLOCK();
+#if ES_CMU_LRC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_LRCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_LRCEN_MSK);
+#endif /*ES_CMU_LRC_EN*/
+
+#if ES_CMU_LOSC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);
+#endif /*ES_CMU_LOSC_EN*/
+
+#if ES_CMU_HRC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_HRCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_HRCEN_MSK);
+#endif /*ES_CMU_HRC_EN*/
+
+#if ES_CMU_HOSC_EN
+ SET_BIT(CMU->CLKENR, CMU_CLKENR_HOSCEN_MSK);
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_HOSCEN_MSK);
+#endif /*ES_CMU_HOSC_EN*/
+
+ SYSCFG_LOCK();
+
+#if ES_CMU_PLL1_EN
+ /*PLL的源必须是4M*/
+ ald_cmu_pll1_config(ES_PLL1_REFER_CLK, ES_PLL1_OUT_CLK);
+
+ #if ES_CMU_PLL1_SAFE_EN
+ ald_cmu_pll_safe_config(ENABLE);
+ #else
+ ald_cmu_pll_safe_config(DISABLE);
+ #endif
+
+#else
+ CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_PLL1EN_MSK);
+#endif /*ES_CMU_PLL1_EN*/
+
+ ald_cmu_clock_config(ES_SYS_CLK_SOURSE, ES_SYS_CLK);
+
+ ald_cmu_div_config(CMU_SYS,ES_CMU_SYS_DIV);
+ ald_cmu_div_config(CMU_HCLK_1,ES_CMU_HCLK_1_DIV);
+ ald_cmu_div_config(CMU_HCLK_2,ES_CMU_HCLK_2_DIV);
+ ald_cmu_div_config(CMU_PCLK_1,ES_CMU_PCLK_1_DIV);
+ ald_cmu_div_config(CMU_PCLK_2,ES_CMU_PCLK_2_DIV);
+
ald_cmu_perh_clock_config(CMU_PERH_ALL, ENABLE);
+
+/*低功耗时钟使能*/
+#ifdef RT_USING_PM
+ SYSCFG_UNLOCK();
+ SET_BIT(CMU->LPENR, CMU_LPENR_LRCEN_MSK);
+ SET_BIT(CMU->LPENR, CMU_LPENR_LOSCEN_MSK);
+ SET_BIT(CMU->LPENR, CMU_LPENR_HRCEN_MSK);
+ SET_BIT(CMU->LPENR, CMU_LPENR_HOSCEN_MSK);
+ SYSCFG_LOCK();
+#endif
+
}
/*******************************************************************************
@@ -70,11 +139,21 @@ void SysTick_Handler(void)
{
/* enter interrupt */
rt_interrupt_enter();
+ ald_inc_tick();
rt_tick_increase();
/* leave interrupt */
rt_interrupt_leave();
}
+/**
+ * This is the cmu interrupt service.
+ *
+ */
+void CMU_Handler(void)
+{
+ ald_cmu_irq_handler();
+}
+
/*@}*/
/**
* This function will initial ES32F3 board.
diff --git a/bsp/essemi/es32f369x/drivers/board.h b/bsp/essemi/es32f369x/drivers/board.h
index 628c2f87fd..640cf44864 100644
--- a/bsp/essemi/es32f369x/drivers/board.h
+++ b/bsp/essemi/es32f369x/drivers/board.h
@@ -1,11 +1,24 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
// <<< Use Configuration Wizard in Context Menu >>>
@@ -13,6 +26,7 @@
#define __BOARD_H__
#include <es32f36xx.h>
+#include "es_conf_info_cmu.h"
#define ES32F3_SRAM_SIZE 0x18000
#define ES32F3_SRAM_END (0x20000000 + ES32F3_SRAM_SIZE)
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/adc_vol_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/adc_vol_sample.c
index f9444982d4..9576736bcd 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/adc_vol_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/adc_vol_sample.c
@@ -18,11 +18,15 @@
#include <rtthread.h>
#include <rtdevice.h>
+
+#ifdef RT_USING_ADC
+
#define ADC_DEV_NAME "adc0" /* ADC 设备名称 */
#define ADC_DEV_CHANNEL 5 /* ADC 通道 5 PA1*/
#define REFER_VOLTAGE 330 /* 参考电压 3.3V,数据精度乘以100保留2位小数*/
#define CONVERT_BITS (1 << 12) /* 转换位数为12位 */
+
static int adc_vol_sample(int argc, char *argv[])
{
rt_adc_device_t adc_dev;
@@ -55,3 +59,5 @@ static int adc_vol_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(adc_vol_sample, adc voltage convert sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/can_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/can_sample.c
index bfbd50095e..1133ad8d2b 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/can_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/can_sample.c
@@ -18,7 +18,9 @@
#include <rtthread.h>
#include "rtdevice.h"
-#define CAN_DEV_NAME "can" /* CAN 设备名称 */
+#ifdef RT_USING_CAN
+
+#define CAN_DEV_NAME "can0" /* CAN 设备名称 */
static struct rt_semaphore rx_sem; /* 用于接收消息的信号量 */
static rt_device_t can_dev; /* CAN 设备句柄 */
@@ -142,3 +144,5 @@ int can_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(can_sample, can device sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/hwtimer_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/hwtimer_sample.c
index e2e39664f3..025b4f26c0 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/hwtimer_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/hwtimer_sample.c
@@ -17,6 +17,8 @@
#include <rtthread.h>
#include <rtdevice.h>
+#ifdef RT_USING_HWTIMER
+
#define HWTIMER_DEV_NAME "timer0" /* 定时器名称 */
/* 定时器超时回调函数 */
@@ -83,3 +85,5 @@ static int hwtimer_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(hwtimer_sample, hwtimer sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_e2_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_e2_sample.c
new file mode 100644
index 0000000000..3bfd005e67
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_e2_sample.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-12-15 liuhy first implementation.
+ */
+/*
+ * 程序清单:这是一个 I2C 设备使用例程
+ * 例程导出了 i2c_e2_sample 命令到控制终端
+ * 命令调用格式:i2c_e2_sample
+ * 命令解释:使用默认的I2C总线设备i2c0
+ * 程序功能:通过 I2C 设备写读e2prom,ST24C04WP。
+*/
+
+/*ST24C04WP 有2个Block :Block0 的从机地址为:0x50,Block1 的从机地址为:0x51
+ 一个Block有 256字节,一页16字节,写只可在一页内(超过一页的范围后,会回到页的开始),读无页限制*/
+#include <rtthread.h>
+#include <rtdevice.h>
+
+#ifdef RT_USING_I2C
+
+#define I2C_BUS_NAME "i2c0" /*I2C总线设备名称 */
+#define SLAVE_ADDR 0x50 /*从机地址*/
+#define MEM_ADDR 0x00 /*从机的起始储存地址,范围:0x00到0xEF(例程写读范围:2页)*/
+#define ADDR_LEN 1 /*定义从机储存地址的长度,默认8位,1字节*/
+#define STR_LEN 16 /*接收发送的页数据长度 ,最大16*/
+
+static rt_uint8_t mem_addr,rx_buffer[33] = { 0U }; /*读两页,需要32字节,字符串结束'\0'*/
+/*第一个字节' '用来放 E2PROM 的内存地址,最后一个字节'\0'作为子串的结束,不存入e2prom*/
+static rt_uint8_t tx_buffer1[STR_LEN + ADDR_LEN + 1] = " e2prom example !\0";
+static rt_uint8_t tx_buffer2[STR_LEN + ADDR_LEN + 1] = " ABCDEFGH12345678\0";
+
+static void i2c_e2_sample(int argc, char *argv[])
+{
+ struct rt_i2c_bus_device *i2c_bus = RT_NULL; /* I2C总线设备句柄 */
+ struct rt_i2c_msg i2c_msg[2]; /* I2C消息 */
+ rt_size_t s_stat;
+
+ i2c_bus = (struct rt_i2c_bus_device *)rt_device_find(I2C_BUS_NAME); /* 通过名字获取I2C总线设备的句柄 */
+
+ if( i2c_bus == RT_NULL)
+ {
+ rt_kprintf("can't find i2c device :%s !\n",I2C_BUS_NAME);
+ return;
+ }
+
+ /*写T24C04WP
+ 如果 (MEM_ADDR & 0x0F) + STR_LEN <= 16, 写的范围为:(MEM_ADDR , MEM_ADDR + STR_LEN )
+ (0x10 + MEM_ADDR , 0x10 + MEM_ADDR + STR_LEN )
+ 如果 (MEM_ADDR & 0x0F) + STR_LEN > 16, 超出范围的部分会在页内循环写。*/
+ tx_buffer1[0] = MEM_ADDR;
+
+ /*初始化消息*/
+ i2c_msg[0].addr = SLAVE_ADDR; /* 从机地址 */
+ i2c_msg[0].len = ADDR_LEN + STR_LEN ; /* 写入的长度,地址+数据 */
+ i2c_msg[0].buf = tx_buffer1; /* 待写入第一段数据 */
+ i2c_msg[0].flags = RT_I2C_WR; /* I2C写 */
+ s_stat = rt_i2c_transfer(i2c_bus,i2c_msg,1); /* 写入第一段数据 */
+
+ if( s_stat == 1 )rt_kprintf("write successful. \nmessage: %s\n",&tx_buffer1[1]);
+ else rt_kprintf("device %s write fail \n",I2C_BUS_NAME);
+
+ tx_buffer2[0] = MEM_ADDR + 0x10; /*加一页*/
+ i2c_msg[0].buf = tx_buffer2; /* 待写入第二段数据 */
+ s_stat = rt_i2c_transfer(i2c_bus,i2c_msg,1); /* 写入第二段数据 */
+
+ if( s_stat == 1 )rt_kprintf("write successful. \nmessage: %s\n",&tx_buffer2[1]);
+ else rt_kprintf("device %s write fail \n",I2C_BUS_NAME);
+
+ /*读T24C04WP 读2页的数据。读数据需要2条消息:第一条消息:发送读取的地址。
+ 第二条消息:读取具体的数据。*/
+
+ mem_addr = MEM_ADDR & 0xF0; /*从页的开始读*/
+
+ i2c_msg[0].len = ADDR_LEN;
+ i2c_msg[0].buf = &mem_addr;
+
+ i2c_msg[1].addr = SLAVE_ADDR; /* 从机地址 */
+ i2c_msg[1].len = 32; /* 读取的数据长度:2*16 */
+ i2c_msg[1].buf = rx_buffer; /* 数据存放地址 */
+ i2c_msg[1].flags = RT_I2C_RD; /* I2C读 */
+ s_stat = rt_i2c_transfer(i2c_bus,i2c_msg,2); /* 读已写的2页 */
+
+ if( s_stat == 2 )rt_kprintf(" read successful \n messege : %s \n",rx_buffer);
+ else
+ rt_kprintf("read fail \n");
+
+ return;
+
+}
+/* 导出到 msh 命令列表中 */
+MSH_CMD_EXPORT(i2c_e2_sample, i2c e2prom sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_sample.c
index 4fd42baf41..c8a666609d 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/i2c_sample.c
@@ -1,7 +1,19 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
@@ -18,6 +30,8 @@
#include <rtthread.h>
#include <rtdevice.h>
+#ifdef RT_USING_I2C
+
#define I2C_BUS_NAME "i2c0" /* I2C总线设备名称 */
#define SLAVE_ADDR 0x2D /* 从机地址 */
#define STR_LEN 16 /* 接收发送的数据长度 */
@@ -95,3 +109,5 @@ static void i2c_io_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(i2c_io_sample, i2c io sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/pm_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/pm_sample.c
index b886876108..731dca4115 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/pm_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/pm_sample.c
@@ -1,7 +1,19 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
@@ -11,18 +23,26 @@
* 程序清单:这是一个 pm睡眠唤醒的使用例程
* 例程导出了 pm_sample 命令到控制终端
* 命令调用格式:pm_sample
- * 命令解释:进入不同的睡眠模式,然后用按键唤醒
+ * 命令解释:进入不同的睡眠模式,然后用按键唤醒。
* 程序功能:通过串口输出字符串,告知进入睡眠和唤醒睡眠的情况。
+ * 注意:进入睡眠前,如果有中断挂起(SYSTICK、UART、EXTI等),睡眠将被瞬间唤醒。
*/
#include <rtthread.h>
#include <rtdevice.h>
-#include "drv_pm.h"
+#include "drv_pm.h"
+#include "ald_gpio.h"
+
+
+#ifdef RT_USING_PM
#define PM_NAME "pm" /* 设备名称 */
#define WAKE_UP_PIN 51 /* 唤醒源 */
#define SLEEP_TIMES 12 /* 进入睡眠次数,轮流进入不同的睡眠模式,包括无睡眠模式 */
+/*部分芯片进入深度睡眠后,部分外设的部分寄存器可能会丢失*/
+#define SAVE_REG UART0
+#define SAVE_REG_TYPE UART_TypeDef
struct pm_callback_t
{
@@ -64,14 +84,15 @@ void sleep_in_out_callback(rt_uint8_t event, rt_uint8_t mode, void *data)
/*进入睡眠前*/
case RT_PM_ENTER_SLEEP: g_pm_data.flag = 1;
rt_kprintf("\n\r##%d : ENTER ",g_pm_data.in_fun_times);
- save_register(UART0,sizeof(UART_TypeDef),save_load_mem); /*备份寄存器的值*/
+ /*进入深度睡眠后,部分外设的部分寄存器可能会丢失*/
+ save_register(SAVE_REG,sizeof(SAVE_REG_TYPE),save_load_mem); /*备份寄存器的值*/
g_pm_data.in_fun_times++; /*进入睡眠次数+1*/
break;
/*睡眠唤醒后*/
case RT_PM_EXIT_SLEEP: g_pm_data.flag = 0; /*睡眠唤醒后*/
- load_register(UART0,sizeof(UART_TypeDef),save_load_mem); /*还原寄存器的值*/
+ load_register(SAVE_REG,sizeof(SAVE_REG_TYPE),save_load_mem); /*还原寄存器的值*/
rt_kprintf("\n\rEXIT\n\r");
- rt_pm_release(mode); /*释放休眠模式*/
+ rt_pm_request(PM_SLEEP_MODE_NONE); /*进无休眠模式*/
return;
default: break;
@@ -118,7 +139,7 @@ static void pm_test(void *parameter)
/*设置回调函数和私有数据*/
rt_pm_notify_set(sleep_in_out_callback,RT_NULL);
-
+
while(i < SLEEP_TIMES)
{
@@ -130,9 +151,12 @@ static void pm_test(void *parameter)
g_pm_data.flag = 2;
}
+
+ /*彻底释放无休眠模式*/
+ rt_pm_release_all(PM_SLEEP_MODE_NONE);
/*请求选择的休眠模式*/
- rt_pm_request(in_mode[i%6]);
+ rt_pm_request(in_mode[i%6]);
rt_thread_mdelay(500);
@@ -142,14 +166,19 @@ static void pm_test(void *parameter)
rt_thread_mdelay(500);
}
- /*释放选择的休眠模式*/
- rt_pm_release(in_mode[i%6]);
+ /*释放选择的休眠模式 ,彻底释放*/
+ rt_pm_release_all(in_mode[i%6]);
i++;
}
- /*清除回调函数和私有数据*/
+
+ /*切换为无睡眠模式*/
+ rt_pm_request(PM_SLEEP_MODE_NONE);
+
+ /*清除回调函数和私有数据*/
rt_pm_notify_set(RT_NULL,RT_NULL);
+
rt_kprintf("thread pm_test close\n\r");
}
@@ -187,3 +216,5 @@ static int pm_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(pm_sample, pm sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/pwm_led_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/pwm_led_sample.c
index df82c1b41c..8d12b74e15 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/pwm_led_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/pwm_led_sample.c
@@ -17,9 +17,12 @@
#include <rtthread.h>
#include <rtdevice.h>
-#define LED_PIN_NUM 19 /* PF1 LED PIN脚编号,查看驱动文件drv_gpio.c确定 */
+
+#ifdef RT_USING_PWM
+
+#define LED_PIN_NUM 37 /* PF1 LED PIN脚编号,查看驱动文件drv_gpio.c确定 */
#define PWM_DEV_NAME "pwm1" /* PWM设备名称 */
-#define PWM_DEV_CHANNEL 2 /* PA1 PWM通道 */
+#define PWM_DEV_CHANNEL 1 /* PWM通道 */
struct rt_device_pwm *pwm_dev; /* PWM设备句柄 */
@@ -70,3 +73,5 @@ static int pwm_led_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(pwm_led_sample, pwm sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/rtc_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/rtc_sample.c
index 711a3a0ebb..d66b9db9df 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/rtc_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/rtc_sample.c
@@ -17,6 +17,8 @@
#include <rtthread.h>
#include <rtdevice.h>
+#ifdef RT_USING_RTC
+
static int rtc_sample(int argc, char *argv[])
{
rt_err_t ret = RT_EOK;
@@ -39,7 +41,7 @@ static int rtc_sample(int argc, char *argv[])
}
/* 延时3秒 */
- rt_thread_mdelay(3000);
+ rt_thread_mdelay(3000);
/* 获取时间 */
now = time(RT_NULL);
@@ -49,3 +51,5 @@ static int rtc_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(rtc_sample, rtc sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/bsp_driver_example/spi_sample.c b/bsp/essemi/es32f369x/drivers/bsp_driver_example/spi_sample.c
index 994888cdb0..6f6e730288 100644
--- a/bsp/essemi/es32f369x/drivers/bsp_driver_example/spi_sample.c
+++ b/bsp/essemi/es32f369x/drivers/bsp_driver_example/spi_sample.c
@@ -1,7 +1,19 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
@@ -17,13 +29,14 @@
#include <rtthread.h>
#include <rtdevice.h>
+#ifdef RT_USING_SPI
+
#define SPI_DEVICE_NAME "spi00"
#define BUF_LEN 16
static void spi_io_sample(int argc, char *argv[])
{
struct rt_spi_device * spi_dev; /* spi设备的句柄 */
- struct rt_spi_configuration spi_config;
rt_uint8_t i,buffer[BUF_LEN] = { 0U };
rt_err_t s_stat;
rt_err_t result;
@@ -37,23 +50,8 @@ static void spi_io_sample(int argc, char *argv[])
return;
}
-
- /* 清空配置结构体 */
- rt_memset(&spi_config,0,sizeof(struct rt_spi_configuration));
-
- spi_config.mode &= ~RT_SPI_SLAVE; /* 主机模式 */
- spi_config.mode &= ~RT_SPI_3WIRE; /* 4线,双向传输 */
- spi_config.mode |= RT_SPI_CPHA; /* 第二边沿采样 */
- spi_config.mode |= RT_SPI_CPOL; /* 空闲高电平 */
- spi_config.mode |= RT_SPI_NO_CS; /* 禁用软件从机选择管理 */
- spi_config.mode |= RT_SPI_MSB; /* 高位在前 */
-
- spi_config.data_width = 8; /* 数据长度:8 */
-
- spi_config.max_hz = 2000000; /* 最快时钟频率 */
-
/* 配置SPI设备 */
- s_stat = rt_spi_configure(spi_dev,&spi_config);
+ s_stat = rt_spi_configure(spi_dev,&(spi_dev->config));
if(s_stat != RT_EOK)
{
@@ -150,3 +148,5 @@ static void spi_io_sample(int argc, char *argv[])
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(spi_io_sample, spi sample);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_adc.c b/bsp/essemi/es32f369x/drivers/drv_adc.c
index 79afc06123..716fddcfa4 100644
--- a/bsp/essemi/es32f369x/drivers/drv_adc.c
+++ b/bsp/essemi/es32f369x/drivers/drv_adc.c
@@ -1,26 +1,44 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
* 2019-04-03 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include "board.h"
-#include "drv_adc.h"
-#include <ald_gpio.h>
-#include <ald_adc.h>
+#include "drv_adc.h"
#ifdef RT_USING_ADC
/* define adc instance */
+
+#ifdef BSP_USING_ADC0
static struct rt_adc_device _device_adc0;
+#endif /*BSP_USING_ADC0*/
+
+#ifdef BSP_USING_ADC1
+static struct rt_adc_device _device_adc1;
+#endif /*BSP_USING_ADC1*/
/* enable or disable adc */
static rt_err_t es32f3_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled)
@@ -48,7 +66,8 @@ static adc_channel_t es32f3_adc_get_channel(rt_uint32_t channel)
/* Initialize ADC pin */
gpio_initstruct.mode = GPIO_MODE_INPUT;
- gpio_initstruct.pupd = GPIO_FLOATING;
+ gpio_initstruct.pupd = GPIO_FLOATING;
+ gpio_initstruct.odos = GPIO_OPEN_DRAIN;
gpio_initstruct.podrv = GPIO_OUT_DRIVE_1;
gpio_initstruct.nodrv = GPIO_OUT_DRIVE_1;
gpio_initstruct.flt = GPIO_FILTER_DISABLE;
@@ -60,77 +79,69 @@ static adc_channel_t es32f3_adc_get_channel(rt_uint32_t channel)
{
case 0:
es32f3_channel = ADC_CHANNEL_0;
- ald_gpio_init(GPIOC, GPIO_PIN_0, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH0_GPIO, ES_GPIO_ADC_CH0_PIN, &gpio_initstruct);
break;
case 1:
es32f3_channel = ADC_CHANNEL_1;
- ald_gpio_init(GPIOC, GPIO_PIN_1, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH1_GPIO, ES_GPIO_ADC_CH1_PIN, &gpio_initstruct);
break;
case 2:
es32f3_channel = ADC_CHANNEL_2;
- ald_gpio_init(GPIOC, GPIO_PIN_2, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH2_GPIO, ES_GPIO_ADC_CH2_PIN, &gpio_initstruct);
break;
case 3:
es32f3_channel = ADC_CHANNEL_3;
- ald_gpio_init(GPIOC, GPIO_PIN_3, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH3_GPIO, ES_GPIO_ADC_CH3_PIN, &gpio_initstruct);
break;
case 4:
es32f3_channel = ADC_CHANNEL_4;
- ald_gpio_init(GPIOA, GPIO_PIN_0, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH4_GPIO, ES_GPIO_ADC_CH4_PIN, &gpio_initstruct);
break;
case 5:
es32f3_channel = ADC_CHANNEL_5;
- ald_gpio_init(GPIOA, GPIO_PIN_1, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH5_GPIO, ES_GPIO_ADC_CH5_PIN, &gpio_initstruct);
break;
case 6:
es32f3_channel = ADC_CHANNEL_6;
- ald_gpio_init(GPIOA, GPIO_PIN_2, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH6_GPIO, ES_GPIO_ADC_CH6_PIN, &gpio_initstruct);
break;
case 7:
es32f3_channel = ADC_CHANNEL_7;
- ald_gpio_init(GPIOA, GPIO_PIN_3, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH7_GPIO, ES_GPIO_ADC_CH7_PIN, &gpio_initstruct);
break;
case 8:
es32f3_channel = ADC_CHANNEL_8;
- ald_gpio_init(GPIOA, GPIO_PIN_4, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH8_GPIO, ES_GPIO_ADC_CH8_PIN, &gpio_initstruct);
break;
case 9:
es32f3_channel = ADC_CHANNEL_9;
- ald_gpio_init(GPIOA, GPIO_PIN_5, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH9_GPIO, ES_GPIO_ADC_CH9_PIN, &gpio_initstruct);
break;
case 10:
es32f3_channel = ADC_CHANNEL_10;
- ald_gpio_init(GPIOA, GPIO_PIN_6, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH10_GPIO, ES_GPIO_ADC_CH10_PIN, &gpio_initstruct);
break;
case 11:
es32f3_channel = ADC_CHANNEL_11;
- ald_gpio_init(GPIOA, GPIO_PIN_7, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH11_GPIO, ES_GPIO_ADC_CH11_PIN, &gpio_initstruct);
break;
case 12:
es32f3_channel = ADC_CHANNEL_12;
- ald_gpio_init(GPIOC, GPIO_PIN_4, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH12_GPIO, ES_GPIO_ADC_CH12_PIN, &gpio_initstruct);
break;
case 13:
es32f3_channel = ADC_CHANNEL_13;
- ald_gpio_init(GPIOC, GPIO_PIN_5, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH13_GPIO, ES_GPIO_ADC_CH13_PIN, &gpio_initstruct);
break;
case 14:
es32f3_channel = ADC_CHANNEL_14;
- ald_gpio_init(GPIOB, GPIO_PIN_0, &gpio_initstruct);
+ ald_gpio_init(ES_GPIO_ADC_CH14_GPIO, ES_GPIO_ADC_CH14_PIN, &gpio_initstruct);
break;
case 15:
es32f3_channel = ADC_CHANNEL_15;
- ald_gpio_init(GPIOB, GPIO_PIN_1, &gpio_initstruct);
- break;
- case 16:
- es32f3_channel = ADC_CHANNEL_16;
- break;
- case 17:
- es32f3_channel = ADC_CHANNEL_17;
- break;
- case 18:
- es32f3_channel = ADC_CHANNEL_18;
+ ald_gpio_init(ES_GPIO_ADC_CH15_GPIO, ES_GPIO_ADC_CH15_PIN, &gpio_initstruct);
break;
+
default:
break;
}
@@ -149,7 +160,7 @@ static rt_err_t es32f3_get_adc_value(struct rt_adc_device *device, rt_uint32_t c
/* config adc channel */
nm_config.ch = es32f3_adc_get_channel(channel);
nm_config.idx = ADC_NCH_IDX_1;
- nm_config.samp = ADC_SAMPLETIME_4;
+ nm_config.samp = ES_ADC0_NCH_SAMPLETIME;
ald_adc_normal_channel_config(_hadc, &nm_config);
ald_adc_normal_start(_hadc);
@@ -169,23 +180,51 @@ static const struct rt_adc_ops es32f3_adc_ops =
int rt_hw_adc_init(void)
{
int result = RT_EOK;
- static adc_handle_t _h_adc0;
+ adc_handle_t _h_adc;
/* adc function initialization */
+ _h_adc.init.scan = DISABLE;
+ _h_adc.init.cont = DISABLE;
+ _h_adc.init.disc = ADC_ALL_DISABLE;
+ _h_adc.init.disc_nr = ADC_DISC_NR_1;
+ _h_adc.init.nch_nr = ADC_NCH_NR_16;
+ _h_adc.init.nche_sel = ADC_NCHESEL_MODE_ALL;
+ _h_adc.init.cont = DISABLE;
+ _h_adc.init.n_ref = ADC_NEG_REF_VSS;
+ _h_adc.init.p_ref = ADC_POS_REF_VDD;
+
+#ifdef BSP_USING_ADC0
+
+ static adc_handle_t _h_adc0;
+
+ _h_adc0.init = _h_adc.init;
+
_h_adc0.perh = ADC0;
- _h_adc0.init.align = ADC_DATAALIGN_RIGHT;
- _h_adc0.init.scan = DISABLE;
- _h_adc0.init.cont = DISABLE;
- _h_adc0.init.disc = ADC_ALL_DISABLE;
- _h_adc0.init.disc_nr = ADC_DISC_NR_1;
- _h_adc0.init.data_bit = ADC_CONV_BIT_12;
- _h_adc0.init.div = ADC_CKDIV_128;
- _h_adc0.init.nche_sel = ADC_NCHESEL_MODE_ALL;
- _h_adc0.init.n_ref = ADC_NEG_REF_VSS;
- _h_adc0.init.p_ref = ADC_POS_REF_VDD;
+ _h_adc0.init.align = ES_ADC0_ALIGN;
+ _h_adc0.init.data_bit = ES_ADC0_DATA_BIT;
+ _h_adc0.init.div = ES_ADC0_CLK_DIV;
ald_adc_init(&_h_adc0);
+
+ rt_hw_adc_register(&_device_adc0, ES_DEVICE_NAME_ADC0, &es32f3_adc_ops, &_h_adc0);
+
+#endif /*BSP_USING_ADC0*/
+
+#ifdef BSP_USING_ADC1
- rt_hw_adc_register(&_device_adc0, "adc0", &es32f3_adc_ops, &_h_adc0);
+ static adc_handle_t _h_adc1;
+
+ _h_adc1.init = _h_adc.init;
+
+ _h_adc1.perh = ADC1;
+ _h_adc1.init.align = ES_ADC1_ALIGN;
+ _h_adc1.init.data_bit = ES_ADC1_DATA_BIT;
+ _h_adc1.init.div = ES_ADC1_CLK_DIV;
+ ald_adc_init(&_h_adc1);
+
+ rt_hw_adc_register(&_device_adc1, ES_DEVICE_NAME_ADC1, &es32f3_adc_ops, &_h_adc1);
+
+#endif /*BSP_USING_ADC1*/
+
return result;
}
diff --git a/bsp/essemi/es32f369x/drivers/drv_adc.h b/bsp/essemi/es32f369x/drivers/drv_adc.h
index eaddd67407..6585b44cf0 100644
--- a/bsp/essemi/es32f369x/drivers/drv_adc.h
+++ b/bsp/essemi/es32f369x/drivers/drv_adc.h
@@ -3,14 +3,29 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-04-03 wangyq the first version
+ * 2019-04-03 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_ADC_H__
#define DRV_ADC_H__
+#include "es_conf_info_adc.h"
+
int rt_hw_adc_init(void);
#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_can.c b/bsp/essemi/es32f369x/drivers/drv_can.c
index 04f4f161d7..6e7456b9b6 100644
--- a/bsp/essemi/es32f369x/drivers/drv_can.c
+++ b/bsp/essemi/es32f369x/drivers/drv_can.c
@@ -1,51 +1,93 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#include "drv_can.h"
-#ifdef BSP_USING_CAN
+#ifdef RT_USING_CAN
static struct es32f3_can can;
-/* attention !!! baud calculation example: Pclk / ((sjw + seg1 + seg2) * psc) 48 / ((1 + 3 + 2) * 8) = 1MHz */
-static const struct es32f3_baud_rate_tab can_baud_rate_tab[] =
-{
- {CAN1MBaud, 8},
- {CAN800kBaud, 10},
- {CAN500kBaud, 16},
- {CAN250kBaud, 32},
- {CAN125kBaud, 64},
- {CAN100kBaud, 80},
- {CAN50kBaud, 160},
- {CAN20kBaud, 400},
- {CAN10kBaud, 800}
-};
-
-static rt_uint32_t get_can_baud_index(rt_uint32_t baud)
-{
- rt_uint32_t len, index;
- len = sizeof(can_baud_rate_tab) / sizeof(can_baud_rate_tab[0]);
- for (index = 0; index < len; index++)
+static rt_uint32_t get_can_baud_index(rt_uint32_t baud,can_init_t * init)
+{
+/* attention !!! baud calculation example: Pclk / ((1 + seg1 + seg2) * psc) Pclk=48 / ((1 + seg1=3 + seg2=2) * 8) = 1MHz */
+ double target,temp,min;
+ uint32_t i,j,j_max,near = 0;
+ target = (double)(ald_cmu_get_pclk1_clock());
+ target/= baud; /*计算误差1*/
+
+ min = 0xFFFFFFFF;
+
+ for(i = 1 + 16 + 8 ;i > 2;i--) /*SYNC_SEG + SEG1 + SEG2*/
{
- if (can_baud_rate_tab[index].baud_rate == baud)
- return index;
+ j_max = target/i/(0.98) + 1; /*缩小范围*/
+ j_max = (j_max > 1024) ? (1024) : (j_max);
+
+ for(j = target/i/1.02 ;j < j_max;j++)
+ {
+ temp = target/i/j; /*计算误差2*/
+ temp = (temp > 1) ? (temp - 1) : (1 - temp);
+ temp+= ((1.0 * i * j) / 0xFFFFFFFF) ;
+
+ if(temp < min)
+ {
+ if(temp > 0.000001)
+ {
+ near = (i<<16) + j;
+ min = temp;
+ }
+ else
+ {
+ init->seg1 = (can_seg1_t)((i - 1)*2/3-1);
+ init->seg2 = (can_seg2_t)(i - init->seg1 - 1 - 1 - 1);
+ init->psc = j;
+
+ return 0;
+ }
+ }
+ }
}
- return 0; /* default baud is CAN1MBaud */
+ if(min < 0.01)
+ {
+ i = near>>16;
+ j = near % (1<<16);
+ init->seg1 = (can_seg1_t)((i - 1)*2/3-1);
+ init->seg2 = (can_seg2_t)(i - init->seg1 - 1 - 1 - 1);
+ init->psc = j;
+
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
}
+
static rt_err_t _can_config(struct rt_can_device *can_device, struct can_configure *cfg)
{
struct es32f3_can *drv_can;
- rt_uint32_t baud_index;
RT_ASSERT(can_device);
RT_ASSERT(cfg);
@@ -56,7 +98,7 @@ static rt_err_t _can_config(struct rt_can_device *can_device, struct can_configu
drv_can->CanHandle.init.ttcm = DISABLE;
drv_can->CanHandle.init.abom = ENABLE;
drv_can->CanHandle.init.awk = DISABLE;
- drv_can->CanHandle.init.artx = DISABLE;
+ drv_can->CanHandle.init.artx = (type_func_t)ES_CAN0_AUTO_BAN_RE_T;
drv_can->CanHandle.init.rfom = DISABLE;
drv_can->CanHandle.init.txmp = ENABLE;
@@ -75,12 +117,13 @@ static rt_err_t _can_config(struct rt_can_device *can_device, struct can_configu
drv_can->CanHandle.init.mode = CAN_MODE_SILENT_LOOPBACK;
break;
}
-
- baud_index = get_can_baud_index(cfg->baud_rate);
- drv_can->CanHandle.init.sjw = CAN_SJW_1;
- drv_can->CanHandle.init.seg1 = CAN_SEG1_3;
- drv_can->CanHandle.init.seg2 = CAN_SEG2_2;
- drv_can->CanHandle.init.psc = can_baud_rate_tab[baud_index].config_data;
+ /*配置参数*/
+ if(get_can_baud_index(cfg->baud_rate,&(drv_can->CanHandle.init)))
+ {
+ return -RT_ERROR;
+ }
+ drv_can->CanHandle.init.sjw = (can_sjw_t)(cfg->reserved);
+
/* init can */
if (ald_can_init(&drv_can->CanHandle) != OK)
{
@@ -95,8 +138,12 @@ static rt_err_t _can_config(struct rt_can_device *can_device, struct can_configu
static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *arg)
{
rt_uint32_t argval;
+
struct es32f3_can *drv_can;
+
+#ifdef RT_CAN_USING_HDR
struct rt_can_filter_config *filter_cfg;
+#endif
RT_ASSERT(can_device != RT_NULL);
drv_can = (struct es32f3_can *)can_device->parent.user_data;
@@ -108,17 +155,24 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
argval = (rt_uint32_t) arg;
if (argval == RT_DEVICE_FLAG_INT_RX)
{
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_FP0 | CAN_IT_FF0 | CAN_IT_FOV0 |
- CAN_IT_FP1 | CAN_IT_FF1 | CAN_IT_FOV1), DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP0, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF0, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV0, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP1, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF1, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV1, DISABLE);
}
else if (argval == RT_DEVICE_FLAG_INT_TX)
{
ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_TXM, DISABLE);
}
else if (argval == RT_DEVICE_CAN_INT_ERR)
- {
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_WARN | CAN_IT_PERR | CAN_IT_BOF |
- CAN_IT_PRERR | CAN_IT_ERR), DISABLE);
+ {
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_WARN, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PERR, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_BOF, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PRERR, DISABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_ERR, DISABLE);
}
break;
case RT_DEVICE_CTRL_SET_INT:
@@ -127,29 +181,36 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
{
NVIC_SetPriority(CAN0_RX0_IRQn, 1);
NVIC_EnableIRQ(CAN0_RX0_IRQn);
-
- NVIC_SetPriority(CAN0_RX0_IRQn, 1);
- NVIC_EnableIRQ(CAN0_RX0_IRQn);
-
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_FP0 | CAN_IT_FF0 | CAN_IT_FOV0 |
- CAN_IT_FP1 | CAN_IT_FF1 | CAN_IT_FOV1), ENABLE);
+
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP0, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF0, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV0, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FP1, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FF1, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_FOV1, ENABLE);
+
}
else if (argval == RT_DEVICE_FLAG_INT_TX)
{
NVIC_SetPriority(CAN0_TX_IRQn, 1);
NVIC_EnableIRQ(CAN0_TX_IRQn);
-
+
ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_TXM, ENABLE);
}
else if (argval == RT_DEVICE_CAN_INT_ERR)
{
NVIC_SetPriority(CAN0_EXCEPTION_IRQn, 1);
NVIC_EnableIRQ(CAN0_EXCEPTION_IRQn);
-
- ald_can_interrupt_config(&drv_can->CanHandle, (can_it_t)(CAN_IT_WARN | CAN_IT_PERR | CAN_IT_BOF |
- CAN_IT_PRERR | CAN_IT_ERR), ENABLE);
+
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_WARN, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PERR, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_BOF, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_PRERR, ENABLE);
+ ald_can_interrupt_config(&drv_can->CanHandle, CAN_IT_ERR, ENABLE);
+
}
break;
+#ifdef RT_CAN_USING_HDR
case RT_CAN_CMD_SET_FILTER:
if (RT_NULL == arg)
{
@@ -161,20 +222,70 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
filter_cfg = (struct rt_can_filter_config *)arg;
/* get default filter */
for (int i = 0; i < filter_cfg->count; i++)
- {
- drv_can->FilterConfig.number = filter_cfg->items[i].hdr;
+ {
+
+ /*默认过滤表判断*/
+ if(filter_cfg->items[i].hdr < drv_can->device.config.maxhdr)
+ drv_can->FilterConfig.number = filter_cfg->items[i].hdr;
+ else
+ drv_can->FilterConfig.number = ES_C_CAN_DEFAULT_FILTER_NUMBER;
+
+ if(filter_cfg->items[i].mode)
+ {
+ /*标识符列表模式: 类型匹配 ,id匹配为:接收的id = 配置的id
+ 或者 = 配置的mask ,通过*/
+ /*扩展帧*/
+ if(filter_cfg->items[i].ide)
+ {
+// filter_cfg->items[i].id = filter_cfg->items[i].id ; /*id 29 位*/
+ filter_cfg->items[i].mask = ((filter_cfg->items[i].mask << 3) |
+ (filter_cfg->items[i].ide << 2) |
+ (filter_cfg->items[i].rtr << 1));
+ }
+ else /*标准帧*/
+ {
+ filter_cfg->items[i].id = (filter_cfg->items[i].id << 18);
+ filter_cfg->items[i].mask = ((filter_cfg->items[i].mask << 21) |
+ (filter_cfg->items[i].ide << 2) |
+ (filter_cfg->items[i].rtr << 1));
+ }
+ }
+ else
+ {
+ /*标识符掩码模式*/
+ /*扩展帧*/
+ if(filter_cfg->items[i].ide)
+ {
+ filter_cfg->items[i].mask = (filter_cfg->items[i].mask)<<3;
+ }
+ else /*标准帧*/
+ {
+ filter_cfg->items[i].id = (filter_cfg->items[i].id)<<18;
+ filter_cfg->items[i].mask = (filter_cfg->items[i].mask)<<21;
+ }
+
+#if ES_C_CAN_FILTER_FRAME_TYPE
+ /*匹配类型*/
+ filter_cfg->items[i].mask |= 0x6;
+#endif
+
+ }
+
drv_can->FilterConfig.id_high = (filter_cfg->items[i].id >> 13) & 0xFFFF;
drv_can->FilterConfig.id_low = ((filter_cfg->items[i].id << 3) |
(filter_cfg->items[i].ide << 2) |
(filter_cfg->items[i].rtr << 1)) & 0xFFFF;
drv_can->FilterConfig.mask_id_high = (filter_cfg->items[i].mask >> 16) & 0xFFFF;
drv_can->FilterConfig.mask_id_low = filter_cfg->items[i].mask & 0xFFFF;
+
drv_can->FilterConfig.mode = (can_filter_mode_t)filter_cfg->items[i].mode;
/* Filter conf */
ald_can_filter_config(&drv_can->CanHandle, &drv_can->FilterConfig);
}
}
break;
+
+#endif
case RT_CAN_CMD_SET_MODE:
argval = (rt_uint32_t) arg;
if (argval != RT_CAN_MODE_NORMAL &&
@@ -192,18 +303,7 @@ static rt_err_t _can_control(struct rt_can_device *can_device, int cmd, void *ar
break;
case RT_CAN_CMD_SET_BAUD:
argval = (rt_uint32_t) arg;
- if (argval != CAN1MBaud &&
- argval != CAN800kBaud &&
- argval != CAN500kBaud &&
- argval != CAN250kBaud &&
- argval != CAN125kBaud &&
- argval != CAN100kBaud &&
- argval != CAN50kBaud &&
- argval != CAN20kBaud &&
- argval != CAN10kBaud)
- {
- return -RT_ERROR;
- }
+
if (argval != drv_can->device.config.baud_rate)
{
drv_can->device.config.baud_rate = argval;
@@ -312,6 +412,7 @@ static int _can_sendmsg(struct rt_can_device *can, const void *buf, rt_uint32_t
}
/* clear TIR */
h_can->perh->TxMailBox[box_num].TXID &= CAN_TXID0_TXMREQ_MSK;
+
/* Set up the Id */
if (RT_CAN_STDID == pmsg->ide)
{
@@ -336,7 +437,7 @@ static int _can_sendmsg(struct rt_can_device *can, const void *buf, rt_uint32_t
((uint32_t)pmsg->data[0] << CAN_TXDL0_BYTE0_POSS));
/* Request transmission */
SET_BIT(h_can->perh->TxMailBox[box_num].TXID, CAN_TXID0_TXMREQ_MSK);
-
+
return RT_EOK;
}
else
@@ -346,6 +447,8 @@ static int _can_sendmsg(struct rt_can_device *can, const void *buf, rt_uint32_t
return -RT_ERROR;
}
+
+
}
static int _can_recvmsg(struct rt_can_device *can, void *buf, rt_uint32_t fifo)
@@ -427,8 +530,12 @@ static void _can_rx_isr(struct rt_can_device *can, rt_uint32_t fifo)
/* RX interrupt */
else
{
+ if(CAN_RX_MSG_PENDING(h_can, CAN_RX_FIFO0) != 0)
+ {
/* save to user list */
rt_hw_can_isr(can, RT_CAN_EVENT_RX_IND | fifo << 8);
+ }
+
/* Clear FIFO0 rx Flag */
SET_BIT(h_can->perh->RXF0, CAN_RXF0_FREE_MSK);
}
@@ -444,8 +551,12 @@ static void _can_rx_isr(struct rt_can_device *can, rt_uint32_t fifo)
/* RX interrupt */
else
{
+ if(CAN_RX_MSG_PENDING(h_can, CAN_RX_FIFO1) != 0)
+ {
/* save to user list */
rt_hw_can_isr(can, RT_CAN_EVENT_RX_IND | fifo << 8);
+ }
+
/* Clear FIFO0 rx Flag */
SET_BIT(h_can->perh->RXF1, CAN_RXF1_FREE_MSK);
}
@@ -575,30 +686,30 @@ void CAN0_EXCEPTION_Handler(void)
int rt_hw_can_init(void)
{
gpio_init_t h_gpio;
- struct can_configure config = CANDEFAULTCONFIG;
-
- config.privmode = RT_CAN_MODE_NOPRIV;
- config.ticks = 50;
-#ifdef RT_CAN_USING_HDR
- config.maxhdr = 14;
-#endif
/* Initialize can common pin */
h_gpio.odos = GPIO_PUSH_PULL;
h_gpio.pupd = GPIO_PUSH_UP;
- h_gpio.podrv = GPIO_OUT_DRIVE_1;
- h_gpio.nodrv = GPIO_OUT_DRIVE_0_1;
+ h_gpio.podrv = GPIO_OUT_DRIVE_6;
+ h_gpio.nodrv = GPIO_OUT_DRIVE_6;
h_gpio.flt = GPIO_FILTER_DISABLE;
h_gpio.type = GPIO_TYPE_TTL;
- h_gpio.func = GPIO_FUNC_3;
+#if defined(ES_CAN0_RX_GPIO_FUNC)&&defined(ES_CAN0_RX_GPIO_PORT)&&defined(ES_CAN0_RX_GPIO_PIN)
/* Initialize can rx pin */
- h_gpio.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_8, &h_gpio);
-
+ h_gpio.mode = GPIO_MODE_INPUT;
+ h_gpio.func = ES_CAN0_RX_GPIO_FUNC;
+ ald_gpio_init(ES_CAN0_RX_GPIO_PORT, ES_CAN0_RX_GPIO_PIN, &h_gpio);
+#endif
+
+
+#if defined(ES_CAN0_TX_GPIO_FUNC)&&defined(ES_CAN0_TX_GPIO_PORT)&&defined(ES_CAN0_TX_GPIO_PIN)
/* Initialize can tx pin */
- h_gpio.mode = GPIO_MODE_OUTPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_9, &h_gpio);
+ h_gpio.mode = GPIO_MODE_OUTPUT;
+ h_gpio.func = ES_CAN0_TX_GPIO_FUNC;
+ ald_gpio_init(ES_CAN0_TX_GPIO_PORT, ES_CAN0_TX_GPIO_PIN, &h_gpio);
+#endif
+
/* config default filter */
can_filter_t filter = {0};
@@ -607,15 +718,21 @@ int rt_hw_can_init(void)
filter.mask_id_high = 0x0000;
filter.mask_id_low = 0x0000;
filter.fifo = CAN_FILTER_FIFO0;
- filter.number = 0;
+ filter.number = ES_C_CAN_DEFAULT_FILTER_NUMBER;
filter.mode = CAN_FILTER_MODE_MASK;
filter.scale = CAN_FILTER_SCALE_32;
filter.active = ENABLE;
can.FilterConfig = filter;
- can.device.config = config;
+ can.device.config = (struct can_configure)ES_CAN0_CONFIG;
+#ifdef RT_CAN_USING_HDR
+ can.device.config.maxhdr = 14;
+#endif
+ can.device.config.privmode = RT_CAN_MODE_NOPRIV;
+ can.device.config.ticks = 50;
+ can.device.config.reserved = ES_CAN0_SJW;
/* register CAN1 device */
- rt_hw_can_register(&can.device, "can", &_can_ops, &can);
+ rt_hw_can_register(&can.device, ES_DEVICE_NAME_CAN0, &_can_ops, &can);
return 0;
}
diff --git a/bsp/essemi/es32f369x/drivers/drv_can.h b/bsp/essemi/es32f369x/drivers/drv_can.h
index cffe4b81b0..d7eeb859aa 100644
--- a/bsp/essemi/es32f369x/drivers/drv_can.h
+++ b/bsp/essemi/es32f369x/drivers/drv_can.h
@@ -3,9 +3,22 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_CAN_H__
@@ -14,16 +27,9 @@
#include <board.h>
#include <rtdevice.h>
#include <rtthread.h>
+#include "es_conf_info_can.h"
-#include <ald_can.h>
-#include <ald_gpio.h>
-
-struct es32f3_baud_rate_tab
-{
- rt_uint32_t baud_rate;
- rt_uint32_t config_data;
-};
-
+#ifdef RT_USING_CAN
/* es32f3 can device */
struct es32f3_can
{
@@ -34,4 +40,5 @@ struct es32f3_can
int rt_hw_can_init(void);
+#endif
#endif /*DRV_CAN_H__ */
diff --git a/bsp/essemi/es32f369x/drivers/drv_gpio.c b/bsp/essemi/es32f369x/drivers/drv_gpio.c
index fa39a31ea5..8ce6ab7aa8 100644
--- a/bsp/essemi/es32f369x/drivers/drv_gpio.c
+++ b/bsp/essemi/es32f369x/drivers/drv_gpio.c
@@ -1,107 +1,40 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
-#include <rthw.h>
-#include <rtdevice.h>
#include "board.h"
#include "drv_gpio.h"
-#include <ald_cmu.h>
-#include <ald_gpio.h>
-
-#ifdef RT_USING_PIN
-#define __ES32F3_PIN(index, gpio, gpio_index) {index, GPIO##gpio, GPIO_PIN_##gpio_index}
-#define __ES32F3_PIN_DEFAULT {-1, 0, 0}
+/*管脚映射在 es_conf_info_map.h 的 pins[] 中*/
-/* ES32F3 GPIO driver */
-struct pin_index
-{
- int index;
- GPIO_TypeDef *gpio;
- uint32_t pin;
-};
+#ifdef RT_USING_PIN
-static const struct pin_index pins[] =
-{
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN(2, C, 13),
- __ES32F3_PIN(3, C, 14),
- __ES32F3_PIN(4, C, 15),
- __ES32F3_PIN(5, H, 0),
- __ES32F3_PIN(6, H, 1),
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN(8, C, 0),
- __ES32F3_PIN(9, C, 1),
- __ES32F3_PIN(10, C, 2),
- __ES32F3_PIN(11, C, 3),
- __ES32F3_PIN(12, H, 3),
- __ES32F3_PIN(13, H, 4),
- __ES32F3_PIN(14, A, 0),
- __ES32F3_PIN(15, A, 1),
- __ES32F3_PIN(16, A, 2),
- __ES32F3_PIN(17, A, 3),
- __ES32F3_PIN(18, F, 0),
- __ES32F3_PIN(19, F, 1),
- __ES32F3_PIN(20, A, 4),
- __ES32F3_PIN(21, A, 5),
- __ES32F3_PIN(22, A, 6),
- __ES32F3_PIN(23, A, 7),
- __ES32F3_PIN(24, C, 4),
- __ES32F3_PIN(25, C, 5),
- __ES32F3_PIN(26, B, 0),
- __ES32F3_PIN(27, B, 1),
- __ES32F3_PIN(28, B, 2),
- __ES32F3_PIN(29, B, 10),
- __ES32F3_PIN(30, B, 11),
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN(33, B, 12),
- __ES32F3_PIN(34, B, 13),
- __ES32F3_PIN(35, B, 14),
- __ES32F3_PIN(36, B, 15),
- __ES32F3_PIN(37, C, 6),
- __ES32F3_PIN(38, C, 7),
- __ES32F3_PIN(39, C, 8),
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN(46, A, 13),
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN(49, A, 14),
- __ES32F3_PIN(50, A, 15),
- __ES32F3_PIN(51, C, 10),
- __ES32F3_PIN(52, C, 11),
- __ES32F3_PIN(53, C, 12),
- __ES32F3_PIN(54, D, 2),
- __ES32F3_PIN(55, B, 3),
- __ES32F3_PIN(56, B, 4),
- __ES32F3_PIN(57, B, 5),
- __ES32F3_PIN(58, B, 6),
- __ES32F3_PIN(59, B, 7),
- __ES32F3_PIN(60, H, 2),
- __ES32F3_PIN(61, B, 8),
- __ES32F3_PIN(62, B, 9),
- __ES32F3_PIN_DEFAULT,
- __ES32F3_PIN_DEFAULT,
-};
struct pin_irq_map
{
rt_uint16_t pinbit;
IRQn_Type irqno;
};
+
static const struct pin_irq_map pin_irq_map[] =
{
{GPIO_PIN_0, EXTI0_IRQn},
@@ -140,7 +73,151 @@ struct rt_pin_irq_hdr pin_irq_hdr_tab[] =
{ -1, 0, RT_NULL, RT_NULL},
{ -1, 0, RT_NULL, RT_NULL},
{ -1, 0, RT_NULL, RT_NULL},
-};
+};
+
+#ifdef ES_CONF_EXTI_IRQ_0
+
+RT_WEAK void irq_pin0_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 0\r\n");
+}
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_1
+
+RT_WEAK void irq_pin1_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 1\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_2
+
+ RT_WEAK void irq_pin2_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 2\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_3
+
+RT_WEAK void irq_pin3_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 3\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_4
+
+RT_WEAK void irq_pin4_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 4\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_5
+
+RT_WEAK void irq_pin5_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 5\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_6
+
+RT_WEAK void irq_pin6_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 6\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_7
+
+RT_WEAK void irq_pin7_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 7\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_8
+
+RT_WEAK void irq_pin8_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 8\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_9
+
+RT_WEAK void irq_pin9_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 9\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_10
+
+RT_WEAK void irq_pin10_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 10\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_11
+
+RT_WEAK void irq_pin11_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 11\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_12
+
+RT_WEAK void irq_pin12_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 12\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_13
+
+RT_WEAK void irq_pin13_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 13\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_14
+
+RT_WEAK void irq_pin14_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 14\r\n");
+}
+
+#endif
+
+#ifdef ES_CONF_EXTI_IRQ_15
+
+RT_WEAK void irq_pin15_callback(void* arg)
+{
+ rt_kprintf("\r\nEXTI 15\r\n");
+}
+
+#endif
+
#define ITEM_NUM(items) sizeof(items) / sizeof(items[0])
const struct pin_index *get_pin(uint8_t pin)
@@ -200,8 +277,8 @@ void es32f3_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
gpio_initstruct.podrv = GPIO_OUT_DRIVE_1;
gpio_initstruct.nodrv = GPIO_OUT_DRIVE_0_1;
gpio_initstruct.type = GPIO_TYPE_CMOS;
- gpio_initstruct.pupd = GPIO_FLOATING;
- gpio_initstruct.odos = GPIO_PUSH_PULL;
+ gpio_initstruct.odos = GPIO_PUSH_PULL;
+ gpio_initstruct.flt = GPIO_FILTER_DISABLE;
if (mode == PIN_MODE_OUTPUT)
{
@@ -364,7 +441,11 @@ rt_err_t es32f3_pin_irq_enable(struct rt_device *device, rt_base_t pin,
ald_gpio_exti_init(index->gpio, index->pin, &exti_initstruct);
/* Configure GPIO_InitStructure */
gpio_initstruct.mode = GPIO_MODE_INPUT;
- gpio_initstruct.func = GPIO_FUNC_1;
+ gpio_initstruct.odos = GPIO_PUSH_PULL;
+ gpio_initstruct.podrv = GPIO_OUT_DRIVE_1;
+ gpio_initstruct.nodrv = GPIO_OUT_DRIVE_1;
+ gpio_initstruct.func = GPIO_FUNC_1;
+ gpio_initstruct.flt = GPIO_FILTER_DISABLE;
switch (pin_irq_hdr_tab[irqindex].mode)
{
case PIN_IRQ_MODE_RISING:
@@ -408,18 +489,9 @@ const static struct rt_pin_ops _es32f3_pin_ops =
es32f3_pin_attach_irq,
es32f3_pin_detach_irq,
es32f3_pin_irq_enable,
- RT_NULL,
+ /*RT_NULL,*/
};
-int rt_hw_pin_init(void)
-{
- int result;
- ald_cmu_perh_clock_config(CMU_PERH_GPIO, ENABLE);
- result = rt_device_pin_register("pin", &_es32f3_pin_ops, RT_NULL);
- return result;
-}
-INIT_BOARD_EXPORT(rt_hw_pin_init);
-
rt_inline void pin_irq_hdr(uint16_t GPIO_Pin)
{
uint16_t irqno;
@@ -560,4 +632,44 @@ void EXTI15_Handler(void)
rt_interrupt_leave();
}
+int rt_hw_pin_init(void)
+{
+ int result;
+
+
+#ifdef ES_INIT_GPIOS
+
+ rt_size_t i,gpio_conf_num = sizeof(gpio_conf_all) / sizeof(gpio_conf_t);
+
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_GPIO, ENABLE);
+
+ result = rt_device_pin_register(ES_DEVICE_NAME_PIN, &_es32f3_pin_ops, RT_NULL);
+
+ if(result != RT_EOK)return result;
+
+#ifdef ES_INIT_GPIOS
+
+ for(i = 0;i < gpio_conf_num;i++)
+ {
+ rt_pin_mode( gpio_conf_all[i].pin,gpio_conf_all[i].pin_mode);
+
+ if((gpio_conf_all[i].pin_mode == ES_C_GPIO_MODE_OUTPUT)||(gpio_conf_all[i].pin_mode == ES_C_GPIO_MODE_OUTPUT_OD))
+ rt_pin_write(gpio_conf_all[i].pin,gpio_conf_all[i].pin_level);
+
+ if(!gpio_conf_all[i].irq_en)continue;
+
+ rt_pin_attach_irq(gpio_conf_all[i].pin, gpio_conf_all[i].irq_mode, gpio_conf_all[i].callback, RT_NULL);
+ rt_pin_irq_enable(gpio_conf_all[i].pin, gpio_conf_all[i].irq_en);
+ }
+
+#endif
+
+
+
+ return result;
+}
+INIT_BOARD_EXPORT(rt_hw_pin_init);
+
#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_gpio.h b/bsp/essemi/es32f369x/drivers/drv_gpio.h
index fef8fb8487..8489e625d5 100644
--- a/bsp/essemi/es32f369x/drivers/drv_gpio.h
+++ b/bsp/essemi/es32f369x/drivers/drv_gpio.h
@@ -3,14 +3,29 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_GPIO_H__
#define DRV_GPIO_H__
+#include "es_conf_info_gpio.h"
+
int rt_hw_pin_init(void);
#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_hwtimer.c b/bsp/essemi/es32f369x/drivers/drv_hwtimer.c
index f693137ae7..e0fd46a36b 100644
--- a/bsp/essemi/es32f369x/drivers/drv_hwtimer.c
+++ b/bsp/essemi/es32f369x/drivers/drv_hwtimer.c
@@ -1,21 +1,33 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
* 2019-3-19 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <drv_hwtimer.h>
-#include <board.h>
-#include <ald_cmu.h>
-#include <ald_timer.h>
+#include <board.h>
+
#ifdef RT_USING_HWTIMER
@@ -26,53 +38,167 @@ struct es32f3_hwtimer_dev
IRQn_Type IRQn;
};
-#ifdef BSP_USING_HWTIMER0
-static struct es32f3_hwtimer_dev hwtimer0;
+#ifdef BSP_USING_AD16C4T0_HWTIMER
+static struct es32f3_hwtimer_dev ad16c4t0_hwtimer;
-void BS16T0_Handler(void)
+static struct rt_hwtimer_info ad16c4t0_info =
{
- ald_timer_clear_flag_status(hwtimer0.hwtimer_periph, TIMER_FLAG_UPDATE);
- rt_device_hwtimer_isr(&hwtimer0.parent);
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_AD16C4T0_HWTIMER_MODE
+};
- if (HWTIMER_MODE_ONESHOT == hwtimer0.parent.mode)
- {
- ald_timer_base_stop(hwtimer0.hwtimer_periph);
- }
+void AD16C4T0_UP_Handler(void)
+{
+ ald_timer_clear_flag_status(ad16c4t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&ad16c4t0_hwtimer.parent);
}
+
#endif
-#ifdef BSP_USING_HWTIMER1
-static struct es32f3_hwtimer_dev hwtimer1;
-/* can not use when UART2 Handler is enabled */
-void BS16T1_Handler(void)
+#ifdef BSP_USING_AD16C4T1_HWTIMER
+
+static struct es32f3_hwtimer_dev ad16c4t1_hwtimer;
+
+static struct rt_hwtimer_info ad16c4t1_info =
{
- /* if BS16T1 it */
- if (ald_timer_get_it_status(hwtimer1.hwtimer_periph, TIMER_IT_UPDATE) &&
- ald_timer_get_flag_status(hwtimer1.hwtimer_periph, TIMER_FLAG_UPDATE))
- {
- ald_timer_clear_flag_status(hwtimer1.hwtimer_periph, TIMER_FLAG_UPDATE);
- rt_device_hwtimer_isr(&hwtimer1.parent);
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_AD16C4T1_HWTIMER_MODE
+};
- if (HWTIMER_MODE_ONESHOT == hwtimer1.parent.mode)
- {
- ald_timer_base_stop(hwtimer1.hwtimer_periph);
- }
- }
+void AD16C4T1_UP_Handler(void)
+{
+ ald_timer_clear_flag_status(ad16c4t1_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&ad16c4t1_hwtimer.parent);
+}
+
+#endif
+#ifdef BSP_USING_GP32C4T0_HWTIMER
+
+static struct es32f3_hwtimer_dev gp32c4t0_hwtimer;
+
+static struct rt_hwtimer_info gp32c4t0_info =
+{
+
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV , /* maximum count frequency */
+ ( ES_SYS_CLK >> ES_CMU_PCLK_1_DIV )/(1U<<16), /* minimum count frequency */
+ 0xFFFFFFFF, /* counter maximum value */
+ ES_GP32C4T0_HWTIMER_MODE
+};
+
+void GP32C4T0_Handler(void)
+{
+ ald_timer_clear_flag_status(gp32c4t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&gp32c4t0_hwtimer.parent);
+}
+
+#endif
+#ifdef BSP_USING_GP32C4T1_HWTIMER
+
+static struct es32f3_hwtimer_dev gp32c4t1_hwtimer;
+
+static struct rt_hwtimer_info gp32c4t1_info =
+{
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV ), /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV )/(1U<<16), /* minimum count frequency */
+ 0xFFFFFFFF, /* counter maximum value */
+ ES_GP32C4T1_HWTIMER_MODE
+};
+
+void GP32C4T1_Handler(void)
+{
+ ald_timer_clear_flag_status(gp32c4t1_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&gp32c4t1_hwtimer.parent);
}
+
#endif
+#ifdef BSP_USING_GP16C4T0_HWTIMER
+
+static struct es32f3_hwtimer_dev gp16c4t0_hwtimer;
-static struct rt_hwtimer_info es32f3_hwtimer_info =
+static struct rt_hwtimer_info gp16c4t0_info =
{
- 96000000, /* maximum count frequency */
- 1, /* minimum count frequency */
- 65535, /* counter maximum value */
- HWTIMER_CNTMODE_UP
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_GP16C4T0_HWTIMER_MODE
};
+void GP16C4T0_Handler(void)
+{
+ ald_timer_clear_flag_status(gp16c4t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&gp16c4t0_hwtimer.parent);
+}
+
+#endif
+#ifdef BSP_USING_GP16C4T1_HWTIMER
+
+static struct es32f3_hwtimer_dev gp16c4t1_hwtimer;
+
+static struct rt_hwtimer_info gp16c4t1_info =
+{
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_GP16C4T1_HWTIMER_MODE
+};
+
+void GP16C4T1_Handler(void)
+{
+ ald_timer_clear_flag_status(gp16c4t1_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&gp16c4t1_hwtimer.parent);
+}
+
+#endif
+#ifdef BSP_USING_BS16T0_HWTIMER
+
+static struct es32f3_hwtimer_dev bs16t0_hwtimer;
+
+static struct rt_hwtimer_info bs16t0_info =
+{
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_BS16T0_HWTIMER_MODE
+};
+
+void BS16T0_Handler(void)
+{
+ ald_timer_clear_flag_status(bs16t0_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&bs16t0_hwtimer.parent);
+}
+
+#endif
+#ifdef BSP_USING_BS16T1_HWTIMER
+
+static struct es32f3_hwtimer_dev bs16t1_hwtimer;
+
+static struct rt_hwtimer_info bs16t1_info =
+{
+ ES_SYS_CLK >> ES_CMU_PCLK_1_DIV, /* maximum count frequency */
+ (ES_SYS_CLK >> ES_CMU_PCLK_1_DIV)/(1U<<16), /* minimum count frequency */
+ 0xFFFF, /* counter maximum value */
+ ES_BS16T1_HWTIMER_MODE
+};
+
+void BS16T1_Handler(void)
+{
+ ald_timer_clear_flag_status(bs16t1_hwtimer.hwtimer_periph, TIMER_FLAG_UPDATE);
+ rt_device_hwtimer_isr(&bs16t1_hwtimer.parent);
+}
+
+#endif
+
static void es32f3_hwtimer_init(rt_hwtimer_t *timer, rt_uint32_t state)
{
struct es32f3_hwtimer_dev *hwtimer = (struct es32f3_hwtimer_dev *)timer->parent.user_data;
+ struct rt_hwtimer_info *hwtimer_info = (struct rt_hwtimer_info *)timer->info;
+
+
RT_ASSERT(hwtimer != RT_NULL);
if (1 == state)
@@ -81,19 +207,21 @@ static void es32f3_hwtimer_init(rt_hwtimer_t *timer, rt_uint32_t state)
ald_timer_interrupt_config(hwtimer->hwtimer_periph, TIMER_IT_UPDATE, ENABLE);
NVIC_EnableIRQ(hwtimer->IRQn);
}
- hwtimer->parent.freq = ald_cmu_get_pclk1_clock();
- es32f3_hwtimer_info.maxfreq = ald_cmu_get_pclk1_clock();
- es32f3_hwtimer_info.minfreq = ald_cmu_get_pclk1_clock();
+
+ hwtimer->parent.freq = ald_cmu_get_pclk1_clock()/((hwtimer->hwtimer_periph->perh->PRES & 0xFFFF)+1);
+ hwtimer_info->maxfreq = hwtimer->parent.freq;
+ hwtimer_info->minfreq = (hwtimer->parent.freq)/0xFFFF;
+
}
static rt_err_t es32f3_hwtimer_start(rt_hwtimer_t *timer,
rt_uint32_t cnt,
rt_hwtimer_mode_t mode)
{
- struct es32f3_hwtimer_dev *hwtimer = (struct es32f3_hwtimer_dev *)timer->parent.user_data;
+ struct es32f3_hwtimer_dev *hwtimer = (struct es32f3_hwtimer_dev *)timer->parent.user_data;
RT_ASSERT(hwtimer != RT_NULL);
-
+
WRITE_REG(hwtimer->hwtimer_periph->perh->AR, cnt);
ald_timer_base_start(hwtimer->hwtimer_periph);
@@ -135,10 +263,37 @@ static rt_err_t es32f3_hwtimer_control(rt_hwtimer_t *timer,
{
case HWTIMER_CTRL_FREQ_SET:
freq = *(rt_uint32_t *)args;
- if (freq != ald_cmu_get_pclk1_clock())
- {
- ret = -RT_ERROR;
+
+ ret = -RT_ERROR;
+
+ if(freq)
+ {
+ double temp,target;
+ temp = (double)ald_cmu_get_pclk1_clock();
+ target = temp/freq;
+
+ if(target < 0x10001) /*最大分频 = max(PRES)+1*/
+ {
+ temp = target - (int)(target);
+
+ if((temp > 0.998)&&(target < 0x10000))
+ {
+ hwtimer->hwtimer_periph->perh->PRES = (uint32_t)target;
+ ret = RT_EOK;
+ }
+ if((temp < 0.002)&&(target >= 0x1))
+ {
+ hwtimer->hwtimer_periph->perh->PRES = (uint32_t)target - 1;
+ ret = RT_EOK;
+ }
+
+ }
+
+ if(ret == RT_EOK) /*更新信息*/
+ hwtimer->parent.freq = ald_cmu_get_pclk1_clock()/((hwtimer->hwtimer_periph->perh->PRES & 0xFFFF)+1);
+
}
+
break;
case HWTIMER_CTRL_STOP:
@@ -166,24 +321,124 @@ int rt_hw_hwtimer_init(void)
{
rt_err_t ret = RT_EOK;
-#ifdef BSP_USING_HWTIMER0
- static timer_handle_t _hwtimer_periph0;
- _hwtimer_periph0.perh = BS16T0;
- hwtimer0.IRQn = BS16T0_IRQn;
- hwtimer0.hwtimer_periph = &_hwtimer_periph0;
- hwtimer0.parent.info = &es32f3_hwtimer_info;
- hwtimer0.parent.ops = &es32f3_hwtimer_ops;
- ret = rt_device_hwtimer_register(&hwtimer0.parent, "timer0", &hwtimer0);
+#ifdef BSP_USING_AD16C4T0_HWTIMER
+ static timer_handle_t ad16c4t0_hwtimer_periph;
+
+ ad16c4t0_hwtimer_periph.perh = AD16C4T0;
+ ad16c4t0_hwtimer.IRQn = AD16C4T0_UP_IRQn;
+
+ ad16c4t0_hwtimer_periph.init.prescaler = ES_AD16C4T0_HWTIMER_PRES - 1;
+ ad16c4t0_hwtimer_periph.init.mode = ( ES_AD16C4T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ ad16c4t0_hwtimer.hwtimer_periph = &ad16c4t0_hwtimer_periph;
+
+ ad16c4t0_hwtimer.parent.info = &ad16c4t0_info;
+ ad16c4t0_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&ad16c4t0_hwtimer.parent, ES_DEVICE_NAME_AD16C4T0_HWTIMER, &ad16c4t0_hwtimer);
+#endif
+
+#ifdef BSP_USING_AD16C4T1_HWTIMER
+ static timer_handle_t ad16c4t1_hwtimer_periph;
+
+ ad16c4t1_hwtimer_periph.perh = AD16C4T1;
+ ad16c4t1_hwtimer.IRQn = AD16C4T1_UP_IRQn;
+
+ ad16c4t1_hwtimer_periph.init.prescaler = ES_AD16C4T1_HWTIMER_PRES - 1;
+ ad16c4t1_hwtimer_periph.init.mode = ( ES_AD16C4T1_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ ad16c4t1_hwtimer.hwtimer_periph = &ad16c4t1_hwtimer_periph;
+
+ ad16c4t1_hwtimer.parent.info = &ad16c4t1_info;
+ ad16c4t1_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&ad16c4t1_hwtimer.parent, ES_DEVICE_NAME_AD16C4T1_HWTIMER, &ad16c4t1_hwtimer);
+#endif
+
+#ifdef BSP_USING_GP32C4T0_HWTIMER
+ static timer_handle_t gp32c4t0_hwtimer_periph;
+
+ gp32c4t0_hwtimer_periph.perh = GP32C4T0;
+ gp32c4t0_hwtimer.IRQn = GP32C4T0_IRQn;
+
+ gp32c4t0_hwtimer_periph.init.prescaler = ES_GP32C4T0_HWTIMER_PRES - 1;
+ gp32c4t0_hwtimer_periph.init.mode = ( ES_GP32C4T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ gp32c4t0_hwtimer.hwtimer_periph = &gp32c4t0_hwtimer_periph;
+
+ gp32c4t0_hwtimer.parent.info = &gp32c4t0_info;
+ gp32c4t0_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&gp32c4t0_hwtimer.parent, ES_DEVICE_NAME_GP32C4T0_HWTIMER, &gp32c4t0_hwtimer);
+#endif
+
+#ifdef BSP_USING_GP32C4T1_HWTIMER
+ static timer_handle_t gp32c4t1_hwtimer_periph;
+
+ gp32c4t1_hwtimer_periph.perh = GP32C4T1;
+ gp32c4t1_hwtimer.IRQn = GP32C4T1_IRQn;
+
+ gp32c4t1_hwtimer_periph.init.prescaler = ES_GP32C4T1_HWTIMER_PRES - 1;
+ gp32c4t1_hwtimer_periph.init.mode = ( ES_GP32C4T1_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ gp32c4t1_hwtimer.hwtimer_periph = &gp32c4t1_hwtimer_periph;
+
+ gp32c4t1_hwtimer.parent.info = &gp32c4t1_info;
+ gp32c4t1_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&gp32c4t1_hwtimer.parent, ES_DEVICE_NAME_GP32C4T1_HWTIMER, &gp32c4t1_hwtimer);
+#endif
+
+#ifdef BSP_USING_GP16C4T0_HWTIMER
+ static timer_handle_t gp16c4t0_hwtimer_periph;
+
+ gp16c4t0_hwtimer_periph.perh = GP16C4T0;
+ gp16c4t0_hwtimer.IRQn = GP16C4T0_IRQn;
+
+ gp16c4t0_hwtimer_periph.init.prescaler = ES_GP16C4T0_HWTIMER_PRES - 1;
+ gp16c4t0_hwtimer_periph.init.mode = ( ES_GP16C4T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ gp16c4t0_hwtimer.hwtimer_periph = &gp16c4t0_hwtimer_periph;
+
+ gp16c4t0_hwtimer.parent.info = &gp16c4t0_info;
+ gp16c4t0_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&gp16c4t0_hwtimer.parent, ES_DEVICE_NAME_GP16C4T0_HWTIMER, &gp16c4t0_hwtimer);
+#endif
+
+#ifdef BSP_USING_GP16C4T1_HWTIMER
+ static timer_handle_t gp16c4t1_hwtimer_periph;
+
+ gp16c4t1_hwtimer_periph.perh = GP16C4T1;
+ gp16c4t1_hwtimer.IRQn = GP16C4T1_IRQn;
+
+ gp16c4t1_hwtimer_periph.init.prescaler = ES_GP16C4T1_HWTIMER_PRES - 1;
+ gp16c4t1_hwtimer_periph.init.mode = ( ES_GP16C4T1_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ gp16c4t1_hwtimer.hwtimer_periph = &gp16c4t1_hwtimer_periph;
+
+ gp16c4t1_hwtimer.parent.info = &gp16c4t1_info;
+ gp16c4t1_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&gp16c4t1_hwtimer.parent, ES_DEVICE_NAME_GP16C4T1_HWTIMER, &gp16c4t1_hwtimer);
+#endif
+
+#ifdef BSP_USING_BS16T0_HWTIMER
+ static timer_handle_t bs16t0_hwtimer_periph;
+
+ bs16t0_hwtimer_periph.perh = BS16T0;
+ bs16t0_hwtimer.IRQn = BS16T0_IRQn;
+
+ bs16t0_hwtimer_periph.init.prescaler = ES_BS16T0_HWTIMER_PRES - 1;
+ bs16t0_hwtimer_periph.init.mode = ( ES_BS16T0_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ bs16t0_hwtimer.hwtimer_periph = &bs16t0_hwtimer_periph;
+
+ bs16t0_hwtimer.parent.info = &bs16t0_info;
+ bs16t0_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&bs16t0_hwtimer.parent, ES_DEVICE_NAME_BS16T0_HWTIMER, &bs16t0_hwtimer);
#endif
-#ifdef BSP_USING_HWTIMER1
- static timer_handle_t _hwtimer_periph1;
- _hwtimer_periph1.perh = BS16T1;
- hwtimer1.IRQn = BS16T1_IRQn;
- hwtimer1.hwtimer_periph = &_hwtimer_periph1;
- hwtimer1.parent.info = &es32f3_hwtimer_info;
- hwtimer1.parent.ops = &es32f3_hwtimer_ops;
- ret = rt_device_hwtimer_register(&hwtimer1.parent, "timer1", &hwtimer1);
+#ifdef BSP_USING_BS16T1_HWTIMER
+ static timer_handle_t bs16t1_hwtimer_periph;
+
+ bs16t1_hwtimer_periph.perh = BS16T1;
+ bs16t1_hwtimer.IRQn = BS16T1_IRQn;
+
+ bs16t1_hwtimer_periph.init.prescaler = ES_BS16T1_HWTIMER_PRES - 1;
+ bs16t1_hwtimer_periph.init.mode = ( ES_BS16T1_HWTIMER_MODE == HWTIMER_CNTMODE_UP )? TIMER_CNT_MODE_UP : TIMER_CNT_MODE_DOWN;
+ bs16t1_hwtimer.hwtimer_periph = &bs16t1_hwtimer_periph;
+
+ bs16t1_hwtimer.parent.info = &bs16t1_info;
+ bs16t1_hwtimer.parent.ops = &es32f3_hwtimer_ops;
+ ret = rt_device_hwtimer_register(&bs16t1_hwtimer.parent, ES_DEVICE_NAME_BS16T1_HWTIMER, &bs16t1_hwtimer);
#endif
return ret;
diff --git a/bsp/essemi/es32f369x/drivers/drv_hwtimer.h b/bsp/essemi/es32f369x/drivers/drv_hwtimer.h
index e18d580fbd..46e307a5c3 100644
--- a/bsp/essemi/es32f369x/drivers/drv_hwtimer.h
+++ b/bsp/essemi/es32f369x/drivers/drv_hwtimer.h
@@ -3,14 +3,28 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-3-19 wangyq the first version
+ * 2019-3-19 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_HWTIMER_H__
#define DRV_HWTIMER_H__
+#include "es_conf_info_hwtimer.h"
int rt_hw_hwtimer_init(void);
#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_i2c.c b/bsp/essemi/es32f369x/drivers/drv_i2c.c
index 207890a6d4..c398d5ab45 100644
--- a/bsp/essemi/es32f369x/drivers/drv_i2c.c
+++ b/bsp/essemi/es32f369x/drivers/drv_i2c.c
@@ -1,12 +1,24 @@
/*
- * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
- * Date Author Notes
- * 2020-01-14 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * Date Author Notes
+ * 2019-11-01 wangyq update libraries
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
@@ -14,9 +26,7 @@
#include <rtdevice.h>
#include "board.h"
#include "drv_i2c.h"
-#include <ald_i2c.h>
-#include <ald_gpio.h>
-#include <rtdbg.h>
+
#ifdef RT_USING_I2C
@@ -43,36 +53,58 @@ static void _i2c_init(void)
gpio_instruct.nodrv = GPIO_OUT_DRIVE_0_1;
gpio_instruct.flt = GPIO_FILTER_DISABLE;
gpio_instruct.type = GPIO_TYPE_CMOS;
- gpio_instruct.func = GPIO_FUNC_5;
+
+
+#ifdef BSP_USING_I2C0
+
+#if defined(ES_I2C0_SCL_GPIO_FUNC)&&defined(ES_I2C0_SCL_GPIO_PORT)&&defined(ES_I2C0_SCL_GPIO_PIN)
+ gpio_instruct.func = ES_I2C0_SCL_GPIO_FUNC;
+ ald_gpio_init(ES_I2C0_SCL_GPIO_PORT, ES_I2C0_SCL_GPIO_PIN, &gpio_instruct);
+#endif
+
+#if defined(ES_I2C0_SDA_GPIO_FUNC)&&defined(ES_I2C0_SDA_GPIO_PORT)&&defined(ES_I2C0_SDA_GPIO_PIN)
+ gpio_instruct.func = ES_I2C0_SDA_GPIO_FUNC;
+ ald_gpio_init(ES_I2C0_SDA_GPIO_PORT, ES_I2C0_SDA_GPIO_PIN, &gpio_instruct);
+#endif
-#ifdef BSP_USING_I2C0
/* Initialize I2C Function */
- _h_i2c0.perh = I2C0;
- _h_i2c0.init.clk_speed = 100000;
- _h_i2c0.init.own_addr1 = 0x0A;
- _h_i2c0.init.addr_mode = I2C_ADDR_7BIT;
- _h_i2c0.init.general_call = I2C_GENERALCALL_DISABLE;
- _h_i2c0.init.no_stretch = I2C_NOSTRETCH_ENABLE;
+ _h_i2c0.perh = I2C0;
+ _h_i2c0.init.module = I2C_MODULE_MASTER;
+ _h_i2c0.init.clk_speed = ES_I2C0_CLK_SPEED;
+ _h_i2c0.init.own_addr1 = ES_I2C0_OWN_ADDR1;
+ _h_i2c0.init.addr_mode = ES_I2C0_ADDR_MODE;
+ _h_i2c0.init.general_call = ES_I2C0_GENERAL_CALL;
+ _h_i2c0.init.no_stretch = ES_I2C0_STRETCH;
ald_i2c_reset(&_h_i2c0);
ald_i2c_init(&_h_i2c0);
- /* PB06->I2C0_SCL, PB07->I2C0_SDA */
- ald_gpio_init(GPIOB, GPIO_PIN_6 | GPIO_PIN_7, &gpio_instruct);
+
#endif
-#ifdef BSP_USING_I2C1
+#ifdef BSP_USING_I2C1
+
+#if defined(ES_I2C1_SDA_GPIO_FUNC)&&defined(ES_I2C1_SDA_GPIO_PORT)&&defined(ES_I2C1_SDA_GPIO_PIN)
+ gpio_instruct.func = ES_I2C1_SDA_GPIO_FUNC;
+ ald_gpio_init(ES_I2C1_SDA_GPIO_PORT, ES_I2C1_SDA_GPIO_PIN, &gpio_instruct);
+#endif
+
+#if defined(ES_I2C1_SDA_GPIO_FUNC)&&defined(ES_I2C1_SDA_GPIO_PORT)&&defined(ES_I2C1_SDA_GPIO_PIN)
+ gpio_instruct.func = ES_I2C1_SDA_GPIO_FUNC;
+ ald_gpio_init(ES_I2C1_SDA_GPIO_PORT, ES_I2C1_SDA_GPIO_PIN, &gpio_instruct);
+#endif
+
/* Initialize i2c function */
- _h_i2c1.perh = I2C1;
- _h_i2c1.init.clk_speed = 100000;
- _h_i2c1.init.own_addr1 = 0xA0;
- _h_i2c1.init.addr_mode = I2C_ADDR_7BIT;
- _h_i2c1.init.general_call = I2C_GENERALCALL_DISABLE;
- _h_i2c1.init.no_stretch = I2C_NOSTRETCH_ENABLE;
+ _h_i2c1.perh = I2C1;
+ _h_i2c1.init.module = I2C_MODULE_MASTER;
+ _h_i2c1.init.clk_speed = ES_I2C1_CLK_SPEED;
+ _h_i2c1.init.own_addr1 = ES_I2C1_OWN_ADDR1;
+ _h_i2c1.init.addr_mode = ES_I2C1_ADDR_MODE;
+ _h_i2c1.init.general_call = ES_I2C1_GENERAL_CALL;
+ _h_i2c1.init.no_stretch = ES_I2C1_STRETCH;
ald_i2c_reset(&_h_i2c1);
ald_i2c_init(&_h_i2c1);
- /* PA05->I2C1_SCL, PA06->I2C1_SDA */
- ald_gpio_init(GPIOA, GPIO_PIN_5 | GPIO_PIN_6, &gpio_instruct);
+
#endif
}
@@ -133,7 +165,7 @@ int rt_hw_i2c_init(void)
_i2c_device0.ops = &es32f3_i2c_ops;
_i2c_device0.priv = &_h_i2c0;
- result = rt_i2c_bus_device_register(&_i2c_device0, "i2c0");
+ result = rt_i2c_bus_device_register(&_i2c_device0, ES_DEVICE_NAME_I2C0);
if (result != RT_EOK)
{
return result;
@@ -147,7 +179,7 @@ int rt_hw_i2c_init(void)
_i2c_device1.ops = &es32f3_i2c_ops;
_i2c_device1.priv = &_h_i2c1;
- rt_i2c_bus_device_register(&_i2c_device1, "i2c1");
+ rt_i2c_bus_device_register(&_i2c_device1, ES_DEVICE_NAME_I2C1);
if (result != RT_EOK)
{
return result;
diff --git a/bsp/essemi/es32f369x/drivers/drv_i2c.h b/bsp/essemi/es32f369x/drivers/drv_i2c.h
index d7c2410682..16bfa324d3 100644
--- a/bsp/essemi/es32f369x/drivers/drv_i2c.h
+++ b/bsp/essemi/es32f369x/drivers/drv_i2c.h
@@ -1,16 +1,31 @@
/*
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
*
- * SPDX-License-Identifier: Apache-2.0
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_I2C_H__
#define DRV_I2C_H__
+#include "es_conf_info_i2c.h"
+
int rt_hw_i2c_init(void);
#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_pm.c b/bsp/essemi/es32f369x/drivers/drv_pm.c
index ffe46ff6f3..5ec1c8c701 100644
--- a/bsp/essemi/es32f369x/drivers/drv_pm.c
+++ b/bsp/essemi/es32f369x/drivers/drv_pm.c
@@ -3,16 +3,27 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2020-12-15 liuhy the first version
*/
-#include "drv_pm.h"
+#include "drv_pm.h"
#ifdef RT_USING_PM
-//uint32_t save_mem[1024] __attribute__ ((aligned(4)));
void save_register(void *p_head,uint32_t size,void *p_save)
{
@@ -21,15 +32,17 @@ void save_register(void *p_head,uint32_t size,void *p_save)
void load_register(void *p_head,uint32_t size,void *p_load)
{
- uint32_t tmp;
memcpy(p_head,p_load,size);
-
+
+#ifdef ES_PMU_SAVE_LOAD_UART
+
if((p_head == UART0) || (p_head == UART1) || (p_head == UART2) ||
(p_head == UART3) || (p_head == UART4) || (p_head == UART5) )
{
- tmp = ((UART_TypeDef*)p_load)->IVS;
- ((UART_TypeDef*)p_head)->IER = tmp;
+ ((UART_TypeDef*)p_head)->IER = ((UART_TypeDef*)p_load)->IVS;
}
+#endif
+
}
static void uart_console_reconfig(void)
@@ -39,36 +52,14 @@ static void uart_console_reconfig(void)
rt_device_control(rt_console_get_device(), RT_DEVICE_CTRL_CONFIG, &config);
}
-static void delay(void)
-{
- long i;
- rt_base_t level;
-
- level = rt_hw_interrupt_disable();
- i = 0;
- do{
- i++;
- }
- while (i < 4000000);
-
- rt_hw_interrupt_enable(level);
-}
-
/**
* This function will put ES32F369x into sleep mode.
*
* @param pm pointer to power manage structure
*/
-struct pm_callback_t
-{
- volatile int in_fun_times; /*进入函数的次数*/
- volatile char flag; /*标志*/
- volatile int mode; /*需要打印的模式*/
-};
-
-extern volatile struct pm_callback_t g_pm_data;
+/* 注意:进入睡眠前,如果有中断挂起(SYSTICK、PENDSV、UART、EXTI等),睡眠将被瞬间唤醒。*/
static void sleep(struct rt_pm *pm, uint8_t mode)
{
@@ -83,26 +74,21 @@ static void sleep(struct rt_pm *pm, uint8_t mode)
case PM_SLEEP_MODE_LIGHT:
/* Enter SLEEP Mode, Main regulator is ON */
ald_pmu_stop1_enter();
- delay();
-
break;
case PM_SLEEP_MODE_DEEP:
- /* Enter STOP 2 mode */
+ /* Enter STOP 2 mode */
ald_pmu_stop2_enter();
- delay();
break;
case PM_SLEEP_MODE_STANDBY:
- /* Enter STANDBY mode */
+ /* Enter STANDBY mode */
ald_pmu_stop2_enter();
- delay();
break;
case PM_SLEEP_MODE_SHUTDOWN:
- /* Enter SHUTDOWNN mode */
+ /* Enter SHUTDOWNN mode */
ald_pmu_stop2_enter();
- delay();
break;
default:
diff --git a/bsp/essemi/es32f369x/drivers/drv_pm.h b/bsp/essemi/es32f369x/drivers/drv_pm.h
index 56de29eef5..874f86ed08 100644
--- a/bsp/essemi/es32f369x/drivers/drv_pm.h
+++ b/bsp/essemi/es32f369x/drivers/drv_pm.h
@@ -3,9 +3,22 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-04-01 wangyq the first version
+ * 2019-04-01 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_PM_H__
@@ -14,9 +27,8 @@
#include <rthw.h>
#include <board.h>
#include <rtdevice.h>
-#include <ald_cmu.h>
-#include <ald_pmu.h>
-#include "shell.h"
+#include "es_conf_info_pm.h"
+#include <string.h>
int rt_hw_pm_init(void);
diff --git a/bsp/essemi/es32f369x/drivers/drv_pwm.c b/bsp/essemi/es32f369x/drivers/drv_pwm.c
index e033e47cec..b61e363633 100644
--- a/bsp/essemi/es32f369x/drivers/drv_pwm.c
+++ b/bsp/essemi/es32f369x/drivers/drv_pwm.c
@@ -3,28 +3,33 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-03-11 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
-#include <ald_cmu.h>
-#include <ald_timer.h>
-#include <ald_gpio.h>
+#include "es_conf_info_pwm.h"
-static void pwm_set_freq(timer_handle_t *timer_initstruct, uint32_t ns)
-{
- uint64_t _arr = (uint64_t)ald_cmu_get_pclk1_clock() * ns / 1000000000 /
- (timer_initstruct->init.prescaler + 1);
- WRITE_REG(timer_initstruct->perh->AR, (uint32_t)_arr);
- timer_initstruct->init.period = (uint32_t)_arr;
-}
+#ifdef RT_USING_PWM
static void pwm_set_duty(timer_handle_t *timer_initstruct, timer_channel_t ch, uint32_t ns)
{
@@ -44,37 +49,40 @@ static void pwm_set_duty(timer_handle_t *timer_initstruct, timer_channel_t ch, u
static rt_err_t es32f3_pwm_control(struct rt_device_pwm *device, int cmd, void *arg)
{
rt_err_t ret = RT_EOK;
- uint32_t _ccep;
+ uint64_t _arr,bus_speed,tmp;
+ uint32_t _maxcnt,_ccep_ch_en = 0U;
timer_channel_t pwm_channel;
timer_oc_init_t tim_ocinit;
timer_handle_t *timer_initstruct = (timer_handle_t *)device->parent.user_data;
struct rt_pwm_configuration *cfg = (struct rt_pwm_configuration *)arg;
RT_ASSERT(timer_initstruct != RT_NULL);
-
- tim_ocinit.oc_mode = TIMER_OC_MODE_PWM1;
- tim_ocinit.oc_polarity = TIMER_OC_POLARITY_HIGH;
- tim_ocinit.oc_fast_en = DISABLE;
- tim_ocinit.ocn_polarity = TIMER_OCN_POLARITY_HIGH;
- tim_ocinit.ocn_idle = TIMER_OCN_IDLE_RESET;
- tim_ocinit.oc_idle = TIMER_OC_IDLE_RESET;
-
+
+
/* select pwm output channel */
if (1 == cfg->channel)
+ {
pwm_channel = TIMER_CHANNEL_1;
-
- else if (2 == cfg->channel)
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC1EN_MSK;
+ }
+ else if (2 == cfg->channel)
+ {
pwm_channel = TIMER_CHANNEL_2;
-
- else if (3 == cfg->channel)
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC2EN_MSK;
+ }
+ else if (3 == cfg->channel)
+ {
pwm_channel = TIMER_CHANNEL_3;
-
- else if (4 == cfg->channel)
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC3EN_MSK;
+ }
+ else if (4 == cfg->channel)
+ {
pwm_channel = TIMER_CHANNEL_4;
-
+ _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC4EN_MSK;
+ }
else
return RT_EINVAL;
-
+
switch (cmd)
{
case PWM_CMD_ENABLE:
@@ -86,19 +94,53 @@ static rt_err_t es32f3_pwm_control(struct rt_device_pwm *device, int cmd, void *
break;
case PWM_CMD_SET:
- _ccep = timer_initstruct->perh->CCEP;
- /* count registers max 0xFFFF, auto adjust prescaler */
+
+ /*当通道没开的时候:关通道,设置输出模式和极性,初始化通道*/
+ if(!_ccep_ch_en)
+ {
+ tim_ocinit.oc_mode = ES_PWM_OC_MODE;
+ tim_ocinit.oc_polarity = ES_PWM_OC_POLARITY;
+ tim_ocinit.oc_fast_en = DISABLE;
+ tim_ocinit.ocn_polarity = TIMER_OCN_POLARITY_HIGH;
+ tim_ocinit.ocn_idle = TIMER_OCN_IDLE_RESET;
+ tim_ocinit.oc_idle = TIMER_OC_IDLE_RESET;
+
+ ald_timer_oc_config_channel(timer_initstruct, &tim_ocinit, pwm_channel);
+ }
+
+ bus_speed = (uint64_t)ald_cmu_get_pclk1_clock();
+
+ /*判断外设的计数器最大值*/
+#ifdef ES32F36xx
+ if((timer_initstruct->perh == GP32C4T0)||(timer_initstruct->perh == GP32C4T1))
+ {
+ _maxcnt = 0xFFFFFFFF;
+ }
+ else _maxcnt = 0xFFFF;
+#else
+ _maxcnt = 0xFFFF;
+#endif
+
+ /*当最大分频 <= _maxcnt时:估计大概的分频,加快速度 */
+ tmp = bus_speed * (cfg->period)/1000000000/_maxcnt;
+ timer_initstruct->init.prescaler = (tmp > 2U) ? (tmp - 2U) : 0U ; /*bus_speed < 500000000*/
+
+ /* count registers max , auto adjust prescaler */
do
{
- pwm_set_freq(timer_initstruct, cfg->period);
- timer_initstruct->init.prescaler ++;
+ _arr = bus_speed * (cfg->period) / 1000000000 /(++timer_initstruct->init.prescaler);
+
}
- while (timer_initstruct->init.period > 0xFFFF);
+ while (_arr > _maxcnt);
+
+ WRITE_REG(timer_initstruct->perh->AR, (uint32_t)_arr);
+ timer_initstruct->init.period = (uint32_t)_arr;
+
/* update prescaler */
WRITE_REG(timer_initstruct->perh->PRES, --timer_initstruct->init.prescaler);
- ald_timer_oc_config_channel(timer_initstruct, &tim_ocinit, pwm_channel);
+
pwm_set_duty(timer_initstruct, pwm_channel, cfg->pulse);
- timer_initstruct->perh->CCEP = _ccep;
+
break;
case PWM_CMD_GET:
@@ -130,42 +172,210 @@ int rt_hw_pwm_init(void)
gpio_initstructure.flt = GPIO_FILTER_DISABLE;
gpio_initstructure.type = GPIO_TYPE_TTL;
-#ifdef BSP_USING_PWM0 /* 4 channels */
- static struct rt_device_pwm pwm_dev0;
- static timer_handle_t timer_initstruct0;
+#ifdef BSP_USING_AD16C4T0_PWM /* 4 channels */
+ static struct rt_device_pwm ad16c4t0_pwm_dev;
+ static timer_handle_t ad16c4t0_timer_initstruct;
+
+ ad16c4t0_timer_initstruct.perh = AD16C4T0;
+ ald_timer_pwm_init(&ad16c4t0_timer_initstruct);
+
+ /* gpio initialization */
+
+#if defined(ES_AD16C4T0_CH1_GPIO_FUNC)&&defined(ES_AD16C4T0_CH1_GPIO_PORT)&&defined(ES_AD16C4T0_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T0_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH1_GPIO_PORT, ES_AD16C4T0_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T0_CH2_GPIO_FUNC)&&defined(ES_AD16C4T0_CH2_GPIO_PORT)&&defined(ES_AD16C4T0_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T0_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH2_GPIO_PORT, ES_AD16C4T0_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T0_CH3_GPIO_FUNC)&&defined(ES_AD16C4T0_CH3_GPIO_PORT)&&defined(ES_AD16C4T0_CH3_GPIO_FUNC)
+ gpio_initstructure.func = ES_AD16C4T0_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH3_GPIO_PORT, ES_AD16C4T0_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T0_CH4_GPIO_FUNC)&&defined(ES_AD16C4T0_CH4_GPIO_PORT)&&defined(ES_AD16C4T0_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T0_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T0_CH4_GPIO_PORT, ES_AD16C4T0_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ret = rt_device_pwm_register(&ad16c4t0_pwm_dev, ES_DEVICE_NAME_AD16C4T0_PWM, &es32f3_pwm_ops,
+ &ad16c4t0_timer_initstruct);
+#endif
+
+#ifdef BSP_USING_AD16C4T1_PWM /* 4 channels */
+ static struct rt_device_pwm ad16c4t1_pwm_dev;
+ static timer_handle_t ad16c4t1_timer_initstruct;
+
+ ad16c4t1_timer_initstruct.perh = AD16C4T1;
+ ald_timer_pwm_init(&ad16c4t1_timer_initstruct);
- timer_initstruct0.perh = GP16C4T0;
- ald_timer_pwm_init(&timer_initstruct0);
+ /* gpio initialization */
+
+#if defined(ES_AD16C4T1_CH1_GPIO_FUNC)&&defined(ES_AD16C4T1_CH1_GPIO_PORT)&&defined(ES_AD16C4T1_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T1_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T1_CH1_GPIO_PORT, ES_AD16C4T1_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T1_CH2_GPIO_FUNC)&&defined(ES_AD16C4T1_CH2_GPIO_PORT)&&defined(ES_AD16C4T1_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T1_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T1_CH2_GPIO_PORT, ES_AD16C4T1_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T1_CH3_GPIO_FUNC)&&defined(ES_AD16C4T1_CH3_GPIO_PORT)&&defined(ES_AD16C4T1_CH3_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T1_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T1_CH3_GPIO_PORT, ES_AD16C4T1_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_AD16C4T1_CH4_GPIO_FUNC)&&defined(ES_AD16C4T1_CH4_GPIO_PORT)&&defined(ES_AD16C4T1_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_AD16C4T1_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_AD16C4T1_CH4_GPIO_PORT, ES_AD16C4T1_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ret = rt_device_pwm_register(&ad16c4t1_pwm_dev, ES_DEVICE_NAME_AD16C4T1_PWM, &es32f3_pwm_ops,
+ &ad16c4t1_timer_initstruct);
+#endif
+
+
+#ifdef BSP_USING_GP32C4T0_PWM /* 4 channels */
+ static struct rt_device_pwm gp32c4t0_pwm_dev;
+ static timer_handle_t gp32c4t0_timer_initstruct;
+
+ gp32c4t0_timer_initstruct.perh = GP32C4T0;
+ ald_timer_pwm_init(&gp32c4t0_timer_initstruct);
/* gpio initialization */
- gpio_initstructure.func = GPIO_FUNC_2;
- ald_gpio_init(GPIOB, GPIO_PIN_6, &gpio_initstructure);
- ald_gpio_init(GPIOB, GPIO_PIN_7, &gpio_initstructure);
- ald_gpio_init(GPIOB, GPIO_PIN_8, &gpio_initstructure);
- ald_gpio_init(GPIOB, GPIO_PIN_9, &gpio_initstructure);
+
+#if defined(ES_GP32C4T0_CH1_GPIO_FUNC)&&defined(ES_GP32C4T0_CH1_GPIO_PORT)&&defined(ES_GP32C4T0_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T0_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T0_CH1_GPIO_PORT, ES_GP32C4T0_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP32C4T0_CH2_GPIO_FUNC)&&defined(ES_GP32C4T0_CH2_GPIO_PORT)&&defined(ES_GP32C4T0_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T0_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T0_CH2_GPIO_PORT, ES_GP32C4T0_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP32C4T0_CH3_GPIO_FUNC)&&defined(ES_GP32C4T0_CH3_GPIO_PORT)&&defined(ES_GP32C4T0_CH3_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T0_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T0_CH3_GPIO_PORT, ES_GP32C4T0_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
- ret = rt_device_pwm_register(&pwm_dev0, "pwm0", &es32f3_pwm_ops,
- &timer_initstruct0);
+#if defined(ES_GP32C4T0_CH4_GPIO_FUNC)&&defined(ES_GP32C4T0_CH4_GPIO_PORT)&&defined(ES_GP32C4T0_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T0_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T0_CH4_GPIO_PORT, ES_GP32C4T0_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ret = rt_device_pwm_register(&gp32c4t0_pwm_dev, ES_DEVICE_NAME_AD16C4T1_PWM, &es32f3_pwm_ops,
+ &gp32c4t0_timer_initstruct);
#endif
-#ifdef BSP_USING_PWM1 /* 4 channels */
- static struct rt_device_pwm pwm_dev1;
- static timer_handle_t timer_initstruct1;
- timer_initstruct1.perh = GP16C4T1;
- ald_timer_pwm_init(&timer_initstruct1);
+#ifdef BSP_USING_GP32C4T1_PWM /* 4 channels */
+ static struct rt_device_pwm gp32c4t1_pwm_dev;
+ static timer_handle_t gp32c4t1_timer_initstruct;
+
+ gp32c4t1_timer_initstruct.perh = GP32C4T1;
+ ald_timer_pwm_init(&gp32c4t1_timer_initstruct);
/* gpio initialization */
- gpio_initstructure.func = GPIO_FUNC_5;
- ald_gpio_init(GPIOA, GPIO_PIN_0, &gpio_initstructure);
- ald_gpio_init(GPIOA, GPIO_PIN_1, &gpio_initstructure);
- ald_gpio_init(GPIOA, GPIO_PIN_2, &gpio_initstructure);
- ald_gpio_init(GPIOA, GPIO_PIN_3, &gpio_initstructure);
+
+#if defined(ES_GP32C4T1_CH1_GPIO_FUNC)&&defined(ES_GP32C4T1_CH1_GPIO_PORT)&&defined(ES_GP32C4T1_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T1_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T1_CH1_GPIO_PORT, ES_GP32C4T1_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP32C4T1_CH2_GPIO_FUNC)&&defined(ES_GP32C4T1_CH2_GPIO_PORT)&&defined(ES_GP32C4T1_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T1_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T1_CH2_GPIO_PORT, ES_GP32C4T1_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP32C4T1_CH3_GPIO_FUNC)&&defined(ES_GP32C4T1_CH3_GPIO_PORT)&&defined(ES_GP32C4T1_CH3_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T1_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T1_CH3_GPIO_PORT, ES_GP32C4T1_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP32C4T1_CH4_GPIO_FUNC)&&defined(ES_GP32C4T1_CH4_GPIO_PORT)&&defined(ES_GP32C4T1_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_GP32C4T1_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_GP32C4T1_CH4_GPIO_PORT, ES_GP32C4T1_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
- ret = rt_device_pwm_register(&pwm_dev1, "pwm1", &es32f3_pwm_ops,
- &timer_initstruct1);
+ ret = rt_device_pwm_register(&gp32c4t1_pwm_dev, ES_DEVICE_NAME_GP32C4T1_PWM, &es32f3_pwm_ops,
+ &gp32c4t1_timer_initstruct);
+#endif
+
+
+#ifdef BSP_USING_GP16C4T0_PWM /* 4 channels */
+ static struct rt_device_pwm gp16c4t0_pwm_dev;
+ static timer_handle_t gp16c4t0_timer_initstruct;
+
+ gp16c4t0_timer_initstruct.perh = GP16C4T0;
+ ald_timer_pwm_init(&gp16c4t0_timer_initstruct);
+
+ /* gpio initialization */
+
+#if defined(ES_GP16C4T0_CH1_GPIO_FUNC)&&defined(ES_GP16C4T0_CH1_GPIO_PORT)&&defined(ES_GP16C4T0_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH1_GPIO_PORT, ES_GP16C4T0_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T0_CH2_GPIO_FUNC)&&defined(ES_GP16C4T0_CH2_GPIO_PORT)&&defined(ES_GP16C4T0_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH2_GPIO_PORT, ES_GP16C4T0_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T0_CH3_GPIO_FUNC)&&defined(ES_GP16C4T0_CH3_GPIO_PORT)&&defined(ES_GP16C4T0_CH3_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH3_GPIO_PORT, ES_GP16C4T0_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T0_CH4_GPIO_FUNC)&&defined(ES_GP16C4T0_CH4_GPIO_PORT)&&defined(ES_GP16C4T0_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T0_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T0_CH4_GPIO_PORT, ES_GP16C4T0_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ret = rt_device_pwm_register(&gp16c4t0_pwm_dev, ES_DEVICE_NAME_GP16C4T0_PWM, &es32f3_pwm_ops,
+ &gp16c4t0_timer_initstruct);
+#endif
+
+
+#ifdef BSP_USING_GP16C4T1_PWM /* 4 channels */
+ static struct rt_device_pwm gp16c4t1_pwm_dev;
+ static timer_handle_t gp16c4t1_timer_initstruct;
+
+ gp16c4t1_timer_initstruct.perh = GP16C4T1;
+ ald_timer_pwm_init(&gp16c4t1_timer_initstruct);
+
+ /* gpio initialization */
+
+#if defined(ES_GP16C4T1_CH1_GPIO_FUNC)&&defined(ES_GP16C4T1_CH1_GPIO_PORT)&&defined(ES_GP16C4T1_CH1_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T1_CH1_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T1_CH1_GPIO_PORT, ES_GP16C4T1_CH1_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T1_CH2_GPIO_FUNC)&&defined(ES_GP16C4T1_CH2_GPIO_PORT)&&defined(ES_GP16C4T1_CH2_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T1_CH2_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T1_CH2_GPIO_PORT, ES_GP16C4T1_CH2_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T1_CH3_GPIO_FUNC)&&defined(ES_GP16C4T1_CH3_GPIO_PORT)&&defined(ES_GP16C4T1_CH3_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T1_CH3_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T1_CH3_GPIO_PORT, ES_GP16C4T1_CH3_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_GP16C4T1_CH4_GPIO_FUNC)&&defined(ES_GP16C4T1_CH4_GPIO_PORT)&&defined(ES_GP16C4T1_CH4_GPIO_PIN)
+ gpio_initstructure.func = ES_GP16C4T1_CH4_GPIO_FUNC;
+ ald_gpio_init(ES_GP16C4T1_CH4_GPIO_PORT, ES_GP16C4T1_CH4_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ret = rt_device_pwm_register(&gp16c4t1_pwm_dev, ES_DEVICE_NAME_GP16C4T1_PWM, &es32f3_pwm_ops,
+ &gp16c4t1_timer_initstruct);
#endif
return ret;
}
INIT_DEVICE_EXPORT(rt_hw_pwm_init);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_rtc.c b/bsp/essemi/es32f369x/drivers/drv_rtc.c
index cab5b8b61b..13b0fc9a24 100644
--- a/bsp/essemi/es32f369x/drivers/drv_rtc.c
+++ b/bsp/essemi/es32f369x/drivers/drv_rtc.c
@@ -3,21 +3,32 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2019-03-22 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * 2019-11-01 wangyq update libraries
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
-#include <rtdevice.h>
+#include <rtdevice.h>
#include <sys/time.h>
#include <string.h>
#include "board.h"
-#include "drv_rtc.h"
-#include <ald_cmu.h>
-#include <ald_rtc.h>
+#include "drv_rtc.h"
#ifdef RT_USING_RTC
@@ -117,20 +128,28 @@ int rt_hw_rtc_init(void)
rt_err_t ret = RT_EOK;
static struct rt_device rtc_dev;
rtc_init_t rtc_initstruct;
+
+ /* enable clk */
+ ald_rtc_source_select(ES_RTC_CLK_SOURCE);
- /* enable external 32.768kHz */
- CMU_LOSC_ENABLE();
- ald_cmu_losc_safe_config(ENABLE);
+ if(ES_RTC_CLK_SOURCE == ES_C_RTC_SOURCE_LOSC)
+ {
+ CMU_LOSC_ENABLE();
+ ald_cmu_losc_safe_config(ENABLE);
+ }
+
/* set default time */
RTC_UNLOCK();
WRITE_REG(RTC->TIME, 0x134251);
WRITE_REG(RTC->DATE, 0x1190401);
RTC_LOCK();
+
/* RTC function initialization */
rtc_initstruct.hour_format = RTC_HOUR_FORMAT_24;
rtc_initstruct.asynch_pre_div = 0;
rtc_initstruct.synch_pre_div = 32767;
- rtc_initstruct.output = RTC_OUTPUT_DISABLE;
+ rtc_initstruct.output = RTC_OUTPUT_DISABLE;
+ rtc_initstruct.output_polarity = RTC_OUTPUT_POLARITY_HIGH;
__rtc_init(&rtc_initstruct);
rtc_dev.type = RT_Device_Class_RTC;
@@ -150,7 +169,7 @@ int rt_hw_rtc_init(void)
rtc_dev.user_data = RTC;
- ret = rt_device_register(&rtc_dev, "rtc", RT_DEVICE_FLAG_RDWR);
+ ret = rt_device_register(&rtc_dev, ES_DEVICE_NAME_RTC, RT_DEVICE_FLAG_RDWR);
return ret;
}
diff --git a/bsp/essemi/es32f369x/drivers/drv_rtc.h b/bsp/essemi/es32f369x/drivers/drv_rtc.h
index fe0264fb51..76e5b24d85 100644
--- a/bsp/essemi/es32f369x/drivers/drv_rtc.h
+++ b/bsp/essemi/es32f369x/drivers/drv_rtc.h
@@ -3,14 +3,28 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2019-03-22 wangyq the first version
+ * 2019-03-22 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_RTC_H__
#define DRV_RTC_H__
+#include "es_conf_info_rtc.h"
int rt_hw_rtc_init(void);
#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_spi.c b/bsp/essemi/es32f369x/drivers/drv_spi.c
index 9bf7e4e4b5..aae178f78e 100644
--- a/bsp/essemi/es32f369x/drivers/drv_spi.c
+++ b/bsp/essemi/es32f369x/drivers/drv_spi.c
@@ -3,10 +3,23 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
- * Date Author Notes
- * 2020-01-14 wangyq the first version
- * 2019-11-01 wangyq update libraries
+ * Date Author Notes
+ * 2019-11-01 wangyq update libraries
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#include <rtthread.h>
@@ -15,9 +28,7 @@
#include <rthw.h>
#include "board.h"
#include "drv_spi.h"
-#include <ald_spi.h>
-#include <ald_gpio.h>
-#include <ald_cmu.h>
+
#ifdef RT_USING_SPI
@@ -31,6 +42,7 @@ rt_err_t spi_configure(struct rt_spi_device *device,
hspi->init.ss_en = DISABLE;
hspi->init.crc_calc = DISABLE;
+ hspi->init.frame = SPI_FRAME_MOTOROLA;
/* config spi mode */
if (cfg->mode & RT_SPI_SLAVE)
@@ -163,73 +175,54 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
hspi = (spi_handle_t *)device->bus->parent.user_data;
cs = device->parent.user_data;
+ if (message->cs_take)
+ {
+ rt_pin_write(cs->pin, ES_SPI_CS_LEVEL);
+ }
+
if(message->send_buf != RT_NULL || message->recv_buf != RT_NULL)
{
/* send & receive */
if ((message->send_buf != RT_NULL) && (message->recv_buf != RT_NULL))
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
res = ald_spi_send_recv(hspi, (rt_uint8_t *)message->send_buf, (rt_uint8_t *)message->recv_buf,
(rt_int32_t)message->length, SPITIMEOUT);
- if (message->cs_release)
- {
- rt_pin_write(cs->pin, 1);
- }
- if (res != RT_EOK)
- return RT_ERROR;
}
else
{
/* only send data */
if (message->recv_buf == RT_NULL)
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
res = ald_spi_send(hspi, (rt_uint8_t *)message->send_buf, (rt_int32_t)message->length, SPITIMEOUT);
- if (message->cs_release)
- {
- rt_pin_write(cs->pin, 1);
- }
- if (res != RT_EOK)
- return RT_ERROR;
}
/* only receive data */
if (message->send_buf == RT_NULL)
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
res = ald_spi_recv(hspi, (rt_uint8_t *)message->recv_buf, (rt_int32_t)message->length, SPITIMEOUT);
- if (message->cs_release)
- {
- rt_pin_write(cs->pin, 1);
- }
- if (res != RT_EOK)
- return RT_ERROR;
}
}
-
+
+ if (message->cs_release)
+ {
+ rt_pin_write(cs->pin, !ES_SPI_CS_LEVEL);
+ }
+
+ if (res != RT_EOK)
+ return RT_ERROR;
+ else
+ return message->length;
+
}
else
{
- if (message->cs_take)
- {
- rt_pin_write(cs->pin, 0);
- }
-
+
if (message->cs_release)
{
- rt_pin_write(cs->pin, 1);
+ rt_pin_write(cs->pin, !ES_SPI_CS_LEVEL);
}
return RT_EOK;
}
- return message->length;
+
}
const struct rt_spi_ops es32f3_spi_ops =
@@ -240,6 +233,7 @@ const struct rt_spi_ops es32f3_spi_ops =
rt_err_t es32f3_spi_device_attach(rt_uint32_t pin, const char *bus_name, const char *device_name)
{
+ int result;
/* define spi Instance */
struct rt_spi_device *spi_device = (struct rt_spi_device *)rt_malloc(sizeof(struct rt_spi_device));
RT_ASSERT(spi_device != RT_NULL);
@@ -248,7 +242,20 @@ rt_err_t es32f3_spi_device_attach(rt_uint32_t pin, const char *bus_name, const c
cs_pin->pin = pin;
rt_pin_mode(pin, PIN_MODE_OUTPUT);
rt_pin_write(pin, 1);
- return rt_spi_bus_attach_device(spi_device, device_name, bus_name, (void *)cs_pin);
+
+ result = rt_spi_bus_attach_device(spi_device, device_name, bus_name, (void *)cs_pin);
+
+#ifdef BSP_USING_SPI0
+ if(!(strcmp(bus_name,ES_DEVICE_NAME_SPI0_BUS)))SPI_BUS_CONFIG(spi_device->config,0);
+#endif
+#ifdef BSP_USING_SPI1
+ if(!(strcmp(bus_name,ES_DEVICE_NAME_SPI1_BUS)))SPI_BUS_CONFIG(spi_device->config,1);
+#endif
+#ifdef BSP_USING_SPI2
+ if(!(strcmp(bus_name,ES_DEVICE_NAME_SPI2_BUS)))SPI_BUS_CONFIG(spi_device->config,2);
+#endif
+
+ return result;
}
#ifdef BSP_USING_SPI0
@@ -273,40 +280,47 @@ int rt_hw_spi_init(void)
struct rt_spi_bus *spi_bus;
spi_handle_t *spi;
gpio_init_t gpio_instruct;
-
+
+ gpio_instruct.pupd = GPIO_PUSH_UP_DOWN;
+ gpio_instruct.odos = GPIO_PUSH_PULL;
+ gpio_instruct.podrv = GPIO_OUT_DRIVE_1;
+ gpio_instruct.nodrv = GPIO_OUT_DRIVE_1;
+ gpio_instruct.type = GPIO_TYPE_TTL;
+ gpio_instruct.flt = GPIO_FILTER_DISABLE;
+
#ifdef BSP_USING_SPI0
_spi0.perh = SPI0;
spi_bus = &_spi_bus0;
spi = &_spi0;
- rt_device_t spi_bus_dev0;
/* SPI0 gpio init */
gpio_instruct.mode = GPIO_MODE_OUTPUT;
- gpio_instruct.odos = GPIO_PUSH_PULL;
- gpio_instruct.podrv = GPIO_OUT_DRIVE_1;
- gpio_instruct.nodrv = GPIO_OUT_DRIVE_1;
- gpio_instruct.func = GPIO_FUNC_4;
- gpio_instruct.type = GPIO_TYPE_TTL;
- gpio_instruct.flt = GPIO_FILTER_DISABLE;
- /* PB3->SPI0_SCK, PB5->SPI0_MOSI */
- ald_gpio_init(GPIOB, GPIO_PIN_3 | GPIO_PIN_5, &gpio_instruct);
+#if defined(ES_SPI0_SCK_GPIO_FUNC)&&defined(ES_SPI0_SCK_GPIO_PORT)&&defined(ES_SPI0_SCK_GPIO_PIN)
+ gpio_instruct.func = ES_SPI0_SCK_GPIO_FUNC;
+ ald_gpio_init(ES_SPI0_SCK_GPIO_PORT, ES_SPI0_SCK_GPIO_PIN, &gpio_instruct);
+#endif
- /* PB4->SPI0_MISO */
+#if defined(ES_SPI0_MOSI_GPIO_FUNC)&&defined(ES_SPI0_MOSI_GPIO_PORT)&&defined(ES_SPI0_MOSI_GPIO_PIN)
+ gpio_instruct.func = ES_SPI0_MOSI_GPIO_FUNC;
+ ald_gpio_init(ES_SPI0_MOSI_GPIO_PORT, ES_SPI0_MOSI_GPIO_PIN, &gpio_instruct);
+#endif
+
gpio_instruct.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_4, &gpio_instruct);
+
+#if defined(ES_SPI0_MISO_GPIO_FUNC)&&defined(ES_SPI0_MISO_GPIO_PORT)&&defined(ES_SPI0_MISO_GPIO_PIN)
+ gpio_instruct.func = ES_SPI0_MISO_GPIO_FUNC;
+ ald_gpio_init(ES_SPI0_MISO_GPIO_PORT, ES_SPI0_MISO_GPIO_PIN, &gpio_instruct);
+#endif
spi_bus->parent.user_data = spi;
- result = rt_spi_bus_register(spi_bus, "spi0", &es32f3_spi_ops);
+ result = rt_spi_bus_register(spi_bus, ES_DEVICE_NAME_SPI0_BUS, &es32f3_spi_ops);
if (result != RT_EOK)
{
return result;
}
- rt_device_register(spi_bus_dev0, "spi00", RT_DEVICE_FLAG_RDWR);
-
- /* SPI0_NSS = PA15 = PIN 50 */
- result = es32f3_spi_device_attach(50, "spi0", "spi00");
+ result = es32f3_spi_device_attach(ES_SPI0_NSS_PIN, ES_DEVICE_NAME_SPI0_BUS, ES_DEVICE_NAME_SPI0_DEV0);
if (result != RT_EOK)
{
@@ -319,35 +333,35 @@ int rt_hw_spi_init(void)
_spi1.perh = SPI1;
spi_bus = &_spi_bus1;
spi = &_spi1;
- rt_device_t spi_bus_dev0;
/* SPI1 gpio init */
gpio_instruct.mode = GPIO_MODE_OUTPUT;
- gpio_instruct.odos = GPIO_PUSH_PULL;
- gpio_instruct.podrv = GPIO_OUT_DRIVE_1;
- gpio_instruct.nodrv = GPIO_OUT_DRIVE_1;
- gpio_instruct.func = GPIO_FUNC_4;
- gpio_instruct.type = GPIO_TYPE_TTL;
- gpio_instruct.flt = GPIO_FILTER_DISABLE;
-
- /* PC01->SPI1_SCK, PC03->SPI1_MOSI */
- ald_gpio_init(GPIOC, GPIO_PIN_1 | GPIO_PIN_3, &gpio_instruct);
-
- /* PC02->SPI1_MISO */
+
+#if defined(ES_SPI1_SCK_GPIO_FUNC)&&defined(ES_SPI1_SCK_GPIO_PORT)&&defined(ES_SPI1_SCK_GPIO_PIN)
+ gpio_instruct.func = ES_SPI1_SCK_GPIO_FUNC;
+ ald_gpio_init(ES_SPI1_SCK_GPIO_PORT, ES_SPI1_SCK_GPIO_PIN, &gpio_instruct);
+#endif
+
+#if defined(ES_SPI1_MOSI_GPIO_FUNC)&&defined(ES_SPI1_MOSI_GPIO_PORT)&&defined(ES_SPI1_MOSI_GPIO_PIN)
+ gpio_instruct.func = ES_SPI1_MOSI_GPIO_FUNC;
+ ald_gpio_init(ES_SPI1_MOSI_GPIO_PORT, ES_SPI1_MOSI_GPIO_PIN, &gpio_instruct);
+#endif
+
gpio_instruct.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOC, GPIO_PIN_2, &gpio_instruct);
+
+#if defined(ES_SPI1_MISO_GPIO_FUNC)&&defined(ES_SPI1_MISO_GPIO_PORT)&&defined(ES_SPI1_MISO_GPIO_PIN)
+ gpio_instruct.func = ES_SPI1_MISO_GPIO_FUNC;
+ ald_gpio_init(ES_SPI1_MISO_GPIO_PORT, ES_SPI1_MISO_GPIO_PIN, &gpio_instruct);
+#endif
spi_bus->parent.user_data = spi;
- result = rt_spi_bus_register(spi_bus, "spi1", &es32f3_spi_ops);
+ result = rt_spi_bus_register(spi_bus, ES_DEVICE_NAME_SPI1_BUS, &es32f3_spi_ops);
if (result != RT_EOK)
{
return result;
}
- rt_device_register(spi_bus_dev0, "spi10", RT_DEVICE_FLAG_RDWR);
-
- /* SPI1_NSS = PC00 = PIN 8 */
- result = es32f3_spi_device_attach(8, "spi1", "spi10");
+ result = es32f3_spi_device_attach(ES_SPI1_NSS_PIN, ES_DEVICE_NAME_SPI1_BUS, ES_DEVICE_NAME_SPI1_DEV0);
if (result != RT_EOK)
{
@@ -357,38 +371,38 @@ int rt_hw_spi_init(void)
#endif
#ifdef BSP_USING_SPI2
- _spi1.perh = SPI2;
+ _spi2.perh = SPI2;
spi_bus = &_spi_bus2;
spi = &_spi2;
- rt_device_t spi_bus_dev0;
/* SPI2 gpio init */
gpio_instruct.mode = GPIO_MODE_OUTPUT;
- gpio_instruct.odos = GPIO_PUSH_PULL;
- gpio_instruct.podrv = GPIO_OUT_DRIVE_1;
- gpio_instruct.nodrv = GPIO_OUT_DRIVE_1;
- gpio_instruct.func = GPIO_FUNC_5;
- gpio_instruct.type = GPIO_TYPE_TTL;
- gpio_instruct.flt = GPIO_FILTER_DISABLE;
-
- /* PC05->SPI1_SCK, PB01->SPI1_MOSI */
- ald_gpio_init(GPIOC, GPIO_PIN_5 | GPIO_PIN_1, &gpio_instruct);
-
- /* PB00->SPI1_MISO */
+
+#if defined(ES_SPI2_SCK_GPIO_FUNC)&&defined(ES_SPI2_SCK_GPIO_PORT)&&defined(ES_SPI2_SCK_GPIO_PIN)
+ gpio_instruct.func = ES_SPI2_SCK_GPIO_FUNC;
+ ald_gpio_init(ES_SPI2_SCK_GPIO_PORT, ES_SPI2_SCK_GPIO_PIN, &gpio_instruct);
+#endif
+
+#if defined(ES_SPI2_MOSI_GPIO_FUNC)&&defined(ES_SPI2_MOSI_GPIO_PORT)&&defined(ES_SPI2_MOSI_GPIO_PIN)
+ gpio_instruct.func = ES_SPI2_MOSI_GPIO_FUNC;
+ ald_gpio_init(ES_SPI2_MOSI_GPIO_PORT, ES_SPI2_MOSI_GPIO_PIN, &gpio_instruct);
+#endif
+
gpio_instruct.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_0, &gpio_instruct);
+
+#if defined(ES_SPI2_MISO_GPIO_FUNC)&&defined(ES_SPI2_MISO_GPIO_PORT)&&defined(ES_SPI2_MISO_GPIO_PIN)
+ gpio_instruct.func = ES_SPI2_MISO_GPIO_FUNC;
+ ald_gpio_init(ES_SPI2_MISO_GPIO_PORT, ES_SPI2_MISO_GPIO_PIN, &gpio_instruct);
+#endif
spi_bus->parent.user_data = spi;
- result = rt_spi_bus_register(spi_bus, "spi2", &es32f3_spi_ops);
+ result = rt_spi_bus_register(spi_bus, ES_DEVICE_NAME_SPI2_BUS, &es32f3_spi_ops);
if (result != RT_EOK)
{
return result;
}
- rt_device_register(spi_bus_dev0, "spi20", RT_DEVICE_FLAG_RDWR);
-
- /* SPI2_NSS = PC04 = PIN 24 */
- result = es32f3_spi_device_attach(39, "spi2", "spi20");
+ result = es32f3_spi_device_attach(ES_SPI2_NSS_PIN, ES_DEVICE_NAME_SPI2_BUS, ES_DEVICE_NAME_SPI1_DEV0);
if (result != RT_EOK)
{
diff --git a/bsp/essemi/es32f369x/drivers/drv_spi.h b/bsp/essemi/es32f369x/drivers/drv_spi.h
index 832d1a58b1..32eab04cc5 100644
--- a/bsp/essemi/es32f369x/drivers/drv_spi.h
+++ b/bsp/essemi/es32f369x/drivers/drv_spi.h
@@ -3,9 +3,22 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#ifndef DRV_SPI_H__
@@ -14,6 +27,8 @@
#include <rtthread.h>
#include <rthw.h>
#include <rtdevice.h>
+
+#include "es_conf_info_spi.h"
struct es32f3_hw_spi_cs
{
diff --git a/bsp/essemi/es32f369x/drivers/drv_spiflash.c b/bsp/essemi/es32f369x/drivers/drv_spiflash.c
new file mode 100644
index 0000000000..d8176257d1
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/drv_spiflash.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2019-02-15 wangyq the first version
+ * 2019-11-01 wangyq update libraries
+ */
+
+#include "board.h"
+#include <rtthread.h>
+
+#if defined(BSP_USING_SPI_FLASH)
+
+#include "spi_flash.h"
+#include "drv_spiflash.h"
+#include "spi_flash_sfud.h"
+#include "drv_spi.h"
+
+int rt_hw_spi_flash_init(void)
+{
+
+ if (RT_NULL == rt_sfud_flash_probe(ES_DEVICE_NAME_SPI_FALSH_DEV, ES_DEVICE_NAME_SPI_DEV))
+ {
+ return -RT_ERROR;
+ };
+
+ return RT_EOK;
+}
+INIT_COMPONENT_EXPORT(rt_hw_spi_flash_init);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_spiflash.h b/bsp/essemi/es32f369x/drivers/drv_spiflash.h
new file mode 100644
index 0000000000..6ef31852bb
--- /dev/null
+++ b/bsp/essemi/es32f369x/drivers/drv_spiflash.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2019-02-15 wangyq the first version
+ * 2021-04-20 liuhy the second version
+ */
+
+#ifndef DRV_NOR_FLASH_H__
+#define DRV_NOR_FLASH_H__
+
+#include "es_conf_info_spi.h"
+
+int rt_hw_spi_flash_init(void);
+
+#endif
diff --git a/bsp/essemi/es32f369x/drivers/drv_uart.c b/bsp/essemi/es32f369x/drivers/drv_uart.c
index b6a8b7a453..5ca5085c54 100644
--- a/bsp/essemi/es32f369x/drivers/drv_uart.c
+++ b/bsp/essemi/es32f369x/drivers/drv_uart.c
@@ -3,19 +3,29 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
- * 2020-01-14 wangyq the first version
+ * 2020-01-14 wangyq the first version
+ * 2021-04-20 liuhy the second version
*/
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include "board.h"
-#include "drv_uart.h"
-#include <ald_gpio.h>
-#include <ald_uart.h>
-#include <ald_cmu.h>
+#include "es_conf_info_uart.h"
#ifdef RT_USING_SERIAL
@@ -26,183 +36,6 @@ struct es32_uart
IRQn_Type irq;
};
-static rt_err_t es32f3x_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
-{
- gpio_init_t gpio_initstructure;
- struct es32_uart *uart;
- RT_ASSERT(serial != RT_NULL);
- RT_ASSERT(cfg != RT_NULL);
- uart = (struct es32_uart *)serial->parent.user_data;
-
- /* Initialize tx pin */
- gpio_initstructure.mode = GPIO_MODE_OUTPUT;
- gpio_initstructure.odos = GPIO_PUSH_PULL;
- gpio_initstructure.pupd = GPIO_PUSH_UP;
- gpio_initstructure.podrv = GPIO_OUT_DRIVE_1;
- gpio_initstructure.nodrv = GPIO_OUT_DRIVE_1;
- gpio_initstructure.flt = GPIO_FILTER_DISABLE;
- gpio_initstructure.type = GPIO_TYPE_TTL;
-
-#ifdef BSP_USING_UART0
- gpio_initstructure.func = GPIO_FUNC_3;
- ald_gpio_init(GPIOB, GPIO_PIN_10, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_11, &gpio_initstructure);
-
- ald_cmu_perh_clock_config(CMU_PERH_UART0, ENABLE);
-#endif /* uart0 gpio init */
-
-#ifdef BSP_USING_UART1
- gpio_initstructure.func = GPIO_FUNC_3;
- ald_gpio_init(GPIOC, GPIO_PIN_10, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOC, GPIO_PIN_11, &gpio_initstructure);
-
- ald_cmu_perh_clock_config(CMU_PERH_UART1, ENABLE);
-#endif /* uart1 gpio init */
-
-#ifdef BSP_USING_UART2
- gpio_initstructure.func = GPIO_FUNC_5;
- ald_gpio_init(GPIOC, GPIO_PIN_12, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOD, GPIO_PIN_2, &gpio_initstructure);
-
- ald_cmu_perh_clock_config(CMU_PERH_UART2, ENABLE);
-#endif /* uart2 gpio init */
-
-#ifdef BSP_USING_UART3
- gpio_initstructure.func = GPIO_FUNC_4;
- ald_gpio_init(GPIOC, GPIO_PIN_4, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOC, GPIO_PIN_5, &gpio_initstructure);
-
- ald_cmu_perh_clock_config(CMU_PERH_UART3, ENABLE);
-#endif /* uart3 gpio init */
-
-#ifdef BSP_USING_UART4
- gpio_initstructure.func = GPIO_FUNC_3;
- ald_gpio_init(GPIOB, GPIO_PIN_6, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_7, &gpio_initstructure);
-
- ald_cmu_perh_clock_config(CMU_PERH_UART4, ENABLE);
-#endif /* uart4 gpio init */
-
-#ifdef BSP_USING_UART5
- gpio_initstructure.func = GPIO_FUNC_4;
- ald_gpio_init(GPIOB, GPIO_PIN_9, &gpio_initstructure);
-
- /* Initialize rx pin ,the same as txpin except mode */
- gpio_initstructure.mode = GPIO_MODE_INPUT;
- ald_gpio_init(GPIOB, GPIO_PIN_8, &gpio_initstructure);
-
- ald_cmu_perh_clock_config(CMU_PERH_UART5, ENABLE);
-#endif /* uart5 gpio init */
-
- ald_uart_tx_fifo_config(&uart->huart, UART_TXFIFO_EMPTY);
- ald_uart_rx_fifo_config(&uart->huart, UART_RXFIFO_1BYTE);
-
- uart->huart.init.mode = UART_MODE_UART;
- uart->huart.init.baud = cfg->baud_rate;
- uart->huart.init.word_length = (uart_word_length_t)(8 - cfg->data_bits);
- uart->huart.init.parity = (uart_parity_t)(cfg->parity == PARITY_EVEN ? UART_PARITY_EVEN : cfg->parity);
- uart->huart.init.fctl = UART_HW_FLOW_CTL_DISABLE;
- ald_uart_init(&uart->huart);
-
- if (cfg->bit_order == BIT_ORDER_MSB)
- {
- UART_MSB_FIRST_ENABLE(&uart->huart);
- }
- else
- {
- UART_MSB_FIRST_DISABLE(&uart->huart);
- }
-
- if (cfg->invert == NRZ_INVERTED)
- {
- UART_DATA_INV_ENABLE(&uart->huart);
- }
- else
- {
- UART_DATA_INV_DISABLE(&uart->huart);
- }
-
- return RT_EOK;
-}
-
-static rt_err_t es32f3x_control(struct rt_serial_device *serial, int cmd, void *arg)
-{
- struct es32_uart *uart;
- RT_ASSERT(serial != RT_NULL);
-
- uart = (struct es32_uart *)serial->parent.user_data;
- switch (cmd)
- {
- case RT_DEVICE_CTRL_CLR_INT:
- /* disable rx irq */
- NVIC_DisableIRQ(uart->irq);
- /* disable interrupt */
- ald_uart_interrupt_config(&uart->huart, UART_IT_RFTH, DISABLE);
- break;
-
- case RT_DEVICE_CTRL_SET_INT:
- /* enable rx irq */
- NVIC_EnableIRQ(uart->irq);
- /* enable interrupt */
- ald_uart_interrupt_config(&uart->huart, UART_IT_RFTH, ENABLE);
- break;
- }
-
- return RT_EOK;
-}
-
-static int es32f3x_putc(struct rt_serial_device *serial, char c)
-{
- struct es32_uart *uart;
- RT_ASSERT(serial != RT_NULL);
- uart = (struct es32_uart *)serial->parent.user_data;
-
- while (ald_uart_get_status(&uart->huart, UART_STATUS_TFEMPTY) == RESET)
- ;
- WRITE_REG(uart->huart.perh->TXBUF, c);
-
- return 1;
-}
-
-static int es32f3x_getc(struct rt_serial_device *serial)
-{
- int ch = -1;
- struct es32_uart *uart;
-
- RT_ASSERT(serial != RT_NULL);
- uart = (struct es32_uart *)serial->parent.user_data;
-
- if (ald_uart_get_status(&uart->huart, UART_STATUS_RFTH))
- {
- ch = (uint8_t)(uart->huart.perh->RXBUF & 0xFF);
- }
-
- return ch;
-}
-
-static const struct rt_uart_ops es32f3x_uart_ops =
-{
- es32f3x_configure,
- es32f3x_control,
- es32f3x_putc,
- es32f3x_getc,
-};
-
#ifdef BSP_USING_UART0
/* UART0 device driver structure */
struct es32_uart uart0 =
@@ -353,18 +186,243 @@ void UART5_Handler(void)
}
#endif /* BSP_USING_UART5 */
+static rt_err_t es32f3x_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
+{
+ gpio_init_t gpio_initstructure;
+ struct es32_uart *uart;
+ RT_ASSERT(serial != RT_NULL);
+ RT_ASSERT(cfg != RT_NULL);
+ uart = (struct es32_uart *)serial->parent.user_data;
+
+ /* Initialize tx pin */
+ gpio_initstructure.mode = GPIO_MODE_OUTPUT;
+ gpio_initstructure.odos = GPIO_PUSH_PULL;
+ gpio_initstructure.pupd = GPIO_PUSH_UP;
+ gpio_initstructure.podrv = GPIO_OUT_DRIVE_1;
+ gpio_initstructure.nodrv = GPIO_OUT_DRIVE_1;
+ gpio_initstructure.flt = GPIO_FILTER_DISABLE;
+ gpio_initstructure.type = GPIO_TYPE_TTL;
+
+#ifdef BSP_USING_UART0
+ if(uart == (&uart0))
+ {
+#if defined(ES_UART0_TX_GPIO_FUNC)&&defined(ES_UART0_TX_GPIO_PORT)&&defined(ES_UART0_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART0_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART0_TX_GPIO_PORT, ES_UART0_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART0_RX_GPIO_FUNC)&&defined(ES_UART0_RX_GPIO_PORT)&&defined(ES_UART0_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART0_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART0_RX_GPIO_PORT, ES_UART0_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+ ald_cmu_perh_clock_config(CMU_PERH_UART0, ENABLE);
+ }
+
+#endif /* uart0 gpio init */
+
+#ifdef BSP_USING_UART1
+ if(uart == (&uart1))
+ {
+#if defined(ES_UART1_TX_GPIO_FUNC)&&defined(ES_UART1_TX_GPIO_PORT)&&defined(ES_UART1_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART1_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART1_TX_GPIO_PORT, ES_UART1_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART1_RX_GPIO_FUNC)&&defined(ES_UART1_RX_GPIO_PORT)&&defined(ES_UART1_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART1_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART1_RX_GPIO_PORT, ES_UART1_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART1, ENABLE);
+ }
+#endif /* uart1 gpio init */
+
+#ifdef BSP_USING_UART2
+ if(uart == (&uart2))
+ {
+#if defined(ES_UART2_TX_GPIO_FUNC)&&defined(ES_UART2_TX_GPIO_PORT)&&defined(ES_UART2_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART2_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART2_TX_GPIO_PORT, ES_UART2_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART2_RX_GPIO_FUNC)&&defined(ES_UART2_RX_GPIO_PORT)&&defined(ES_UART2_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART2_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART2_RX_GPIO_PORT, ES_UART2_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART2, ENABLE);
+ }
+#endif /* uart2 gpio init */
+
+#ifdef BSP_USING_UART3
+ if(uart == (&uart3))
+ {
+#if defined(ES_UART3_TX_GPIO_FUNC)&&defined(ES_UART3_TX_GPIO_PORT)&&defined(ES_UART3_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART3_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART3_TX_GPIO_PORT, ES_UART3_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART3_RX_GPIO_FUNC)&&defined(ES_UART3_RX_GPIO_PORT)&&defined(ES_UART3_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART3_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART3_RX_GPIO_PORT, ES_UART3_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART3, ENABLE);
+ }
+#endif /* uart3 gpio init */
+
+#ifdef BSP_USING_UART4
+ if(uart == (&uart4))
+ {
+#if defined(ES_UART4_TX_GPIO_FUNC)&&defined(ES_UART4_TX_GPIO_PORT)&&defined(ES_UART4_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART4_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART4_TX_GPIO_PORT, ES_UART4_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART4_RX_GPIO_FUNC)&&defined(ES_UART4_RX_GPIO_PORT)&&defined(ES_UART4_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART4_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART4_RX_GPIO_PORT, ES_UART4_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART4, ENABLE);
+ }
+#endif /* uart4 gpio init */
+
+#ifdef BSP_USING_UART5
+ if(uart == (&uart5))
+ {
+#if defined(ES_UART5_TX_GPIO_FUNC)&&defined(ES_UART5_TX_GPIO_PORT)&&defined(ES_UART5_TX_GPIO_PIN)
+ gpio_initstructure.func = ES_UART5_TX_GPIO_FUNC;
+ ald_gpio_init(ES_UART5_TX_GPIO_PORT, ES_UART5_TX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+#if defined(ES_UART5_RX_GPIO_FUNC)&&defined(ES_UART5_RX_GPIO_PORT)&&defined(ES_UART5_RX_GPIO_PIN)
+ /* Initialize rx pin ,the same as txpin except mode */
+ gpio_initstructure.mode = GPIO_MODE_INPUT;
+ gpio_initstructure.func = ES_UART5_RX_GPIO_FUNC;
+ ald_gpio_init(ES_UART5_RX_GPIO_PORT, ES_UART5_RX_GPIO_PIN, &gpio_initstructure);
+#endif
+
+ ald_cmu_perh_clock_config(CMU_PERH_UART5, ENABLE);
+ }
+#endif /* uart5 gpio init */
+
+ ald_uart_tx_fifo_config(&uart->huart, UART_TXFIFO_EMPTY);
+ ald_uart_rx_fifo_config(&uart->huart, UART_RXFIFO_1BYTE);
+
+ uart->huart.init.mode = UART_MODE_UART;
+ uart->huart.init.baud = cfg->baud_rate;
+ uart->huart.init.word_length = (uart_word_length_t)(8 - cfg->data_bits);
+ uart->huart.init.parity = (uart_parity_t)(cfg->parity == PARITY_EVEN ? UART_PARITY_EVEN : cfg->parity);
+ uart->huart.init.fctl = UART_HW_FLOW_CTL_DISABLE;
+ uart->huart.init.stop_bits = UART_STOP_BITS_1;
+ ald_uart_init(&uart->huart);
+
+ if (cfg->bit_order == BIT_ORDER_MSB)
+ {
+ UART_MSB_FIRST_ENABLE(&uart->huart);
+ }
+ else
+ {
+ UART_MSB_FIRST_DISABLE(&uart->huart);
+ }
+
+ if (cfg->invert == NRZ_INVERTED)
+ {
+ UART_DATA_INV_ENABLE(&uart->huart);
+ }
+ else
+ {
+ UART_DATA_INV_DISABLE(&uart->huart);
+ }
+
+ return RT_EOK;
+}
+
+static rt_err_t es32f3x_control(struct rt_serial_device *serial, int cmd, void *arg)
+{
+ struct es32_uart *uart;
+ RT_ASSERT(serial != RT_NULL);
+
+ uart = (struct es32_uart *)serial->parent.user_data;
+ switch (cmd)
+ {
+ case RT_DEVICE_CTRL_CLR_INT:
+ /* disable rx irq */
+ NVIC_DisableIRQ(uart->irq);
+ /* disable interrupt */
+ ald_uart_interrupt_config(&uart->huart, UART_IT_RFTH, DISABLE);
+ break;
+
+ case RT_DEVICE_CTRL_SET_INT:
+ /* enable rx irq */
+ NVIC_EnableIRQ(uart->irq);
+ /* enable interrupt */
+ ald_uart_interrupt_config(&uart->huart, UART_IT_RFTH, ENABLE);
+ break;
+ }
+
+ return RT_EOK;
+}
+
+static int es32f3x_putc(struct rt_serial_device *serial, char c)
+{
+ struct es32_uart *uart;
+ RT_ASSERT(serial != RT_NULL);
+ uart = (struct es32_uart *)serial->parent.user_data;
+
+ while (ald_uart_get_status(&uart->huart, UART_STATUS_TFEMPTY) == RESET)
+ ;
+ WRITE_REG(uart->huart.perh->TXBUF, c);
+
+ return 1;
+}
+
+static int es32f3x_getc(struct rt_serial_device *serial)
+{
+ int ch = -1;
+ struct es32_uart *uart;
+
+ RT_ASSERT(serial != RT_NULL);
+ uart = (struct es32_uart *)serial->parent.user_data;
+
+ if (ald_uart_get_status(&uart->huart, UART_STATUS_RFTH))
+ {
+ ch = (uint8_t)(uart->huart.perh->RXBUF & 0xFF);
+ }
+
+ return ch;
+}
+
+static const struct rt_uart_ops es32f3x_uart_ops =
+{
+ es32f3x_configure,
+ es32f3x_control,
+ es32f3x_putc,
+ es32f3x_getc,
+};
+
int rt_hw_uart_init(void)
{
struct es32_uart *uart;
- struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
#ifdef BSP_USING_UART0
uart = &uart0;
serial0.ops = &es32f3x_uart_ops;
- serial0.config = config;
+ serial0.config = (struct serial_configure)ES_UART0_CONFIG;
/* register UART0 device */
- rt_hw_serial_register(&serial0, "uart0",
+ rt_hw_serial_register(&serial0, ES_DEVICE_NAME_UART0,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART0 */
@@ -372,10 +430,10 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART1
uart = &uart1;
serial1.ops = &es32f3x_uart_ops;
- serial1.config = config;
+ serial1.config = (struct serial_configure)ES_UART1_CONFIG;
/* register UART1 device */
- rt_hw_serial_register(&serial1, "uart1",
+ rt_hw_serial_register(&serial1, ES_DEVICE_NAME_UART1,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART1 */
@@ -383,10 +441,10 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART2
uart = &uart2;
serial2.ops = &es32f3x_uart_ops;
- serial2.config = config;
+ serial2.config = (struct serial_configure)ES_UART2_CONFIG;
/* register UART2 device */
- rt_hw_serial_register(&serial2, "uart2",
+ rt_hw_serial_register(&serial2, ES_DEVICE_NAME_UART2,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART2 */
@@ -394,10 +452,10 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART3
uart = &uart3;
serial3.ops = &es32f3x_uart_ops;
- serial3.config = config;
+ serial3.config = (struct serial_configure)ES_UART3_CONFIG;
/* register UART3 device */
- rt_hw_serial_register(&serial3, "uart3",
+ rt_hw_serial_register(&serial3, ES_DEVICE_NAME_UART3,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART3 */
@@ -405,10 +463,10 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART4
uart = &uart4;
serial4.ops = &es32f3x_uart_ops;
- serial4.config = config;
+ serial4.config = (struct serial_configure)ES_UART4_CONFIG;
/* register UART4 device */
- rt_hw_serial_register(&serial4, "uart4",
+ rt_hw_serial_register(&serial4, ES_DEVICE_NAME_UART4,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART4 */
@@ -416,10 +474,10 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART5
uart = &uart5;
serial5.ops = &es32f3x_uart_ops;
- serial5.config = config;
+ serial5.config = (struct serial_configure)ES_UART5_CONFIG;
/* register UART5 device */
- rt_hw_serial_register(&serial5, "uart5",
+ rt_hw_serial_register(&serial5, ES_DEVICE_NAME_UART5,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
uart);
#endif /* BSP_USING_UART5 */
diff --git a/bsp/essemi/es32f369x/drivers/drv_uart.h b/bsp/essemi/es32f369x/drivers/drv_uart.h
index fed3184080..6e9b7703e0 100644
--- a/bsp/essemi/es32f369x/drivers/drv_uart.h
+++ b/bsp/essemi/es32f369x/drivers/drv_uart.h
@@ -3,6 +3,18 @@
*
* SPDX-License-Identifier: Apache-2.0
*
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
* Change Logs:
* Date Author Notes
* 2020-01-14 wangyq the first version
diff --git a/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Include/es32f36xx.h b/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Include/es32f36xx.h
index 2e29a0d583..71e4e83261 100644
--- a/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Include/es32f36xx.h
+++ b/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Include/es32f36xx.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/gcc/startup_es32f36xx.S b/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/gcc/startup_es32f36xx.S
new file mode 100644
index 0000000000..4e34d42c1d
--- /dev/null
+++ b/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/gcc/startup_es32f36xx.S
@@ -0,0 +1,438 @@
+/**
+ ******************************************************************************
+ * @file startup_es32f36xx.s
+ * @author AE Team
+ * @brief ES32F36xx devices vector table for GCC toolchain.
+ * This module performs:
+ * - Set the initial SP
+ * - Set the initial PC == Reset_Handler,
+ * - Set the vector table entries with the exceptions ISR address
+ * - Branches to main in the C library (which eventually
+ * calls main()).
+ * After Reset the Cortex-M3 processor is in Thread mode,
+ * priority is Privileged, and the Stack is set to Main.
+ ******************************************************************************
+ */
+
+ .syntax unified
+ .arch armv7-m
+ .cpu cortex-m3
+ .fpu softvfp
+ .thumb
+
+.global g_pfnVectors
+.global Default_Handler
+
+/* start address for the initialization values of the .data section.
+defined in linker script */
+.word _sidata
+/* start address for the .data section. defined in linker script */
+.word _sdata
+/* end address for the .data section. defined in linker script */
+.word _edata
+/* start address for the .bss section. defined in linker script */
+.word _sbss
+/* end address for the .bss section. defined in linker script */
+.word _ebss
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+ ldr r0, =_estack
+ mov sp, r0 /* set stack pointer */
+
+/* Copy the data segment initializers from flash to SRAM */
+ ldr r0, =_sdata
+ ldr r1, =_edata
+ ldr r2, =_sidata
+ movs r3, #0
+ b LoopCopyDataInit
+
+CopyDataInit:
+ ldr r4, [r2, r3]
+ str r4, [r0, r3]
+ adds r3, r3, #4
+
+LoopCopyDataInit:
+ adds r4, r0, r3
+ cmp r4, r1
+ bcc CopyDataInit
+
+/* Zero fill the bss segment. */
+ ldr r2, =_sbss
+ ldr r4, =_ebss
+ movs r3, #0
+ b LoopFillZerobss
+
+FillZerobss:
+ str r3, [r2]
+ adds r2, r2, #4
+
+LoopFillZerobss:
+ cmp r2, r4
+ bcc FillZerobss
+
+/*bl __libc_init_array
+
+ bl main */
+ bl entry
+
+LoopForever:
+ b LoopForever
+
+
+.size Reset_Handler, .-Reset_Handler
+
+/**
+ * @brief This is the code that gets called when the processor receives an
+ * unexpected interrupt. This simply enters an infinite loop, preserving
+ * the system state for examination by a debugger.
+ *
+ * @param None
+ * @retval : None
+*/
+ .section .text.Default_Handler,"ax",%progbits
+Default_Handler:
+Infinite_Loop:
+ b Infinite_Loop
+ .size Default_Handler, .-Default_Handler
+/******************************************************************************
+*
+* The minimal vector table for a Cortex M0. Note that the proper constructs
+* must be placed on this to ensure that it ends up at physical address
+* 0x0000.0000.
+*
+******************************************************************************/
+ .section .isr_vector,"a",%progbits
+ .type g_pfnVectors, %object
+ .size g_pfnVectors, .-g_pfnVectors
+
+
+g_pfnVectors:
+ .word _estack /* 0, load top of stack */
+ .word Reset_Handler /* 1, reset handler */
+ .word NMI_Handler /* 2, nmi handler */
+ .word HardFault_Handler /* 3, hard fault handler */
+ .word MemManage_Handler /* 4, MPU Fault Handler */
+ .word BusFault_Handler /* 5, Bus Fault Handler */
+ .word UsageFault_Handler /* 6, Usage Fault Handler */
+ .word 0 /* 7, Reserved */
+ .word 0 /* 8, Reserved */
+ .word 0 /* 9, Reserved */
+ .word 0 /* 10, Reserved */
+ .word SVC_Handler /* 11, svcall handler */
+ .word DebugMon_Handler /* 12, Debug Monitor Handler */
+ .word 0 /* 13, Reserved */
+ .word PendSV_Handler /* 14, pendsv handler */
+ .word SysTick_Handler /* 15, systick handler */
+ .word WWDG_Handler /* 16, irq0 WWDG handler */
+ .word IWDG_Handler /* 17, irq1 IWDG handler */
+ .word LVD_Handler /* 18, irq2 LVD handler */
+ .word RTC_Handler /* 19, irq3 RTC handler */
+ .word 0 /* 20, irq4 Reserved */
+ .word 0 /* 21, irq5 Reserved */
+ .word CMU_Handler /* 22, irq6 CMU handler */
+ .word ADC0_Handler /* 23, irq7 ADC0 handler */
+ .word CAN0_TX_Handler /* 24, irq8 CAN0_TX handler */
+ .word CAN0_RX0_Handler /* 25, irq9 CAN0_RX0 handler */
+ .word CAN0_RX1_Handler /* 26, irq10 CAN0_RX1 handler */
+ .word CAN0_EXCEPTION_Handler /* 27, irq11 CAN0_EXCEPTION handler */
+ .word AD16C4T0_BRK_Handler /* 28, irq12 AD16C4T0_BRK handler */
+ .word AD16C4T0_UP_Handler /* 29, irq13 AD16C4T0_UP handler */
+ .word AD16C4T0_TRIG_COM_Handler /* 30, irq14 AD16C4T0_TRIG_COM handler */
+ .word AD16C4T0_CC_Handler /* 31, irq15 AD16C4T0_CC handler */
+ .word AD16C4T1_BRK_Handler /* 32, irq16 AD16C4T1_BRK handler */
+ .word AD16C4T1_UP_Handler /* 33, irq17 AD16C4T1_UP handler */
+ .word AD16C4T1_TRIG_COM_Handler /* 34, irq18 AD16C4T1_TRIG_COM handler */
+ .word AD16C4T1_CC_Handler /* 35, irq19 AD16C4T1_CC handler */
+ .word GP32C4T0_Handler /* 36, irq20 GP32C4T0 handler */
+ .word GP32C4T1_Handler /* 37, irq21 GP32C4T1 handler */
+ .word BS16T0_Handler /* 38, irq22 BS16T0 handler */
+ .word BS16T1_Handler /* 39, irq23 BS16T1 handler */
+ .word GP16C4T0_Handler /* 40, irq24 GP16C4T0 handler */
+ .word GP16C4T1_Handler /* 41, irq25 GP16C4T1 handler */
+ .word 0 /* 42, irq26 Reserved */
+ .word DAC0_CH0_Handler /* 43, irq27 DAC0_CH0 handler */
+ .word I2C0_EV_Handler /* 44, irq28 I2C0_EV handler */
+ .word I2C0_ERR_Handler /* 45, irq29 I2C0_ERR handler */
+ .word I2C1_EV_Handler /* 46 irq30 I2C1_EV handler */
+ .word I2C1_ERR_Handler /* 47, irq31 I2C1_ERR handler */
+ .word SPI0_I2S0_Handler /* 48, irq32 SPI0_I2S0 handler */
+ .word SPI1_I2S1_Handler /* 49, irq33 SPI1_I2S1 handler */
+ .word UART0_Handler /* 50, irq34 UART0 handler */
+ .word UART1_Handler /* 51, irq35 UART1 handler */
+ .word UART2_Handler /* 52, irq36 UART2 handler */
+ .word UART3_Handler /* 53, irq37 UART3 handler */
+ .word UART4_Handler /* 54, irq38 UART4 handler */
+ .word UART5_Handler /* 55, irq39 UART5 handler */
+ .word 0 /* 56, irq40 Reserved */
+ .word 0 /* 57, irq41 Reserved */
+ .word CRYPT_Handler /* 58, irq42 CRYPT handler */
+ .word ACMP0_Handler /* 59, irq43 ACMP0 handler */
+ .word ACMP1_Handler /* 60, irq44 ACMP1 handler */
+ .word SPI2_I2S2_Handler /* 61, irq45 SPI2_I2S2 handler */
+ .word 0 /* 62, irq46 Reserved */
+ .word EBI_Handler /* 63, irq47 EBI handler */
+ .word TRNG_Handler /* 64, irq48 TRNG handler */
+ .word TSENSE_Handler /* 65, irq49 TSENSE handler */
+ .word EXTI0_Handler /* 66, irq50 EXTI0 handler */
+ .word EXTI1_Handler /* 67, irq51 EXTI1 handler */
+ .word EXTI2_Handler /* 68, irq52 EXTI2 handler */
+ .word EXTI3_Handler /* 69, irq53 EXTI3 handler */
+ .word EXTI4_Handler /* 70, irq54 EXTI4 handler */
+ .word EXTI5_Handler /* 71, irq55 EXTI5 handler */
+ .word EXTI6_Handler /* 72, irq56 EXTI6 handler */
+ .word EXTI7_Handler /* 73, irq57 EXTI7 handler */
+ .word EXTI8_Handler /* 74, irq58 EXTI8 handler */
+ .word EXTI9_Handler /* 75, irq59 EXTI9 handler */
+ .word EXTI10_Handler /* 76, irq60 EXTI10 handler */
+ .word EXTI11_Handler /* 77, irq61 EXTI11 handler */
+ .word EXTI12_Handler /* 78, irq62 EXTI12 handler */
+ .word EXTI13_Handler /* 79, irq63 EXTI13 handler */
+ .word EXTI14_Handler /* 80, irq64 EXTI14 handler */
+ .word EXTI15_Handler /* 81, irq65 EXTI15 handler */
+ .word DMA_Handler /* 82, irq66 DMA handler */
+ .word ADC1_Handler /* 83, irq67 ADC1 handler */
+ .word DAC0_CH1_Handler /* 84, irq68 DAC0_CH1 handler */
+ .word QSPI_Handler /* 85, irq69 QSPI handler */
+ .word USB_INT_Handler /* 86, irq70 USB_INT handler */
+ .word USB_DMA_Handler /* 87, irq71 USB_DMA handler */
+ .word ACMP2_Handler /* 88, irq72 ACMP2 handler */
+
+/*******************************************************************************
+*
+* Provide weak aliases for each Exception handler to the Default_Handler.
+* As they are weak aliases, any function with the same name will override
+* this definition.
+*
+*******************************************************************************/
+
+ .weak NMI_Handler
+ .thumb_set NMI_Handler,Default_Handler
+
+ .weak HardFault_Handler
+ .thumb_set HardFault_Handler,Default_Handler
+
+ .weak MemManage_Handler
+ .thumb_set MemManage_Handler,Default_Handler
+
+ .weak BusFault_Handler
+ .thumb_set BusFault_Handler,Default_Handler
+
+ .weak UsageFault_Handler
+ .thumb_set UsageFault_Handler,Default_Handler
+
+ .weak SVC_Handler
+ .thumb_set SVC_Handler,Default_Handler
+
+ .weak DebugMon_Handler
+ .thumb_set DebugMon_Handler,Default_Handler
+
+ .weak PendSV_Handler
+ .thumb_set PendSV_Handler,Default_Handler
+
+ .weak SysTick_Handler
+ .thumb_set SysTick_Handler,Default_Handler
+
+ .weak WWDG_Handler
+ .thumb_set WWDG_Handler,Default_Handler
+
+ .weak IWDG_Handler
+ .thumb_set IWDG_Handler,Default_Handler
+
+ .weak LVD_Handler
+ .thumb_set LVD_Handler,Default_Handler
+
+ .weak RTC_Handler
+ .thumb_set RTC_Handler,Default_Handler
+
+ .weak CMU_Handler
+ .thumb_set CMU_Handler,Default_Handler
+
+ .weak ADC0_Handler
+ .thumb_set ADC0_Handler,Default_Handler
+
+ .weak CAN0_TX_Handler
+ .thumb_set CAN0_TX_Handler,Default_Handler
+
+ .weak CAN0_RX0_Handler
+ .thumb_set CAN0_RX0_Handler,Default_Handler
+
+ .weak CAN0_RX1_Handler
+ .thumb_set CAN0_RX1_Handler,Default_Handler
+
+ .weak CAN0_EXCEPTION_Handler
+ .thumb_set CAN0_EXCEPTION_Handler,Default_Handler
+
+ .weak AD16C4T0_BRK_Handler
+ .thumb_set AD16C4T0_BRK_Handler,Default_Handler
+
+ .weak AD16C4T0_UP_Handler
+ .thumb_set AD16C4T0_UP_Handler,Default_Handler
+
+ .weak AD16C4T0_TRIG_COM_Handler
+ .thumb_set AD16C4T0_TRIG_COM_Handler,Default_Handler
+
+ .weak AD16C4T0_CC_Handler
+ .thumb_set AD16C4T0_CC_Handler,Default_Handler
+
+ .weak AD16C4T1_BRK_Handler
+ .thumb_set AD16C4T1_BRK_Handler,Default_Handler
+
+ .weak AD16C4T1_UP_Handler
+ .thumb_set AD16C4T1_UP_Handler,Default_Handler
+
+ .weak AD16C4T1_TRIG_COM_Handler
+ .thumb_set AD16C4T1_TRIG_COM_Handler,Default_Handler
+
+ .weak AD16C4T1_CC_Handler
+ .thumb_set AD16C4T1_CC_Handler,Default_Handler
+
+ .weak GP32C4T0_Handler
+ .thumb_set GP32C4T0_Handler,Default_Handler
+
+ .weak GP32C4T1_Handler
+ .thumb_set GP32C4T1_Handler,Default_Handler
+
+ .weak BS16T0_Handler
+ .thumb_set BS16T0_Handler,Default_Handler
+
+ .weak BS16T1_Handler
+ .thumb_set BS16T1_Handler,Default_Handler
+
+ .weak GP16C4T0_Handler
+ .thumb_set GP16C4T0_Handler,Default_Handler
+
+ .weak GP16C4T1_Handler
+ .thumb_set GP16C4T1_Handler,Default_Handler
+
+ .weak DAC0_CH0_Handler
+ .thumb_set DAC0_CH0_Handler,Default_Handler
+
+ .weak I2C0_EV_Handler
+ .thumb_set I2C0_EV_Handler,Default_Handler
+
+ .weak I2C0_ERR_Handler
+ .thumb_set I2C0_ERR_Handler,Default_Handler
+
+ .weak I2C1_EV_Handler
+ .thumb_set I2C1_EV_Handler,Default_Handler
+
+ .weak I2C1_ERR_Handler
+ .thumb_set I2C1_ERR_Handler,Default_Handler
+
+ .weak SPI0_I2S0_Handler
+ .thumb_set SPI0_I2S0_Handler,Default_Handler
+
+ .weak SPI1_I2S1_Handler
+ .thumb_set SPI1_I2S1_Handler,Default_Handler
+
+ .weak UART0_Handler
+ .thumb_set UART0_Handler,Default_Handler
+
+ .weak UART1_Handler
+ .thumb_set UART1_Handler,Default_Handler
+
+ .weak UART2_Handler
+ .thumb_set UART2_Handler,Default_Handler
+
+ .weak UART3_Handler
+ .thumb_set UART3_Handler,Default_Handler
+
+ .weak UART4_Handler
+ .thumb_set UART4_Handler,Default_Handler
+
+ .weak UART5_Handler
+ .thumb_set UART5_Handler,Default_Handler
+
+ .weak CRYPT_Handler
+ .thumb_set CRYPT_Handler,Default_Handler
+
+ .weak ACMP0_Handler
+ .thumb_set ACMP0_Handler,Default_Handler
+
+ .weak ACMP1_Handler
+ .thumb_set ACMP1_Handler,Default_Handler
+
+ .weak SPI2_I2S2_Handler
+ .thumb_set SPI2_I2S2_Handler,Default_Handler
+
+ .weak EBI_Handler
+ .thumb_set EBI_Handler,Default_Handler
+
+ .weak TRNG_Handler
+ .thumb_set TRNG_Handler,Default_Handler
+
+ .weak TSENSE_Handler
+ .thumb_set TSENSE_Handler,Default_Handler
+
+ .weak EXTI0_Handler
+ .thumb_set EXTI0_Handler,Default_Handler
+
+ .weak EXTI1_Handler
+ .thumb_set EXTI1_Handler,Default_Handler
+
+ .weak EXTI2_Handler
+ .thumb_set EXTI2_Handler,Default_Handler
+
+ .weak EXTI3_Handler
+ .thumb_set EXTI3_Handler,Default_Handler
+
+ .weak EXTI4_Handler
+ .thumb_set EXTI4_Handler,Default_Handler
+
+ .weak EXTI5_Handler
+ .thumb_set EXTI5_Handler,Default_Handler
+
+ .weak EXTI6_Handler
+ .thumb_set EXTI6_Handler,Default_Handler
+
+ .weak EXTI7_Handler
+ .thumb_set EXTI7_Handler,Default_Handler
+
+ .weak EXTI8_Handler
+ .thumb_set EXTI8_Handler,Default_Handler
+
+ .weak EXTI9_Handler
+ .thumb_set EXTI9_Handler,Default_Handler
+
+ .weak EXTI10_Handler
+ .thumb_set EXTI10_Handler,Default_Handler
+
+ .weak EXTI11_Handler
+ .thumb_set EXTI11_Handler,Default_Handler
+
+ .weak EXTI12_Handler
+ .thumb_set EXTI12_Handler,Default_Handler
+
+ .weak EXTI13_Handler
+ .thumb_set EXTI13_Handler,Default_Handler
+
+ .weak EXTI14_Handler
+ .thumb_set EXTI14_Handler,Default_Handler
+
+ .weak EXTI15_Handler
+ .thumb_set EXTI15_Handler,Default_Handler
+
+ .weak DMA_Handler
+ .thumb_set DMA_Handler,Default_Handler
+
+ .weak ADC1_Handler
+ .thumb_set ADC1_Handler,Default_Handler
+
+ .weak DAC0_CH1_Handler
+ .thumb_set DAC0_CH1_Handler,Default_Handler
+
+ .weak QSPI_Handler
+ .thumb_set QSPI_Handler,Default_Handler
+
+ .weak USB_INT_Handler
+ .thumb_set USB_INT_Handler,Default_Handler
+
+ .weak USB_DMA_Handler
+ .thumb_set USB_DMA_Handler,Default_Handler
+
+ .weak ACMP2_Handler
+ .thumb_set ACMP2_Handler,Default_Handler
+
diff --git a/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/keil/startup_es32f36xx.s b/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/keil/startup_es32f36xx.s
index 362c8483fe..c8aaf3ed69 100644
--- a/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/keil/startup_es32f36xx.s
+++ b/bsp/essemi/es32f369x/libraries/CMSIS/Device/EastSoft/ES32F36xx/Startup/keil/startup_es32f36xx.s
@@ -4,6 +4,20 @@
; author : AE Team
; data : 23 Jan 2019
; Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+;
+; SPDX-License-Identifier: Apache-2.0
+;
+; Licensed under the Apache License, Version 2.0 (the License); you may
+; not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an AS IS BASIS, WITHOUT
+; WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
;*******************************************************************************
;Stack Configuration------------------------------------------------------------
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_acmp.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_acmp.h
index 7fbb68e655..60877098d6 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_acmp.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_acmp.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_adc.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_adc.h
index 2638e139fd..e88c16d10b 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_adc.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_adc.h
@@ -9,6 +9,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
******************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_bkpc.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_bkpc.h
index ce23ba73e9..246f6397d3 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_bkpc.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_bkpc.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_calc.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_calc.h
index bd861b2d04..e14ff7851e 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_calc.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_calc.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_can.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_can.h
index 196094eaaa..04a5d5ef5e 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_can.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_can.h
@@ -10,6 +10,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
******************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_cmu.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_cmu.h
index 400551ae45..55d713ed38 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_cmu.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_cmu.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_conf.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_conf.h
index 1ee5597055..4953ab4f14 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_conf.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_conf.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crc.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crc.h
index dcd6761acb..4e0f3cc152 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crc.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crc.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crypt.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crypt.h
index f72cb06fc7..36a4d41387 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crypt.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_crypt.h
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dac.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dac.h
index d086905826..0e71f3e7e0 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dac.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dac.h
@@ -9,6 +9,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
******************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dbgc.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dbgc.h
index 4d72f6cb2b..c6471b2c2c 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dbgc.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dbgc.h
@@ -11,6 +11,21 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dma.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dma.h
index efd366889c..6f29a0cc7b 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dma.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_dma.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_ebi.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_ebi.h
index a4c0f372d6..d3ed85d97a 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_ebi.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_ebi.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_flash.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_flash.h
index 3a1dfac113..8899ca4326 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_flash.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_flash.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_gpio.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_gpio.h
index 4731c34a67..517330ce32 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_gpio.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_gpio.h
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2c.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2c.h
index 7219542d60..c520c3d41a 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2c.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2c.h
@@ -10,6 +10,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2s.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2s.h
index 46d0c36c8e..e6a811aae3 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2s.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_i2s.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_iap.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_iap.h
index 900cc43086..cb1e0bf023 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_iap.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_iap.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nand.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nand.h
index bf08b7de80..89d8d5875b 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nand.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nand.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nor_lcd.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nor_lcd.h
index 83a200b34e..9815aa6ebc 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nor_lcd.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_nor_lcd.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pis.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pis.h
index 992b3790f0..39f481a5be 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pis.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pis.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pmu.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pmu.h
index d58c34db24..f400be8a9f 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pmu.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_pmu.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_qspi.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_qspi.h
index a8e80b09d8..f4e2642dcd 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_qspi.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_qspi.h
@@ -7,6 +7,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rmu.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rmu.h
index 07319306b0..bb3ec3df89 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rmu.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rmu.h
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtc.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtc.h
index 4c31312e84..3234aa7d6e 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtc.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtc.h
@@ -10,6 +10,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*******************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtchw.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtchw.h
index 55cbbfec47..6faecf5145 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtchw.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_rtchw.h
@@ -10,6 +10,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*******************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_spi.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_spi.h
index 63a4a01f56..ebda1db3a7 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_spi.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_spi.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_sram.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_sram.h
index 2743b83535..aff23692a3 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_sram.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_sram.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_syscfg.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_syscfg.h
index c541c714ed..35063a28a1 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_syscfg.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_syscfg.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_timer.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_timer.h
index 1805c3f95a..dcbc884368 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_timer.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_timer.h
@@ -12,6 +12,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_trng.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_trng.h
index ff86dbbcbf..267a7db0da 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_trng.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_trng.h
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_tsense.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_tsense.h
index 6aff4435b1..cceb2587ec 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_tsense.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_tsense.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_uart.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_uart.h
index a525f59783..56c1b5b94d 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_uart.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_uart.h
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_usb.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_usb.h
index 38c991a757..d319f7a575 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_usb.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_usb.h
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_wdt.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_wdt.h
index 5629fafaa3..805be32d50 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_wdt.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/ald_wdt.h
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/type.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/type.h
index ea5bd88970..a8db397a97 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/type.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/type.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
@@ -22,7 +36,7 @@ extern "C" {
#endif
#include <stdint.h>
-
+#include "es_conf_info_select.h"
#if defined (__CC_ARM)
#define __INLINE__ __inline
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/utils.h b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/utils.h
index 1c6b1b942f..b5589ce07a 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/utils.h
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Include/utils.h
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_acmp.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_acmp.c
index 75c53bda13..2e2dbe74d5 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_acmp.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_acmp.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_adc.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_adc.c
index c239d074b2..6870742cc0 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_adc.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_adc.c
@@ -24,6 +24,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_bkpc.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_bkpc.c
index c0a5e86f8a..568f7cec0e 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_bkpc.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_bkpc.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_calc.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_calc.c
index 7a00c641fb..a49d150e32 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_calc.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_calc.c
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_can.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_can.c
index 24cabd8cef..ec9ec28260 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_can.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_can.c
@@ -14,6 +14,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_cmu.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_cmu.c
index 76c6e516be..8beb08de5b 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_cmu.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_cmu.c
@@ -9,7 +9,21 @@
* @author AE Team
* @note
*
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*********************************************************************************
* @verbatim
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crc.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crc.c
index ad0199a486..ea64ad1245 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crc.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crc.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crypt.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crypt.c
index 4d17afca3b..04a0fa19de 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crypt.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_crypt.c
@@ -12,6 +12,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dac.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dac.c
index ba07048b07..7f98ce0b88 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dac.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dac.c
@@ -10,6 +10,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dma.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dma.c
index a314e72b29..eae14f80c3 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dma.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_dma.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_ebi.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_ebi.c
index 5fc69ba3f9..d58acdfc9b 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_ebi.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_ebi.c
@@ -10,6 +10,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
******************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash.c
index 48c7fe0228..33b114fa55 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*
*********************************************************************************
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash_ext.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash_ext.c
index 0c8f94b3a2..07d7dc5f60 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash_ext.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_flash_ext.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*
*********************************************************************************
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_gpio.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_gpio.c
index 686bb601d2..255c569463 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_gpio.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_gpio.c
@@ -16,6 +16,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
@@ -185,7 +199,7 @@ void ald_gpio_init(GPIO_TypeDef *GPIOx, uint16_t pin, gpio_init_t *init)
for (i = 0; i < 16; ++i) {
if (((pin >> i) & 0x1) == 0)
continue;
-
+
/* Get position and 2-bits mask */
pos = i << 1;
mask = 0x3 << pos;
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2c.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2c.c
index 419bb25481..37ec31d67d 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2c.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2c.c
@@ -10,6 +10,20 @@
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
@verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2s.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2s.c
index 9570ddf8f7..c018037845 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2s.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_i2s.c
@@ -17,6 +17,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
@verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_iap.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_iap.c
index e350c0a3ac..a2265bc1dc 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_iap.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_iap.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nand.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nand.c
index 1595d520e6..cc178feb7f 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nand.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nand.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nor_lcd.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nor_lcd.c
index 4d52faee86..ca28cbf091 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nor_lcd.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_nor_lcd.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pis.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pis.c
index e26037fcfc..3546c0b3be 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pis.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pis.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pmu.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pmu.c
index bb588747db..0d411b0bbd 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pmu.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_pmu.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_qspi.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_qspi.c
index d0c0ecb3ac..b8bd90ffc1 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_qspi.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_qspi.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
#include "ald_qspi.h"
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rmu.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rmu.c
index c5bd06b325..55869f621b 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rmu.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rmu.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtc.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtc.c
index c0fd24b64f..baf3e5d205 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtc.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtc.c
@@ -18,6 +18,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtchw.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtchw.c
index c423f657cb..684e1eb5e8 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtchw.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_rtchw.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_spi.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_spi.c
index ce78e605a7..470167d65e 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_spi.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_spi.c
@@ -17,6 +17,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
@verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_sram.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_sram.c
index 31f7491679..384175d117 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_sram.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_sram.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
#include "ald_sram.h"
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_timer.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_timer.c
index 49e8ccee2c..7860499237 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_timer.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_timer.c
@@ -12,6 +12,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_trng.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_trng.c
index 200f8db8bc..54496cec18 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_trng.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_trng.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_tsense.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_tsense.c
index b5bbc8534b..90c341c864 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_tsense.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_tsense.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_uart.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_uart.c
index f747967e32..84c96348c6 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_uart.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_uart.c
@@ -17,6 +17,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
* @verbatim
==============================================================================
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_usb.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_usb.c
index 26605cd791..3524853e37 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_usb.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_usb.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_wdt.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_wdt.c
index 1e69e95d8f..2077cdabed 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_wdt.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/ald_wdt.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
#include "ald_conf.h"
diff --git a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/utils.c b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/utils.c
index bd247fc055..d2c5bfecb6 100644
--- a/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/utils.c
+++ b/bsp/essemi/es32f369x/libraries/ES32F36xx_ALD_StdPeriph_Driver/Source/utils.c
@@ -11,6 +11,20 @@
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
*********************************************************************************
*/
diff --git a/bsp/essemi/es32f369x/project.uvoptx b/bsp/essemi/es32f369x/project.uvoptx
index 9820d88eaa..2ee2601b40 100644
--- a/bsp/essemi/es32f369x/project.uvoptx
+++ b/bsp/essemi/es32f369x/project.uvoptx
@@ -73,7 +73,7 @@
<LExpSel>0</LExpSel>
</OPTXL>
<OPTFL>
- <tvExp>1</tvExp>
+ <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
@@ -176,7 +176,7 @@
<Group>
<GroupName>Applications</GroupName>
- <tvExp>1</tvExp>
+ <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -195,7 +195,7 @@
</Group>
<Group>
- <GroupName>cpu</GroupName>
+ <GroupName>CPU</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
@@ -275,8 +275,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\can\can.c</PathWithFileName>
- <FilenameWithoutPath>can.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\misc\pin.c</PathWithFileName>
+ <FilenameWithoutPath>pin.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -287,8 +287,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\hwtimer\hwtimer.c</PathWithFileName>
- <FilenameWithoutPath>hwtimer.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\serial\serial.c</PathWithFileName>
+ <FilenameWithoutPath>serial.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -299,8 +299,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\i2c\i2c_core.c</PathWithFileName>
- <FilenameWithoutPath>i2c_core.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\src\dataqueue.c</PathWithFileName>
+ <FilenameWithoutPath>dataqueue.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -311,8 +311,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\i2c\i2c_dev.c</PathWithFileName>
- <FilenameWithoutPath>i2c_dev.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\src\pipe.c</PathWithFileName>
+ <FilenameWithoutPath>pipe.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -323,8 +323,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\i2c\i2c-bit-ops.c</PathWithFileName>
- <FilenameWithoutPath>i2c-bit-ops.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\src\workqueue.c</PathWithFileName>
+ <FilenameWithoutPath>workqueue.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -335,8 +335,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\misc\pin.c</PathWithFileName>
- <FilenameWithoutPath>pin.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\src\completion.c</PathWithFileName>
+ <FilenameWithoutPath>completion.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -347,8 +347,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\misc\adc.c</PathWithFileName>
- <FilenameWithoutPath>adc.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\src\ringblk_buf.c</PathWithFileName>
+ <FilenameWithoutPath>ringblk_buf.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -359,8 +359,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\misc\rt_drv_pwm.c</PathWithFileName>
- <FilenameWithoutPath>rt_drv_pwm.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\src\ringbuffer.c</PathWithFileName>
+ <FilenameWithoutPath>ringbuffer.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -371,239 +371,239 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\pm\pm.c</PathWithFileName>
- <FilenameWithoutPath>pm.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\drivers\src\waitqueue.c</PathWithFileName>
+ <FilenameWithoutPath>waitqueue.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ </Group>
+
+ <Group>
+ <GroupName>Drivers</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>4</GroupNumber>
<FileNumber>16</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\rtc\rtc.c</PathWithFileName>
- <FilenameWithoutPath>rtc.c</FilenameWithoutPath>
+ <PathWithFileName>drivers\drv_gpio.c</PathWithFileName>
+ <FilenameWithoutPath>drv_gpio.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>4</GroupNumber>
<FileNumber>17</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\serial\serial.c</PathWithFileName>
- <FilenameWithoutPath>serial.c</FilenameWithoutPath>
+ <PathWithFileName>drivers\drv_uart.c</PathWithFileName>
+ <FilenameWithoutPath>drv_uart.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>4</GroupNumber>
<FileNumber>18</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\spi\spi_core.c</PathWithFileName>
- <FilenameWithoutPath>spi_core.c</FilenameWithoutPath>
+ <PathWithFileName>drivers\board.c</PathWithFileName>
+ <FilenameWithoutPath>board.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ </Group>
+
+ <Group>
+ <GroupName>finsh</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>5</GroupNumber>
<FileNumber>19</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\spi\spi_dev.c</PathWithFileName>
- <FilenameWithoutPath>spi_dev.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\finsh\shell.c</PathWithFileName>
+ <FilenameWithoutPath>shell.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>5</GroupNumber>
<FileNumber>20</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\src\completion.c</PathWithFileName>
- <FilenameWithoutPath>completion.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\finsh\msh.c</PathWithFileName>
+ <FilenameWithoutPath>msh.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>5</GroupNumber>
<FileNumber>21</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\src\dataqueue.c</PathWithFileName>
- <FilenameWithoutPath>dataqueue.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\finsh\cmd.c</PathWithFileName>
+ <FilenameWithoutPath>cmd.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ </Group>
+
+ <Group>
+ <GroupName>Kernel</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>22</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\src\pipe.c</PathWithFileName>
- <FilenameWithoutPath>pipe.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\mem.c</PathWithFileName>
+ <FilenameWithoutPath>mem.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>23</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\src\ringblk_buf.c</PathWithFileName>
- <FilenameWithoutPath>ringblk_buf.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\irq.c</PathWithFileName>
+ <FilenameWithoutPath>irq.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>24</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\src\ringbuffer.c</PathWithFileName>
- <FilenameWithoutPath>ringbuffer.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\timer.c</PathWithFileName>
+ <FilenameWithoutPath>timer.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>25</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\src\waitqueue.c</PathWithFileName>
- <FilenameWithoutPath>waitqueue.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\object.c</PathWithFileName>
+ <FilenameWithoutPath>object.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>3</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>26</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\drivers\src\workqueue.c</PathWithFileName>
- <FilenameWithoutPath>workqueue.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\kservice.c</PathWithFileName>
+ <FilenameWithoutPath>kservice.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
- </Group>
-
- <Group>
- <GroupName>Drivers</GroupName>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <cbSel>0</cbSel>
- <RteFlg>0</RteFlg>
<File>
- <GroupNumber>4</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>drivers\board.c</PathWithFileName>
- <FilenameWithoutPath>board.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\signal.c</PathWithFileName>
+ <FilenameWithoutPath>signal.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>4</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>drivers\drv_gpio.c</PathWithFileName>
- <FilenameWithoutPath>drv_gpio.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\mempool.c</PathWithFileName>
+ <FilenameWithoutPath>mempool.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>4</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>29</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>drivers\drv_uart.c</PathWithFileName>
- <FilenameWithoutPath>drv_uart.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\thread.c</PathWithFileName>
+ <FilenameWithoutPath>thread.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
- </Group>
-
- <Group>
- <GroupName>finsh</GroupName>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <cbSel>0</cbSel>
- <RteFlg>0</RteFlg>
<File>
- <GroupNumber>5</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\finsh\shell.c</PathWithFileName>
- <FilenameWithoutPath>shell.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\ipc.c</PathWithFileName>
+ <FilenameWithoutPath>ipc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>5</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>31</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\finsh\cmd.c</PathWithFileName>
- <FilenameWithoutPath>cmd.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\idle.c</PathWithFileName>
+ <FilenameWithoutPath>idle.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>5</GroupNumber>
+ <GroupNumber>6</GroupNumber>
<FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\components\finsh\msh.c</PathWithFileName>
- <FilenameWithoutPath>msh.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\scheduler.c</PathWithFileName>
+ <FilenameWithoutPath>scheduler.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
- </Group>
-
- <Group>
- <GroupName>Kernel</GroupName>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <cbSel>0</cbSel>
- <RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>33</FileNumber>
@@ -611,8 +611,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\clock.c</PathWithFileName>
- <FilenameWithoutPath>clock.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\device.c</PathWithFileName>
+ <FilenameWithoutPath>device.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
@@ -635,393 +635,401 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\device.c</PathWithFileName>
- <FilenameWithoutPath>device.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\src\clock.c</PathWithFileName>
+ <FilenameWithoutPath>clock.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ </Group>
+
+ <Group>
+ <GroupName>libc</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>7</GroupNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\idle.c</PathWithFileName>
- <FilenameWithoutPath>idle.c</FilenameWithoutPath>
+ <PathWithFileName>..\..\..\components\libc\compilers\common\time.c</PathWithFileName>
+ <FilenameWithoutPath>time.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
+ </Group>
+
+ <Group>
+ <GroupName>Libraries</GroupName>
+ <tvExp>0</tvExp>
+ <tvExpOptDlg>0</tvExpOptDlg>
+ <cbSel>0</cbSel>
+ <RteFlg>0</RteFlg>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>37</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\ipc.c</PathWithFileName>
- <FilenameWithoutPath>ipc.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2c.c</PathWithFileName>
+ <FilenameWithoutPath>ald_i2c.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>38</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\irq.c</PathWithFileName>
- <FilenameWithoutPath>irq.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_ebi.c</PathWithFileName>
+ <FilenameWithoutPath>ald_ebi.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>39</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\kservice.c</PathWithFileName>
- <FilenameWithoutPath>kservice.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtc.c</PathWithFileName>
+ <FilenameWithoutPath>ald_rtc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>40</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\mem.c</PathWithFileName>
- <FilenameWithoutPath>mem.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_can.c</PathWithFileName>
+ <FilenameWithoutPath>ald_can.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>41</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\mempool.c</PathWithFileName>
- <FilenameWithoutPath>mempool.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nor_lcd.c</PathWithFileName>
+ <FilenameWithoutPath>ald_nor_lcd.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>42</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\object.c</PathWithFileName>
- <FilenameWithoutPath>object.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_cmu.c</PathWithFileName>
+ <FilenameWithoutPath>ald_cmu.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>43</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\scheduler.c</PathWithFileName>
- <FilenameWithoutPath>scheduler.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_pis.c</PathWithFileName>
+ <FilenameWithoutPath>ald_pis.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>44</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\signal.c</PathWithFileName>
- <FilenameWithoutPath>signal.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_timer.c</PathWithFileName>
+ <FilenameWithoutPath>ald_timer.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>45</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\thread.c</PathWithFileName>
- <FilenameWithoutPath>thread.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_sram.c</PathWithFileName>
+ <FilenameWithoutPath>ald_sram.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>6</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>..\..\..\src\timer.c</PathWithFileName>
- <FilenameWithoutPath>timer.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_iap.c</PathWithFileName>
+ <FilenameWithoutPath>ald_iap.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
- </Group>
-
- <Group>
- <GroupName>Libraries</GroupName>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <cbSel>0</cbSel>
- <RteFlg>0</RteFlg>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>47</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_acmp.c</PathWithFileName>
- <FilenameWithoutPath>ald_acmp.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_wdt.c</PathWithFileName>
+ <FilenameWithoutPath>ald_wdt.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>48</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_adc.c</PathWithFileName>
- <FilenameWithoutPath>ald_adc.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtchw.c</PathWithFileName>
+ <FilenameWithoutPath>ald_rtchw.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>49</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_bkpc.c</PathWithFileName>
- <FilenameWithoutPath>ald_bkpc.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dac.c</PathWithFileName>
+ <FilenameWithoutPath>ald_dac.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>50</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_calc.c</PathWithFileName>
- <FilenameWithoutPath>ald_calc.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_acmp.c</PathWithFileName>
+ <FilenameWithoutPath>ald_acmp.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>51</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_can.c</PathWithFileName>
- <FilenameWithoutPath>ald_can.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_gpio.c</PathWithFileName>
+ <FilenameWithoutPath>ald_gpio.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>52</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_cmu.c</PathWithFileName>
- <FilenameWithoutPath>ald_cmu.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_tsense.c</PathWithFileName>
+ <FilenameWithoutPath>ald_tsense.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>53</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crc.c</PathWithFileName>
- <FilenameWithoutPath>ald_crc.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dma.c</PathWithFileName>
+ <FilenameWithoutPath>ald_dma.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>54</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crypt.c</PathWithFileName>
- <FilenameWithoutPath>ald_crypt.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rmu.c</PathWithFileName>
+ <FilenameWithoutPath>ald_rmu.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>55</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dac.c</PathWithFileName>
- <FilenameWithoutPath>ald_dac.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_trng.c</PathWithFileName>
+ <FilenameWithoutPath>ald_trng.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>56</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dma.c</PathWithFileName>
- <FilenameWithoutPath>ald_dma.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_spi.c</PathWithFileName>
+ <FilenameWithoutPath>ald_spi.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>57</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_ebi.c</PathWithFileName>
- <FilenameWithoutPath>ald_ebi.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crc.c</PathWithFileName>
+ <FilenameWithoutPath>ald_crc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>58</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash.c</PathWithFileName>
- <FilenameWithoutPath>ald_flash.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_usb.c</PathWithFileName>
+ <FilenameWithoutPath>ald_usb.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>59</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash_ext.c</PathWithFileName>
- <FilenameWithoutPath>ald_flash_ext.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_calc.c</PathWithFileName>
+ <FilenameWithoutPath>ald_calc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>60</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_gpio.c</PathWithFileName>
- <FilenameWithoutPath>ald_gpio.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\utils.c</PathWithFileName>
+ <FilenameWithoutPath>utils.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>61</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2c.c</PathWithFileName>
- <FilenameWithoutPath>ald_i2c.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_qspi.c</PathWithFileName>
+ <FilenameWithoutPath>ald_qspi.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>62</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2s.c</PathWithFileName>
- <FilenameWithoutPath>ald_i2s.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash.c</PathWithFileName>
+ <FilenameWithoutPath>ald_flash.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>63</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_iap.c</PathWithFileName>
- <FilenameWithoutPath>ald_iap.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nand.c</PathWithFileName>
+ <FilenameWithoutPath>ald_nand.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>64</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nand.c</PathWithFileName>
- <FilenameWithoutPath>ald_nand.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_adc.c</PathWithFileName>
+ <FilenameWithoutPath>ald_adc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>65</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nor_lcd.c</PathWithFileName>
- <FilenameWithoutPath>ald_nor_lcd.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crypt.c</PathWithFileName>
+ <FilenameWithoutPath>ald_crypt.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>66</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_pis.c</PathWithFileName>
- <FilenameWithoutPath>ald_pis.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_uart.c</PathWithFileName>
+ <FilenameWithoutPath>ald_uart.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>67</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
@@ -1033,170 +1041,50 @@
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>68</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_qspi.c</PathWithFileName>
- <FilenameWithoutPath>ald_qspi.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_bkpc.c</PathWithFileName>
+ <FilenameWithoutPath>ald_bkpc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>69</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rmu.c</PathWithFileName>
- <FilenameWithoutPath>ald_rmu.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash_ext.c</PathWithFileName>
+ <FilenameWithoutPath>ald_flash_ext.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>70</FileNumber>
- <FileType>1</FileType>
+ <FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtc.c</PathWithFileName>
- <FilenameWithoutPath>ald_rtc.c</FilenameWithoutPath>
+ <PathWithFileName>libraries\CMSIS\Device\EastSoft\ES32F36xx\Startup\keil\startup_es32f36xx.s</PathWithFileName>
+ <FilenameWithoutPath>startup_es32f36xx.s</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
- <GroupNumber>7</GroupNumber>
+ <GroupNumber>8</GroupNumber>
<FileNumber>71</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtchw.c</PathWithFileName>
- <FilenameWithoutPath>ald_rtchw.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>72</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_spi.c</PathWithFileName>
- <FilenameWithoutPath>ald_spi.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>73</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_sram.c</PathWithFileName>
- <FilenameWithoutPath>ald_sram.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>74</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_timer.c</PathWithFileName>
- <FilenameWithoutPath>ald_timer.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>75</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_trng.c</PathWithFileName>
- <FilenameWithoutPath>ald_trng.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>76</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_tsense.c</PathWithFileName>
- <FilenameWithoutPath>ald_tsense.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>77</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_uart.c</PathWithFileName>
- <FilenameWithoutPath>ald_uart.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>78</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_usb.c</PathWithFileName>
- <FilenameWithoutPath>ald_usb.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>79</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_wdt.c</PathWithFileName>
- <FilenameWithoutPath>ald_wdt.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>80</FileNumber>
- <FileType>1</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\utils.c</PathWithFileName>
- <FilenameWithoutPath>utils.c</FilenameWithoutPath>
- <RteFlg>0</RteFlg>
- <bShared>0</bShared>
- </File>
- <File>
- <GroupNumber>7</GroupNumber>
- <FileNumber>81</FileNumber>
- <FileType>2</FileType>
- <tvExp>0</tvExp>
- <tvExpOptDlg>0</tvExpOptDlg>
- <bDave2>0</bDave2>
- <PathWithFileName>libraries\CMSIS\Device\EastSoft\ES32F36xx\Startup\keil\startup_es32f36xx.s</PathWithFileName>
- <FilenameWithoutPath>startup_es32f36xx.s</FilenameWithoutPath>
+ <PathWithFileName>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2s.c</PathWithFileName>
+ <FilenameWithoutPath>ald_i2s.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
diff --git a/bsp/essemi/es32f369x/project.uvprojx b/bsp/essemi/es32f369x/project.uvprojx
index bca6765ef1..5fc8ec68b0 100644
--- a/bsp/essemi/es32f369x/project.uvprojx
+++ b/bsp/essemi/es32f369x/project.uvprojx
@@ -336,9 +336,9 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
- <Define>ES32F36xx</Define>
+ <Define>ES32F36xx, __RTTHREAD__, __CLK_TCK=RT_TICK_PER_SECOND</Define>
<Undefine></Undefine>
- <IncludePath>applications;.;drivers;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m3;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\spi;..\..\..\components\drivers\include;..\..\..\components\drivers\include;drivers;..\..\..\components\finsh;.;..\..\..\include;libraries\CMSIS\Device\EastSoft\ES32F36xx\Include;libraries\CMSIS\Include;libraries\ES32F36xx_ALD_StdPeriph_Driver\Include</IncludePath>
+ <IncludePath>applications;.;drivers\ES;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m3;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;drivers;..\..\..\components\finsh;.;..\..\..\include;..\..\..\components\libc\compilers\common;libraries\CMSIS\Device\EastSoft\ES32F36xx\Include;libraries\CMSIS\Include;libraries\ES32F36xx_ALD_StdPeriph_Driver\Include</IncludePath>
</VariousControls>
</Cads>
<Aads>
@@ -390,7 +390,7 @@
</Files>
</Group>
<Group>
- <GroupName>cpu</GroupName>
+ <GroupName>CPU</GroupName>
<Files>
<File>
<FileName>backtrace.c</FileName>
@@ -421,155 +421,36 @@
</Group>
<Group>
<GroupName>DeviceDrivers</GroupName>
- <GroupOption>
- <CommonProperty>
- <UseCPPCompiler>0</UseCPPCompiler>
- <RVCTCodeConst>0</RVCTCodeConst>
- <RVCTZI>0</RVCTZI>
- <RVCTOtherData>0</RVCTOtherData>
- <ModuleSelection>0</ModuleSelection>
- <IncludeInBuild>1</IncludeInBuild>
- <AlwaysBuild>0</AlwaysBuild>
- <GenerateAssemblyFile>0</GenerateAssemblyFile>
- <AssembleAssemblyFile>0</AssembleAssemblyFile>
- <PublicsOnly>0</PublicsOnly>
- <StopOnExitCode>3</StopOnExitCode>
- <CustomArgument></CustomArgument>
- <IncludeLibraryModules></IncludeLibraryModules>
- <ComprImg>0</ComprImg>
- </CommonProperty>
- <GroupArmAds>
- <Cads>
- <interw>2</interw>
- <Optim>0</Optim>
- <oTime>2</oTime>
- <SplitLS>2</SplitLS>
- <OneElfS>2</OneElfS>
- <Strict>2</Strict>
- <EnumInt>2</EnumInt>
- <PlainCh>2</PlainCh>
- <Ropi>2</Ropi>
- <Rwpi>2</Rwpi>
- <wLevel>0</wLevel>
- <uThumb>2</uThumb>
- <uSurpInc>2</uSurpInc>
- <uC99>2</uC99>
- <uGnu>2</uGnu>
- <useXO>2</useXO>
- <v6Lang>0</v6Lang>
- <v6LangP>0</v6LangP>
- <vShortEn>2</vShortEn>
- <vShortWch>2</vShortWch>
- <v6Lto>2</v6Lto>
- <v6WtE>2</v6WtE>
- <v6Rtti>2</v6Rtti>
- <VariousControls>
- <MiscControls></MiscControls>
- <Define> </Define>
- <Undefine> </Undefine>
- <IncludePath></IncludePath>
- </VariousControls>
- </Cads>
- <Aads>
- <interw>2</interw>
- <Ropi>2</Ropi>
- <Rwpi>2</Rwpi>
- <thumb>2</thumb>
- <SplitLS>2</SplitLS>
- <SwStkChk>2</SwStkChk>
- <NoWarn>2</NoWarn>
- <uSurpInc>2</uSurpInc>
- <useXO>2</useXO>
- <uClangAs>2</uClangAs>
- <VariousControls>
- <MiscControls></MiscControls>
- <Define></Define>
- <Undefine></Undefine>
- <IncludePath></IncludePath>
- </VariousControls>
- </Aads>
- </GroupArmAds>
- </GroupOption>
<Files>
<File>
- <FileName>can.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\can\can.c</FilePath>
- </File>
- <File>
- <FileName>hwtimer.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\hwtimer\hwtimer.c</FilePath>
- </File>
- <File>
- <FileName>i2c_core.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\i2c\i2c_core.c</FilePath>
- </File>
- <File>
- <FileName>i2c_dev.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\i2c\i2c_dev.c</FilePath>
- </File>
- <File>
- <FileName>i2c-bit-ops.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\i2c\i2c-bit-ops.c</FilePath>
- </File>
- <File>
<FileName>pin.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\misc\pin.c</FilePath>
</File>
<File>
- <FileName>adc.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\misc\adc.c</FilePath>
- </File>
- <File>
- <FileName>rt_drv_pwm.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\misc\rt_drv_pwm.c</FilePath>
- </File>
- <File>
- <FileName>pm.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\pm\pm.c</FilePath>
- </File>
- <File>
- <FileName>rtc.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\rtc\rtc.c</FilePath>
- </File>
- <File>
<FileName>serial.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\serial\serial.c</FilePath>
</File>
<File>
- <FileName>spi_core.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\spi\spi_core.c</FilePath>
- </File>
- <File>
- <FileName>spi_dev.c</FileName>
+ <FileName>dataqueue.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\spi\spi_dev.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\dataqueue.c</FilePath>
</File>
<File>
- <FileName>completion.c</FileName>
+ <FileName>pipe.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\completion.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\pipe.c</FilePath>
</File>
<File>
- <FileName>dataqueue.c</FileName>
+ <FileName>workqueue.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\dataqueue.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\workqueue.c</FilePath>
</File>
<File>
- <FileName>pipe.c</FileName>
+ <FileName>completion.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\pipe.c</FilePath>
+ <FilePath>..\..\..\components\drivers\src\completion.c</FilePath>
</File>
<File>
<FileName>ringblk_buf.c</FileName>
@@ -586,22 +467,12 @@
<FileType>1</FileType>
<FilePath>..\..\..\components\drivers\src\waitqueue.c</FilePath>
</File>
- <File>
- <FileName>workqueue.c</FileName>
- <FileType>1</FileType>
- <FilePath>..\..\..\components\drivers\src\workqueue.c</FilePath>
- </File>
</Files>
</Group>
<Group>
<GroupName>Drivers</GroupName>
<Files>
<File>
- <FileName>board.c</FileName>
- <FileType>1</FileType>
- <FilePath>drivers\board.c</FilePath>
- </File>
- <File>
<FileName>drv_gpio.c</FileName>
<FileType>1</FileType>
<FilePath>drivers\drv_gpio.c</FilePath>
@@ -611,6 +482,11 @@
<FileType>1</FileType>
<FilePath>drivers\drv_uart.c</FilePath>
</File>
+ <File>
+ <FileName>board.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>drivers\board.c</FilePath>
+ </File>
</Files>
</Group>
<Group>
@@ -622,14 +498,14 @@
<FilePath>..\..\..\components\finsh\shell.c</FilePath>
</File>
<File>
- <FileName>cmd.c</FileName>
+ <FileName>msh.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\finsh\cmd.c</FilePath>
+ <FilePath>..\..\..\components\finsh\msh.c</FilePath>
</File>
<File>
- <FileName>msh.c</FileName>
+ <FileName>cmd.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\components\finsh\msh.c</FilePath>
+ <FilePath>..\..\..\components\finsh\cmd.c</FilePath>
</File>
</Files>
</Group>
@@ -637,54 +513,54 @@
<GroupName>Kernel</GroupName>
<Files>
<File>
- <FileName>clock.c</FileName>
+ <FileName>mem.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\clock.c</FilePath>
+ <FilePath>..\..\..\src\mem.c</FilePath>
</File>
<File>
- <FileName>components.c</FileName>
+ <FileName>irq.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\components.c</FilePath>
+ <FilePath>..\..\..\src\irq.c</FilePath>
</File>
<File>
- <FileName>device.c</FileName>
+ <FileName>timer.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\device.c</FilePath>
+ <FilePath>..\..\..\src\timer.c</FilePath>
</File>
<File>
- <FileName>idle.c</FileName>
+ <FileName>object.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\idle.c</FilePath>
+ <FilePath>..\..\..\src\object.c</FilePath>
</File>
<File>
- <FileName>ipc.c</FileName>
+ <FileName>kservice.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\ipc.c</FilePath>
+ <FilePath>..\..\..\src\kservice.c</FilePath>
</File>
<File>
- <FileName>irq.c</FileName>
+ <FileName>signal.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\irq.c</FilePath>
+ <FilePath>..\..\..\src\signal.c</FilePath>
</File>
<File>
- <FileName>kservice.c</FileName>
+ <FileName>mempool.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\kservice.c</FilePath>
+ <FilePath>..\..\..\src\mempool.c</FilePath>
</File>
<File>
- <FileName>mem.c</FileName>
+ <FileName>thread.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\mem.c</FilePath>
+ <FilePath>..\..\..\src\thread.c</FilePath>
</File>
<File>
- <FileName>mempool.c</FileName>
+ <FileName>ipc.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\mempool.c</FilePath>
+ <FilePath>..\..\..\src\ipc.c</FilePath>
</File>
<File>
- <FileName>object.c</FileName>
+ <FileName>idle.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\object.c</FilePath>
+ <FilePath>..\..\..\src\idle.c</FilePath>
</File>
<File>
<FileName>scheduler.c</FileName>
@@ -692,44 +568,49 @@
<FilePath>..\..\..\src\scheduler.c</FilePath>
</File>
<File>
- <FileName>signal.c</FileName>
+ <FileName>device.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\signal.c</FilePath>
+ <FilePath>..\..\..\src\device.c</FilePath>
</File>
<File>
- <FileName>thread.c</FileName>
+ <FileName>components.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\thread.c</FilePath>
+ <FilePath>..\..\..\src\components.c</FilePath>
</File>
<File>
- <FileName>timer.c</FileName>
+ <FileName>clock.c</FileName>
<FileType>1</FileType>
- <FilePath>..\..\..\src\timer.c</FilePath>
+ <FilePath>..\..\..\src\clock.c</FilePath>
</File>
</Files>
</Group>
<Group>
- <GroupName>Libraries</GroupName>
+ <GroupName>libc</GroupName>
<Files>
<File>
- <FileName>ald_acmp.c</FileName>
+ <FileName>time.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_acmp.c</FilePath>
+ <FilePath>..\..\..\components\libc\compilers\common\time.c</FilePath>
</File>
+ </Files>
+ </Group>
+ <Group>
+ <GroupName>Libraries</GroupName>
+ <Files>
<File>
- <FileName>ald_adc.c</FileName>
+ <FileName>ald_i2c.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_adc.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2c.c</FilePath>
</File>
<File>
- <FileName>ald_bkpc.c</FileName>
+ <FileName>ald_ebi.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_bkpc.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_ebi.c</FilePath>
</File>
<File>
- <FileName>ald_calc.c</FileName>
+ <FileName>ald_rtc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_calc.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtc.c</FilePath>
</File>
<File>
<FileName>ald_can.c</FileName>
@@ -737,129 +618,129 @@
<FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_can.c</FilePath>
</File>
<File>
- <FileName>ald_cmu.c</FileName>
+ <FileName>ald_nor_lcd.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_cmu.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nor_lcd.c</FilePath>
</File>
<File>
- <FileName>ald_crc.c</FileName>
+ <FileName>ald_cmu.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crc.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_cmu.c</FilePath>
</File>
<File>
- <FileName>ald_crypt.c</FileName>
+ <FileName>ald_pis.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crypt.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_pis.c</FilePath>
</File>
<File>
- <FileName>ald_dac.c</FileName>
+ <FileName>ald_timer.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dac.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_timer.c</FilePath>
</File>
<File>
- <FileName>ald_dma.c</FileName>
+ <FileName>ald_sram.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dma.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_sram.c</FilePath>
</File>
<File>
- <FileName>ald_ebi.c</FileName>
+ <FileName>ald_iap.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_ebi.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_iap.c</FilePath>
</File>
<File>
- <FileName>ald_flash.c</FileName>
+ <FileName>ald_wdt.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_wdt.c</FilePath>
</File>
<File>
- <FileName>ald_flash_ext.c</FileName>
+ <FileName>ald_rtchw.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash_ext.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtchw.c</FilePath>
</File>
<File>
- <FileName>ald_gpio.c</FileName>
+ <FileName>ald_dac.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_gpio.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dac.c</FilePath>
</File>
<File>
- <FileName>ald_i2c.c</FileName>
+ <FileName>ald_acmp.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2c.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_acmp.c</FilePath>
</File>
<File>
- <FileName>ald_i2s.c</FileName>
+ <FileName>ald_gpio.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2s.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_gpio.c</FilePath>
</File>
<File>
- <FileName>ald_iap.c</FileName>
+ <FileName>ald_tsense.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_iap.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_tsense.c</FilePath>
</File>
<File>
- <FileName>ald_nand.c</FileName>
+ <FileName>ald_dma.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nand.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_dma.c</FilePath>
</File>
<File>
- <FileName>ald_nor_lcd.c</FileName>
+ <FileName>ald_rmu.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nor_lcd.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rmu.c</FilePath>
</File>
<File>
- <FileName>ald_pis.c</FileName>
+ <FileName>ald_trng.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_pis.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_trng.c</FilePath>
</File>
<File>
- <FileName>ald_pmu.c</FileName>
+ <FileName>ald_spi.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_pmu.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_spi.c</FilePath>
</File>
<File>
- <FileName>ald_qspi.c</FileName>
+ <FileName>ald_crc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_qspi.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crc.c</FilePath>
</File>
<File>
- <FileName>ald_rmu.c</FileName>
+ <FileName>ald_usb.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rmu.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_usb.c</FilePath>
</File>
<File>
- <FileName>ald_rtc.c</FileName>
+ <FileName>ald_calc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtc.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_calc.c</FilePath>
</File>
<File>
- <FileName>ald_rtchw.c</FileName>
+ <FileName>utils.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_rtchw.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\utils.c</FilePath>
</File>
<File>
- <FileName>ald_spi.c</FileName>
+ <FileName>ald_qspi.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_spi.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_qspi.c</FilePath>
</File>
<File>
- <FileName>ald_sram.c</FileName>
+ <FileName>ald_flash.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_sram.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash.c</FilePath>
</File>
<File>
- <FileName>ald_timer.c</FileName>
+ <FileName>ald_nand.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_timer.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_nand.c</FilePath>
</File>
<File>
- <FileName>ald_trng.c</FileName>
+ <FileName>ald_adc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_trng.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_adc.c</FilePath>
</File>
<File>
- <FileName>ald_tsense.c</FileName>
+ <FileName>ald_crypt.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_tsense.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_crypt.c</FilePath>
</File>
<File>
<FileName>ald_uart.c</FileName>
@@ -867,25 +748,30 @@
<FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_uart.c</FilePath>
</File>
<File>
- <FileName>ald_usb.c</FileName>
+ <FileName>ald_pmu.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_usb.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_pmu.c</FilePath>
</File>
<File>
- <FileName>ald_wdt.c</FileName>
+ <FileName>ald_bkpc.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_wdt.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_bkpc.c</FilePath>
</File>
<File>
- <FileName>utils.c</FileName>
+ <FileName>ald_flash_ext.c</FileName>
<FileType>1</FileType>
- <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\utils.c</FilePath>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_flash_ext.c</FilePath>
</File>
<File>
<FileName>startup_es32f36xx.s</FileName>
<FileType>2</FileType>
<FilePath>libraries\CMSIS\Device\EastSoft\ES32F36xx\Startup\keil\startup_es32f36xx.s</FilePath>
</File>
+ <File>
+ <FileName>ald_i2s.c</FileName>
+ <FileType>1</FileType>
+ <FilePath>libraries\ES32F36xx_ALD_StdPeriph_Driver\Source\ald_i2s.c</FilePath>
+ </File>
</Files>
</Group>
</Groups>
diff --git a/bsp/essemi/es32f369x/rtconfig.h b/bsp/essemi/es32f369x/rtconfig.h
index 54bd07901b..819056462c 100644
--- a/bsp/essemi/es32f369x/rtconfig.h
+++ b/bsp/essemi/es32f369x/rtconfig.h
@@ -15,7 +15,7 @@
#define RT_USING_HOOK
#define RT_USING_IDLE_HOOK
#define RT_IDLE_HOOK_LIST_SIZE 4
-#define IDLE_THREAD_STACK_SIZE 256
+#define IDLE_THREAD_STACK_SIZE 512
#define RT_DEBUG
#define RT_DEBUG_COLOR
@@ -26,6 +26,7 @@
#define RT_USING_EVENT
#define RT_USING_MAILBOX
#define RT_USING_MESSAGEQUEUE
+#define RT_USING_SIGNALS
/* Memory Management */
@@ -76,22 +77,14 @@
#define RT_PIPE_BUFSZ 512
#define RT_USING_SERIAL
#define RT_SERIAL_RB_BUFSZ 64
-#define RT_USING_CAN
-#define RT_USING_HWTIMER
-#define RT_USING_I2C
-#define RT_USING_I2C_BITOPS
#define RT_USING_PIN
-#define RT_USING_ADC
-#define RT_USING_PWM
-#define RT_USING_PM
-#define RT_USING_RTC
-#define RT_USING_SPI
/* Using USB */
/* POSIX layer and C standard library */
+#define RT_LIBC_USING_TIME
/* Network */
@@ -144,6 +137,9 @@
/* system packages */
+/* Micrium: Micrium software products porting for RT-Thread */
+
+
/* peripheral libraries and drivers */
@@ -152,6 +148,9 @@
/* samples: kernel and components samples */
+
+/* games: games run on RT-Thread console */
+
#define SOC_ES32F3696LT
/* Hardware Drivers Config */
@@ -179,7 +178,7 @@
/* RTC Drivers */
-/* HWtimer Drivers */
+/* HWTIMER Drivers */
/* PWM Drivers */
diff --git a/bsp/essemi/es32f369x/template.uvoptx b/bsp/essemi/es32f369x/template.uvoptx
index 8d3f54f7f5..8e6583c22c 100644
--- a/bsp/essemi/es32f369x/template.uvoptx
+++ b/bsp/essemi/es32f369x/template.uvoptx
@@ -101,7 +101,9 @@
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn>
- <nTsel>2</nTsel>
+ <bSchkAxf>0</bSchkAxf>
+ <bTchkAxf>0</bTchkAxf>
+ <nTsel>3</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@@ -165,6 +167,10 @@
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
+ <pMisraNamep></pMisraNamep>
+ <pszMrulep></pszMrulep>
+ <pSingCmdsp></pSingCmdsp>
+ <pMultCmdsp></pMultCmdsp>
</TargetOption>
</Target>
diff --git a/bsp/essemi/es32f369x/template.uvprojx b/bsp/essemi/es32f369x/template.uvprojx
index ad28753eb3..df9bb4e30c 100644
--- a/bsp/essemi/es32f369x/template.uvprojx
+++ b/bsp/essemi/es32f369x/template.uvprojx
@@ -10,11 +10,13 @@
<TargetName>rt-thread</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
+ <pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
+ <uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>ES32F3696LT</Device>
<Vendor>Eastsoft</Vendor>
- <PackID>Eastsoft.ES32_DFP.1.0.5</PackID>
+ <PackID>Eastsoft.ES32_DFP.7.2350</PackID>
<PackURL>http://www.essemi.com</PackURL>
<Cpu>IRAM(0x20000000,0x00018000) IROM(0x00000000,0x00080000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@@ -182,6 +184,7 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
+ <RvdsMve>0</RvdsMve>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@@ -322,6 +325,7 @@
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
+ <uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>1</v6Lang>
<v6LangP>1</v6LangP>