[arduino] add comment (#6016)

This commit is contained in:
Man, Jianting (Meco) 2022-06-04 01:20:30 -04:00 committed by GitHub
parent 1fb3f1fcec
commit 02b176f8cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 13 deletions

View File

@ -46,6 +46,10 @@ const pin_map_t pin_map_table[]=
{D23, GET_PIN(E,9), "pwm1", 1}, /* PWM, BSP: BLUE-LED */ {D23, GET_PIN(E,9), "pwm1", 1}, /* PWM, BSP: BLUE-LED */
{D24, GET_PIN(B,0)}, /* INFRARED EMISSION */ {D24, GET_PIN(B,0)}, /* INFRARED EMISSION */
{D25, GET_PIN(B,1)}, /* INFRARED RECEPTION */ {D25, GET_PIN(B,1)}, /* INFRARED RECEPTION */
{D26, GET_PIN(D,7)}, /* LCD CS */
{D27, GET_PIN(B,6)}, /* LCD RESET */
{D28, GET_PIN(B,4)}, /* LCD DC (data or command) */
{D29, GET_PIN(B,7)}, /* LCD POWER */
{A0, GET_PIN(C,2), "adc1", 3}, /* ADC */ {A0, GET_PIN(C,2), "adc1", 3}, /* ADC */
{A1, GET_PIN(C,4), "adc1", 13}, /* ADC */ {A1, GET_PIN(C,4), "adc1", 13}, /* ADC */
{A2, RT_NULL, "adc1", 0}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */ {A2, RT_NULL, "adc1", 0}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */

View File

@ -38,22 +38,32 @@
#define D23 (23) #define D23 (23)
#define D24 (24) #define D24 (24)
#define D25 (25) #define D25 (25)
#define A0 (26) #define D26 (26)
#define A1 (27) #define D27 (27)
#define A2 (28) #define D28 (28)
#define A3 (29) #define D29 (29)
#define DAC0 (30) #define A0 (30)
#define A1 (31)
#define A2 (32)
#define A3 (33)
#define DAC0 (34)
#define F_CPU 80000000L /* CPU: 80MHz */ #define F_CPU 80000000L /* CPU: 80MHz */
#define LED_BUILTIN D22 /* Default Built-in LED */ #define LED_BUILTIN D22 /* Default Built-in LED */
/* /*
* i2c1 - PC7-SDA PC6-SCL(User I2C) * i2c1 - PC7-SDA PC6-SCL (User I2C)
* i2c3 - ICM20608, AP3216C (On Board) * i2c3 - ICM20608, AP3216C (On Board)
* i2c4 - AHT10 (On Board) * i2c4 - AHT10 (On Board)
*/ */
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c4" #define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c4"
/*
* spi2 - Wireless Interface (User SPI)
* spi3 - LCD ST7789
*/
#define RTDUINO_DEFAULT_SPI_BUS_NAME "spi2" #define RTDUINO_DEFAULT_SPI_BUS_NAME "spi2"
#define RTDUINO_DEFAULT_HWTIMER_DEVICE_NAME "timer7" #define RTDUINO_DEFAULT_HWTIMER_DEVICE_NAME "timer7"
#define RTDUINO_SERIAL2_DEVICE_NAME "uart2" #define RTDUINO_SERIAL2_DEVICE_NAME "uart2"

View File

@ -39,18 +39,21 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_ADC select BSP_USING_ADC
select BSP_USING_ADC1 select BSP_USING_ADC1
select BSP_USING_I2C select BSP_USING_I2C
select BSP_USING_I2C1 select BSP_USING_I2C1 # PC7-SDA PC6-SCL (User I2C)
select BSP_USING_I2C3 select BSP_USING_I2C3 # ICM20608, AP3216C (On Board)
select BSP_USING_I2C4 select BSP_USING_I2C4 # AHT10 (On Board)
select BSP_USING_DAC select BSP_USING_DAC
select BSP_USING_DAC1 select BSP_USING_DAC1
select BSP_USING_SPI select BSP_USING_SPI
select BSP_USING_SPI2 select BSP_USING_SPI2 # Wireless Interface (User SPI)
imply BSP_SPI2_TX_USING_DMA imply BSP_SPI2_TX_USING_DMA
imply BSP_SPI2_RX_USING_DMA imply BSP_SPI2_RX_USING_DMA
select BSP_USING_SPI3 # LCD ST7789
select BSP_SPI3_TX_USING_DMA
imply RTDUINO_USING_SERVO imply RTDUINO_USING_SERVO
imply RTDUINO_USING_WIRE imply RTDUINO_USING_WIRE
imply RTDUINO_USING_SPI imply RTDUINO_USING_SPI
imply RTDUINO_USING_USBSERIAL
imply RTDUINO_USING_ADAFRUIT imply RTDUINO_USING_ADAFRUIT
imply RTDUINO_USING_MSTIMER2 imply RTDUINO_USING_MSTIMER2
default n default n

View File

@ -40,7 +40,7 @@ static int rt_hw_lcd_config(void)
/* config spi */ /* config spi */
{ {
struct rt_spi_configuration cfg; struct rt_spi_configuration cfg = {0};
cfg.data_width = 8; cfg.data_width = 8;
cfg.mode = RT_SPI_MASTER | RT_SPI_MODE_0 | RT_SPI_MSB; cfg.mode = RT_SPI_MASTER | RT_SPI_MODE_0 | RT_SPI_MSB;
cfg.max_hz = 42 * 1000 * 1000; /* 42M,SPI max 42MHz,lcd 4-wire spi */ cfg.max_hz = 42 * 1000 * 1000; /* 42M,SPI max 42MHz,lcd 4-wire spi */

View File

@ -20,7 +20,7 @@ struct rt_adc_ops
rt_err_t (*enabled)(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled); rt_err_t (*enabled)(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled);
rt_err_t (*convert)(struct rt_adc_device *device, rt_uint32_t channel, rt_uint32_t *value); rt_err_t (*convert)(struct rt_adc_device *device, rt_uint32_t channel, rt_uint32_t *value);
rt_uint8_t (*get_resolution)(struct rt_adc_device *device); rt_uint8_t (*get_resolution)(struct rt_adc_device *device);
rt_int16_t (*get_vref) (const struct rt_adc_device *device); rt_int16_t (*get_vref) (struct rt_adc_device *device);
}; };
struct rt_adc_device struct rt_adc_device

View File

@ -23,7 +23,7 @@
struct rt_pwm_configuration struct rt_pwm_configuration
{ {
rt_uint32_t channel; /* 0-n */ rt_uint32_t channel; /* 1-n or 0-n, which depends on specific MCU requirements */
rt_uint32_t period; /* unit:ns 1ns~4.29s:1Ghz~0.23hz */ rt_uint32_t period; /* unit:ns 1ns~4.29s:1Ghz~0.23hz */
rt_uint32_t pulse; /* unit:ns (pulse<=period) */ rt_uint32_t pulse; /* unit:ns (pulse<=period) */