dc31-addon-addon-badge-firm.../bootloader_hk32f030m_uart_x.../code/inc/usart.h

33 lines
570 B
C
Raw Normal View History

/*
* usart.h
*
* Created on: Jun 23, 2023
* Author: true
*/
#ifndef CODE_INC_USART_H_
#define CODE_INC_USART_H_
#define COMM_TIMEOUT 512000;
/* Status report for the functions. */
typedef enum {
COMM_OK = 0x00, // success
COMM_RX_TIMEOUT = 0xe1, // data did not arrive in time
COMM_ERROR = 0xff // all other errors
} BL_comm_status;
void comm_init();
BL_comm_status comm_rx(uint8_t *data, uint16_t length);
BL_comm_status comm_tx_str(uint8_t *data);
BL_comm_status comm_tx_byte(uint8_t data);
#endif /* CODE_INC_USART_H_ */