Browse Source

野火启明6m5驱动完善

ShaquilleLiu 10 months ago
parent
commit
af5bd68c58

+ 4 - 0
bsp/renesas/ebf_qi_min_6m5/README.md

@@ -34,6 +34,10 @@
 | GPIO     | 支持       |                 |
 | I2C      | 支持       |                 |
 | SPI      | 支持       |                 |
+| DAC      | 支持       |                 |
+| ADC      | 支持       |                 |
+| PWM      | 支持       |                 |
+| SPI      | 支持       |                 |
 | 持续更新中... |          |                 |
 | **外接外设** | **支持情况** | **备注**          |
 | 持续更新中... |          |                 |

+ 119 - 1
bsp/renesas/ebf_qi_min_6m5/board/Kconfig

@@ -21,11 +21,38 @@ menu "Hardware Drivers Config"
             select RT_USING_SERIAL
             select RT_USING_SERIAL_V2
             if BSP_USING_UART
+                menuconfig BSP_USING_UART2
+                    bool "Enable UART2"
+                    default n
+                    if BSP_USING_UART2
+                        config BSP_UART2_RX_USING_DMA
+                            bool "Enable UART2 RX DMA"
+                            depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
+                            default n
+
+                        config BSP_UART2_TX_USING_DMA
+                            bool "Enable UART2 TX DMA"
+                            depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
+                            default n
+
+                        config BSP_UART2_RX_BUFSIZE
+                            int "Set UART2 RX buffer size"
+                            range 64 65535
+                            depends on RT_USING_SERIAL_V2
+                            default 256
+
+                        config BSP_UART2_TX_BUFSIZE
+                            int "Set UART2 TX buffer size"
+                            range 0 65535
+                            depends on RT_USING_SERIAL_V2
+                            default 0
+                    endif
+
                 menuconfig BSP_USING_UART4
                     bool "Enable UART4"
                     default n
                     if BSP_USING_UART4
-                        config BSP_UART0_RX_USING_DMA
+                        config BSP_UART4_RX_USING_DMA
                             bool "Enable UART4 RX DMA"
                             depends on BSP_USING_UART4 && RT_SERIAL_USING_DMA
                             default n
@@ -51,11 +78,15 @@ menu "Hardware Drivers Config"
 
         menuconfig BSP_USING_HW_I2C
             bool "Enable hardware I2C BUS"
+            select RT_USING_I2C
             default n
             if BSP_USING_HW_I2C
                 config BSP_USING_HW_I2C1
                     bool "Enable Hardware I2C1 BUS"
                     default n
+                config BSP_USING_HW_I2C2
+                    bool "Enable Hardware I2C2 BUS"
+                    default n
             endif
 
         menuconfig BSP_USING_SOFT_I2C
@@ -430,6 +461,93 @@ menu "Hardware Drivers Config"
                     endif
             endif
 
+        menuconfig BSP_USING_ADC
+            bool "Enable ADC"
+            default n
+            select RT_USING_ADC
+            if BSP_USING_ADC
+                config BSP_USING_ADC0
+                    bool "Enable ADC0"
+                    default n
+
+                config BSP_USING_ADC1
+                    bool "Enable ADC1"
+                    default n
+            endif
+
+        menuconfig BSP_USING_DAC
+            bool "Enable DAC"
+            default n
+            select RT_USING_DAC
+            if BSP_USING_DAC
+                config BSP_USING_DAC0
+                    bool "Enable DAC0"
+                    default n
+
+                config BSP_USING_DAC1
+                    bool "Enable DAC1"
+                    default n
+            endif
+
+        menuconfig BSP_USING_PWM
+            bool "Enable PWM"
+            default n
+            select RT_USING_PWM
+            if BSP_USING_PWM
+                config BSP_USING_PWM0
+                    bool "Enable GPT0 (32-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM1
+                    bool "Enable GPT1 (32-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM2
+                    bool "Enable GPT2 (32-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM3
+                    bool "Enable GPT3 (32-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM4
+                    bool "Enable GPT4 (16-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM5
+                    bool "Enable GPT5 (16-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM6
+                    bool "Enable GPT6 (16-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM7
+                    bool "Enable GPT7 (16-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM8
+                    bool "Enable GPT8 (16-Bits) output PWM"
+                    default n
+
+                config BSP_USING_PWM9
+                    bool "Enable GPT9 (16-Bits) output PWM"
+                    default n
+            endif
+
+        menuconfig BSP_USING_SPI
+            bool "Enable SPI BUS"
+            default n
+            select RT_USING_SPI
+            if BSP_USING_SPI 
+                config BSP_USING_SPI0
+                    bool "Enable SPI0 BUS"
+                    default n
+                config BSP_USING_SPI1
+                    bool "Enable SPI1 BUS"
+                    default n
+            endif
+
     endmenu
 
     menu "Board extended module Drivers"

+ 1 - 1
bsp/renesas/ebf_qi_min_6m5/template.uvprojx

@@ -335,7 +335,7 @@
             <v6WtE>0</v6WtE>
             <v6Rtti>0</v6Rtti>
             <VariousControls>
-              <MiscControls>-Wno-license-management -Wunused -Wuninitialized -Wall -Wextra -Wmissing-declarations -Wconversion -Wpointer-arith -Wshadow -Waggregate-return -Wfloat-equal</MiscControls>
+              <MiscControls>-Wno-license-management -Wunused -Wuninitialized -Wall -Wmissing-declarations -Wpointer-arith -Waggregate-return -Wfloat-equal</MiscControls>
               <Define></Define>
               <Undefine></Undefine>
               <IncludePath></IncludePath>

+ 3 - 0
bsp/renesas/libraries/HAL_Drivers/drv_i2c.c

@@ -45,6 +45,9 @@ static struct ra_i2c_handle ra_i2cs[] =
 #ifdef BSP_USING_HW_I2C1
     {.bus_name = "i2c1", .i2c_cfg = &g_i2c_master1_cfg, .i2c_ctrl = &g_i2c_master1_ctrl,},
 #endif
+#ifdef BSP_USING_HW_I2C2
+    {.bus_name = "i2c2", .i2c_cfg = &g_i2c_master2_cfg, .i2c_ctrl = &g_i2c_master2_ctrl,},
+#endif
 };
 
 void i2c_master_callback(i2c_master_callback_args_t *p_args)