generated from hulk/gd32e23x_template_cmake_vscode
70 lines
2.1 KiB
C
70 lines
2.1 KiB
C
#ifndef BOARD_CONFIG_H
|
|
#define BOARD_CONFIG_H
|
|
|
|
#include <stdint.h>
|
|
|
|
/* >>>>>>>>>>>>>>>>>>>>[IIC TYPE DEFINE]<<<<<<<<<<<<<<<<<<<< */
|
|
|
|
// #define SOFTWARE_IIC // IIC Type : Software IIC
|
|
#undef SOFTWARE_IIC // IIC Type : Hardware IIC
|
|
|
|
/* >>>>>>>>>>>>>>>>>>>>[DEBUG ASSERTIONS DEFINE]<<<<<<<<<<<<<<<<<<<< */
|
|
|
|
// #define DEBUG_VERBOSE // Debug Assertions Status : Debug Verbose Information
|
|
#undef DEBUG_VERBOSE // Debug Assertions Status : No Debug Verbose Information
|
|
|
|
/* >>>>>>>>>>>>>>>>>>>>[EDDY DRIVE CURRENT DETECTION]<<<<<<<<<<<<<<<<<<<< */
|
|
|
|
// #define EDDY_DRIVE_CURRENT_DETECTION // Eddy Drive Current Detection : Enable
|
|
#undef EDDY_DRIVE_CURRENT_DETECTION // Eddy Drive Current Detection : Disable
|
|
|
|
/* >>>>>>>>>>>>>>>>>>>[BOARD TYPE CONFIG]<<<<<<<<<<<<<<<<<<<< */
|
|
|
|
#define ULTRASONIC_BOARD
|
|
// #define EDDY_BOARD
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
#define RCU_GPIO_I2C RCU_GPIOF
|
|
#define RCU_I2C RCU_I2C0
|
|
#define I2C_SCL_PORT GPIOF
|
|
#define I2C_SCL_PIN GPIO_PIN_1
|
|
#define I2C_SDA_PORT GPIOF
|
|
#define I2C_SDA_PIN GPIO_PIN_0
|
|
#define I2C_GPIO_AF GPIO_AF_1
|
|
|
|
#define I2C_DEBUG_UART USART0
|
|
|
|
/******************************************************************************/
|
|
|
|
#ifdef ULTRASONIC_BOARD
|
|
|
|
#define LED_RCU RCU_GPIOA
|
|
#define LED_PORT GPIOA
|
|
#define LED_PIN GPIO_PIN_9
|
|
|
|
#elif EDDY_BOARD
|
|
#define LED_RCU RCU_GPIOA
|
|
#define LED_PORT GPIOA
|
|
#define LED_PIN GPIO_PIN_7
|
|
|
|
#endif
|
|
|
|
/******************************************************************************/
|
|
|
|
/* GD32E230F8 Fixed Configuration */
|
|
#define RS485_RCU RCU_USART1
|
|
#define RS485_PHY USART1
|
|
#define RS485_IRQ USART1_IRQn
|
|
#define RS485_GPIO_RCU RCU_GPIOA
|
|
#define RS485_GPIO_PORT GPIOA
|
|
#define RS485_EN_PIN GPIO_PIN_1
|
|
#define RS485_TX_PIN GPIO_PIN_2
|
|
#define RS485_RX_PIN GPIO_PIN_3
|
|
#define RS485_BAUDRATE 115200U
|
|
|
|
/******************************************************************************/
|
|
|
|
#endif //BOARD_CONFIG_H
|