26#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_HART_UART_H_
27#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_HART_UART_H_
41#include "mxc_assert.h"
44#define NORMAL_HART_TRANSCEIVE_MODE 0
45#define HART_TEST_MODE_TX_1200 1
46#define HART_TEST_MODE_TX_2200 2
47#define HART_TEST_MODE_EXTERNAL 3
51#define TPDLL_COMM_ERROR_INDICATOR 0x80
52#define TPDLL_VERTICAL_PARITY_ERROR 0x40
53#define TPDLL_OVERRUN_ERROR 0x20
54#define TPDLL_FRAMING_ERROR 0x10
55#define TPDLL_BUFFER_OVERFLOW_ERROR 0x02
58#define HART_STATE_IDLE 0
59#define HART_STATE_TRANSMIT 1
60#define HART_STATE_RECEIVE_ACTIVE 2
64#define UART_FLAG_BUFFER_OVERFLOW_ERROR 0x80
67typedef void (*reset_confirm_callback_t)(void);
70typedef void (*enable_confirm_callback_t)(uint32_t);
73typedef void (*enable_indicate_callback_t)(uint32_t);
76typedef void (*data_confirm_callback_t)(uint8_t);
79typedef void (*data_indicate_callback_t)(uint8_t);
82typedef void (*error_indicate_callback_t)(uint8_t, uint8_t);
91 error_indicate_callback_t
105int hart_uart_setup(uint32_t test_mode);
119int hart_uart_enable(
void);
126int hart_uart_disable(
void);
131void hart_uart_test_transmit_1200(
void);
136void hart_uart_test_transmit_2200(
void);
147int hart_uart_send(uint8_t *data, uint32_t length);
156int hart_uart_check_transmit_complete(
void);
167int hart_uart_get_received_packet(uint8_t *buffer, uint32_t *packet_length, uint32_t *comm_errors);
176void hart_uart_handler(
void);
182void hart_rts_receive_mode(
void);
188void hart_rts_transmit_mode(
void);
194int hart_clock_enable(
void);
200void hart_clock_disable(
void);
206void hart_sap_reset_request(
void);
214int hart_sap_data_request(uint8_t data);
221void hart_sap_enable_request(uint32_t state);
Registers, Bit Masks and Bit Positions for the AFE_ADC_ONE Peripheral Module.
Registers, Bit Masks and Bit Positions for the AFE_ADC_ZERO Peripheral Module.
Registers, Bit Masks and Bit Positions for the AFE_DAC Peripheral Module.
Registers, Bit Masks and Bit Positions for the AFE_HART Peripheral Module.
Definition: hart_uart.h:85
error_indicate_callback_t error_indicate_cb
Definition: hart_uart.h:92
data_indicate_callback_t data_indicate_cb
Definition: hart_uart.h:90
data_confirm_callback_t data_confirm_cb
Definition: hart_uart.h:89
enable_indicate_callback_t enable_indicate_cb
Definition: hart_uart.h:88
enable_confirm_callback_t enable_confirm_cb
Definition: hart_uart.h:87
reset_confirm_callback_t reset_confirm_cb
Definition: hart_uart.h:86