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

33 lines
567 B
C

/*
* usart.h
*
* Created on: Jun 23, 2023
* Author: true
*/
#ifndef CODE_INC_USART_H_
#define CODE_INC_USART_H_
#define COMM_TIMEOUT 0xffff;
/* 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(char *data);
BL_comm_status comm_tx_byte(uint8_t data);
#endif /* CODE_INC_USART_H_ */