12#ifndef __HIERODULE_SPI_H
13#define __HIERODULE_SPI_H
91 void (*TC_Handler)(void);
HIERODULE_SPI_Wrapper ** HIERODULE_SPI_InitWrapper(SPI_TypeDef *_SPI, uint8_t Mode, uint16_t RX_BufferSize, void(*TC_Handler)(void))
Initializes a wrapper for the specified SPI peripheral.
uint8_t HIERODULE_SPI_GetNextByte(HIERODULE_SPI_Wrapper *Wrapper)
Fetches the next byte in the RX ring buffer.
void HIERODULE_SPI_TransmitByte(HIERODULE_SPI_Wrapper *Wrapper, uint8_t Byte)
Writes a byte into the data register of the SPI peripheral.
void HIERODULE_SPI_TransmitPackage(HIERODULE_SPI_Wrapper *Wrapper, uint8_t *TX_Buffer, uint32_t Size)
Starts a transmission as the master.
void HIERODULE_SPI_ReleaseWrapper(HIERODULE_SPI_Wrapper *Wrapper)
Frees the memory allocated to an SPI wrapper.
HIERODULE_USB_Wrapper Wrapper
Extern declaration for the wrapper instance in the source file.
Struct that keeps variables for the data buffers, a pointer to the SPI peripheral,...
uint8_t * RX_Buffer
The ring buffer where the data received is appended.
uint32_t TX_Counter
Used to continue transmission until buffer size is received.
uint32_t RX_New
Number of new bytes in the ring buffer. .
uint16_t RX_BufferSize
Number of elements in the ring buffer. .
uint8_t * TX_Buffer
Buffer that keeps data to be transmitted.
SPI_TypeDef * _SPI
Pointer to the SPI peripheral.
uint8_t Mode
Master/Slave mode. 0 if Slave, 1 if Master.
uint32_t TX_BufferSize
Number of bytes to be transmitted in the buffer.
uint32_t RX_Index
Index of next-byte-to-be-received in the ring buffer. .