1、问题
父类有1方法:Enable_RS485,如下所示:
class CUart
{
public:
uint8_t u8_UartNumber; //端口号1-8
uint32_t u32_BaudRate; //波特率
uint8_t u8_Parity; //效验位
CC0 C0; //485控制引脚C0
CC1 C1; //485控制引脚C1
UART_HandleTypeDef hUART;
uint8_t u8_UartReceiveBuffer[1];
public:
CUart(uint8_t u8_UartNumber, uint32_t u32_BaudRate, uint8_t u8_Parity);
void Init(uint8_t u8_UartNumber, uint32_t u32_BaudRate, uint8_t u8_Parity);
void Enable_RS485(GPIO_TypeDef* C0_Port, uint16_t C0_Pin, GPIO_TypeDef* C1_Port, uint16_t C1_Pin);
void SendDataPrimitive(uint8_t* pData, uint16_t u16_Size);
void SetBaudRate(uint32_t u32_BaudRate);
void Set_RS485(uint8_t u8_Mode);
};
|