1
This commit is contained in:
parent
191f4a4877
commit
c765ad513a
2
.config
2
.config
@ -1556,7 +1556,7 @@ CONFIG_BSP_USING_FLASH_FS_AUTO_MOUNT=y
|
||||
CONFIG_BSP_USING_FAL=y
|
||||
# CONFIG_BSP_USING_BOOTLOADER is not set
|
||||
# CONFIG_BSP_USING_EASYFLASH is not set
|
||||
CONFIG_BSP_USING_RW007_WLAN=y
|
||||
# CONFIG_BSP_USING_RW007_WLAN is not set
|
||||
CONFIG_BSP_USING_AHT21=y
|
||||
# CONFIG_BSP_USING_AP3216C is not set
|
||||
# CONFIG_BSP_USING_ICM20608 is not set
|
||||
|
@ -1,5 +1,12 @@
|
||||
|
||||
|
||||
# 设备驱动
|
||||
## I/O设备框架概念
|
||||
### SPI驱动和设备驱动分离,提供统一的API:
|
||||
• 更换 MCU 只需要改变对应的对接驱动
|
||||
• 重新驱动设备,只需要重新编写设备驱动相关的代码
|
||||
• 同一 API 接口,学习成本低
|
||||
• 分离后设备驱动可以入库,供公司其他项目使用,减少碎片化开发,防止反复造轮子
|
||||
• 代码框架会变复杂,但是从上面的优点来看是值得的
|
||||
![spi驱动与设备驱动分离示意图](image-3.png)
|
||||
### I/O框架
|
||||
显示屏、串口通信、flash、SD卡、以太网接口
|
||||
图
|
||||
|
BIN
Day4/image-3.png
Normal file
BIN
Day4/image-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
@ -21,12 +21,12 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define WIFI_CS GET_PIN(F,10)
|
||||
void WIFI_CS_PULL_DOWN(void)
|
||||
{
|
||||
rt_pin_mode(WIFI_CS, PIN_MODE_OUTPUT);
|
||||
rt_pin_write(WIFI_CS, PIN_LOW);
|
||||
}
|
||||
INIT_BOARD_EXPORT(WIFI_CS_PULL_DOWN);
|
||||
// #define WIFI_CS GET_PIN(F,10)
|
||||
// void WIFI_CS_PULL_DOWN(void)
|
||||
// {
|
||||
// rt_pin_mode(WIFI_CS, PIN_MODE_OUTPUT);
|
||||
// rt_pin_write(WIFI_CS, PIN_LOW);
|
||||
// }
|
||||
// INIT_BOARD_EXPORT(WIFI_CS_PULL_DOWN);
|
||||
|
||||
|
||||
|
@ -563,7 +563,6 @@
|
||||
#define BSP_USING_FLASH_FATFS
|
||||
#define BSP_USING_FLASH_FS_AUTO_MOUNT
|
||||
#define BSP_USING_FAL
|
||||
#define BSP_USING_RW007_WLAN
|
||||
#define BSP_USING_AHT21
|
||||
/* end of Onboard Peripheral Drivers */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user