Skip to content

Commit b71a168

Browse files
authored
[bsp/n32]上传Nsing LCDC和SDRAM的驱动#11682
1 parent 46fdeef commit b71a168

30 files changed

Lines changed: 5542 additions & 811 deletions

bsp/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -317,23 +317,23 @@ This document is based on the RT-Thread mainline repository and categorizes the
317317

318318
#### 🟡 N32
319319

320-
| BSP Name | GPIO | UART | ADC | CAN | DAC | HWTimer | I2C | RTC | SPI | WDT | PWM |ENCODER | LPTIM | NAND | ETH | ON-Chip FLASH |
321-
|----------|------|------|-----|-----|-----|---------|-----|-----|-----|-----|
322-
| [n32g43xcl-stb](n32/n32gxx_lxx/n32g43xcl-stb) ||||||||||| - | - | - | - | - | - |
323-
| [n32g457gel-stb](n32/n32gxx_lxx/n32g457gel-stb) ||||||||||| - | - | - | - | - | - |
324-
| [n32g45xcl-stb](n32/n32gxx_lxx/n32g45xcl-stb) ||||||||||| - | - | - | - | - | - |
325-
| [n32g45xml-stb](n32/n32gxx_lxx/n32g45xml-stb) ||||||||||| - | - | - | - | - | - |
326-
| [n32g45xrl-stb](n32/n32gxx_lxx/n32g45xrl-stb) ||||||||||| - | - | - | - | - | - |
327-
| [n32g45xvl-stb](n32/n32gxx_lxx/n32g45xvl-stb) ||||||||||| - | - | - | - | - | - |
328-
| [n32g47rml-stb](n32/n32gxx_lxx/n32g47rml-stb) ||||||||||| - | - | - | - | - | - |
329-
| [n32l40xcl-stb](n32/n32gxx_lxx/n32l40xcl-stb) ||||||||||| - | - | - | - | - | - |
330-
| [n32l436-evb](n32/n32gxx_lxx/n32l436-evb) ||||||||||| - | - | - | - | - | - |
331-
| [n32l43xml-stb](n32/n32gxx_lxx/n32l43xml-stb) ||||||||||| - | - | - | - | - | - |
332-
| [n32l43xrl-stb](n32/n32gxx_lxx/n32l43xrl-stb) ||||||||||| - | - | - | - | - | - |
333-
| [n32wb45xl-evb](n32/n32gxx_lxx/n32wb45xl-evb) ||||||||||| - | - | - | - | - | - |
334-
| [n32h760zil7-stb](n32/n32hxxx/n32h760zil7-stb) |||||||||||||||||
335-
| [n32h497zgl7-evb](n32/n32hxxx/n32h497zgl7-evb) ||| - | - | - | - | - | - | - | - | - | - | - | - | - | - |
336-
| [n32h487zgl7-evb](n32/n32hxxx/n32h487zgl7-evb) ||| - | - | - | - | - | - | - | - | - | - | - | - | - | - |
320+
| BSP Name | GPIO | UART | ADC | CAN | DAC | HWTimer | I2C | RTC | SPI | WDT | PWM |ENCODER | LPTIM | NAND | ETH | ON-Chip FLASH | SDRAM | LCDC | QSPI |
321+
|----------|------|------|-----|-----|-----|---------|-----|-----|-----|-----|-----|---------|-------|------|-----|--------------|-------|------|-----|
322+
| [n32g43xcl-stb](n32/n32gxx_lxx/n32g43xcl-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
323+
| [n32g457gel-stb](n32/n32gxx_lxx/n32g457gel-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
324+
| [n32g45xcl-stb](n32/n32gxx_lxx/n32g45xcl-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
325+
| [n32g45xml-stb](n32/n32gxx_lxx/n32g45xml-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
326+
| [n32g45xrl-stb](n32/n32gxx_lxx/n32g45xrl-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
327+
| [n32g45xvl-stb](n32/n32gxx_lxx/n32g45xvl-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
328+
| [n32g47rml-stb](n32/n32gxx_lxx/n32g47rml-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
329+
| [n32l40xcl-stb](n32/n32gxx_lxx/n32l40xcl-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
330+
| [n32l436-evb](n32/n32gxx_lxx/n32l436-evb) ||||||||||| - | - | - | - | - | - | - | - | - |
331+
| [n32l43xml-stb](n32/n32gxx_lxx/n32l43xml-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
332+
| [n32l43xrl-stb](n32/n32gxx_lxx/n32l43xrl-stb) ||||||||||| - | - | - | - | - | - | - | - | - |
333+
| [n32wb45xl-evb](n32/n32gxx_lxx/n32wb45xl-evb) ||||||||||| - | - | - | - | - | - | - | - | - |
334+
| [n32h760zil7-stb](n32/n32hxxx/n32h760zil7-stb) ||||||||||||||||||||
335+
| [n32h497zgl7-evb](n32/n32hxxx/n32h497zgl7-evb) ||| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
336+
| [n32h487zgl7-evb](n32/n32hxxx/n32h487zgl7-evb) ||| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
337337

338338

339339
#### 🟡 NRF5x

bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_dac.c

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
typedef struct
2626
{
27-
DACX DACx;
27+
DACX DACx;
2828
DAC_Module *DAC_Module;
29-
uint32_t periph_clk;
30-
void (*EnablePeriphClk)(uint32_t periph, FunctionalState cmd);
31-
uint32_t DAC_clk_pres;
29+
uint32_t periph_clk;
30+
void (*EnablePeriphClk)(uint32_t periph, FunctionalState cmd);
31+
uint32_t DAC_clk_pres;
3232

3333
GPIO_Module *GPIOx;
34-
uint16_t GPIO_Pin;
35-
uint32_t GPIO_RCC;
34+
uint16_t GPIO_Pin;
35+
uint32_t GPIO_RCC;
3636

3737
DAC_InitType Init;
3838
} DAC_InitInfo_t;
@@ -52,7 +52,7 @@ static struct n32_dac n32_dac_obj[sizeof(dac_config) / sizeof(dac_config[0])];
5252

5353
struct n32_dac
5454
{
55-
DAC_InitInfo_t DAC_Info;
55+
DAC_InitInfo_t DAC_Info;
5656
struct rt_dac_device n32_dac_device;
5757
};
5858

@@ -92,7 +92,7 @@ static rt_uint8_t n32_dac_get_resolution(struct rt_dac_device *device)
9292

9393
static rt_err_t n32_set_dac_value(struct rt_dac_device *device, rt_uint32_t channel, rt_uint32_t *value)
9494
{
95-
rt_uint16_t set_value;
95+
rt_uint16_t set_value;
9696
DAC_InitInfo_t *n32_dac_info;
9797

9898
RT_ASSERT(device != RT_NULL);
@@ -116,17 +116,17 @@ static rt_err_t n32_set_dac_value(struct rt_dac_device *device, rt_uint32_t chan
116116
}
117117

118118
static const struct rt_dac_ops n32_dac_ops = {
119-
.disabled = n32_dac_disabled,
120-
.enabled = n32_dac_enabled,
121-
.convert = n32_set_dac_value,
119+
.disabled = n32_dac_disabled,
120+
.enabled = n32_dac_enabled,
121+
.convert = n32_set_dac_value,
122122
.get_resolution = n32_dac_get_resolution,
123123
};
124124

125125
static int n32_dac_init(void)
126126
{
127-
int result = RT_EOK;
127+
int result = RT_EOK;
128128
char name_buf[5] = { 'd', 'a', 'c', '0', 0 };
129-
int i = 0;
129+
int i = 0;
130130

131131
for (i = 0; i < sizeof(dac_config) / sizeof(dac_config[0]); i++)
132132
{
@@ -135,9 +135,13 @@ static int n32_dac_init(void)
135135
/* Set device name */
136136
name_buf[3] = '0';
137137
if (n32_dac_obj[i].DAC_Info.DACx == DAC1)
138+
{
138139
name_buf[3] = '1';
140+
}
139141
else if (n32_dac_obj[i].DAC_Info.DACx == DAC2)
142+
{
140143
name_buf[3] = '2';
144+
}
141145

142146
/* Enable DAC peripheral clock */
143147
n32_dac_obj[i].DAC_Info.EnablePeriphClk(n32_dac_obj[i].DAC_Info.periph_clk, ENABLE);

0 commit comments

Comments
 (0)