generated from hulk/gd32e23x_template
在board_config.h文件中添加#define SOFTWARE_IIC选项用以选择使用软件IIC还是硬件IIC,如果注释掉该行则为硬件IIC方式。并完整实现软件IIC功能。
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#ifndef BOARD_CONFIG_H
|
||||
#define BOARD_CONFIG_H
|
||||
|
||||
#define SOFTWARE_IIC
|
||||
|
||||
// #define DEBUG_VERBOES
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define I2C_SPEED 20000
|
||||
@@ -18,4 +22,15 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define RS485_RCU RCU_USART0
|
||||
#define RS485_GPIO_RCU RCU_GPIOA
|
||||
#define RS485_GPIO_PORT GPIOA
|
||||
#define RS485_TX_PIN GPIO_PIN_2
|
||||
#define RS485_RX_PIN GPIO_PIN_3
|
||||
#define RS485_PHY USART0
|
||||
#define RS485_BAUDRATE 115200U
|
||||
#define RS485_EN_PIN GPIO_PIN_1
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#endif //BOARD_CONFIG_H
|
||||
|
Reference in New Issue
Block a user