generated from hulk/gd32e23x_template
RS485
This commit is contained in:
parent
7a91986b9b
commit
e8f0161e32
@ -9,6 +9,8 @@
|
||||
|
||||
// #define DEBUG_VERBOES
|
||||
|
||||
#define RS485_MAX13487
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define RCU_GPIO_I2C RCU_GPIOF
|
||||
|
@ -8,6 +8,7 @@ uint8_t package_header[3] = {0xB5, 0xF0, 0x04};
|
||||
uint8_t package_data[4] = {0};
|
||||
|
||||
void rs485_config(void) {
|
||||
#ifdef RS485_MAX13487
|
||||
rcu_periph_clock_enable(RS485_GPIO_RCU);
|
||||
rcu_periph_clock_enable(RS485_RCU);
|
||||
|
||||
@ -43,6 +44,10 @@ void rs485_config(void) {
|
||||
nvic_irq_enable(USART0_IRQn, 0);
|
||||
usart_interrupt_enable(RS485_PHY, USART_INT_RBNE);
|
||||
usart_interrupt_enable(RS485_PHY, USART_INT_IDLE);
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void process_command(uint8_t *cmd, size_t length) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user