12#ifndef __HIERODULE_USART_H
13#define __HIERODULE_USART_H
74 void (*RX_Handler)(uint8_t);
85 uint16_t RX_BufferSize,
86 void (*RX_Handler)(uint8_t)
uint32_t HIERODULE_USART_IsActiveFlag_TXE(HIERODULE_USART_Wrapper *Wrapper)
Checks the TX is empty interrupt flag of the USART peripheral.
uint32_t HIERODULE_USART_IsActiveFlag_RXNE(HIERODULE_USART_Wrapper *Wrapper)
Checks the RX not empty interrupt flag of the USART peripheral.
void HIERODULE_USART_TransmitByte(HIERODULE_USART_Wrapper *Wrapper, uint8_t Byte)
Transmits a single byte.
void HIERODULE_USART_ReleaseWrapper(HIERODULE_USART_Wrapper *Wrapper)
Frees the memory allocated to a USART wrapper and clears USART status flags and control bits.
uint8_t HIERODULE_USART_GetNextByte(HIERODULE_USART_Wrapper *Wrapper)
Fetches the next byte in the ring buffer.
void HIERODULE_USART_TransmitString(HIERODULE_USART_Wrapper *Wrapper, char *String)
Transmits a string.
void HIERODULE_USART_Disable_IT_RXNE(HIERODULE_USART_Wrapper *Wrapper)
Disables the RX not empty interrupt of the USART peripheral , also disables the RE bit of the control...
void HIERODULE_USART_Enable_IT_RXNE(HIERODULE_USART_Wrapper *Wrapper)
Enables the RX not empty interrupt of the USART peripheral , also enables the RE bit of the control r...
HIERODULE_USART_Wrapper ** HIERODULE_USART_InitWrapper(USART_TypeDef *USART, uint16_t RX_BufferSize, void(*RX_Handler)(uint8_t))
Initializes a wrapper for the specified USART peripheral.
HIERODULE_USB_Wrapper Wrapper
Extern declaration for the wrapper instance in the source file.
Struct that keeps variables for the ring buffer, a pointer to the USART peripheral and a pointer to t...
uint8_t * RX_Buffer
The ring buffer.
uint32_t RX_New
Number of new bytes in the ring buffer.
uint16_t RX_BufferSize
Number of elements in the ring buffer.
USART_TypeDef * USART
Pointer to the USART peripheral.
uint32_t RX_Index
Index of next-byte-to-be-received in the ring buffer.