generated from hulk/gd32e23x_template
代码美化
This commit is contained in:
11
inc/rs485.h
11
inc/rs485.h
@@ -14,6 +14,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#define RS485_RCU RCU_USART0
|
||||
#define RS485_GPIO_RCU RCU_GPIOA
|
||||
#define RS485_GPIO_PORT GPIOA
|
||||
@@ -21,15 +23,18 @@
|
||||
#define RS485_RX_PIN GPIO_PIN_3
|
||||
#define RS485_PHY USART0
|
||||
#define RS485_BAUDRATE 115200U
|
||||
|
||||
#define RS485_EN_PIN GPIO_PIN_1
|
||||
|
||||
#define RX_BUFFER_SIZE 32
|
||||
/******************************************************************************/
|
||||
|
||||
#define RX_BUFFER_SIZE 32
|
||||
|
||||
#define LDC1612_PACKAGE_HEADER 0xD5
|
||||
#define LDC1612_BOARD_TYPE 0x03
|
||||
#define LDC1612_PACKAGE_LENGTH 0x02
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VALIDATION_SUCCESS = 0,
|
||||
@@ -39,6 +44,8 @@ typedef enum
|
||||
VALIDATION_LENGTH_ERROR = 8
|
||||
} validation_result_t;
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
void rs485_config(void);
|
||||
void process_command(uint8_t* cmd, size_t length);
|
||||
uint8_t calculate_crc(uint8_t data[], uint8_t data_length);
|
||||
|
Reference in New Issue
Block a user