![]() |
MKMxxZxxACxx5 Bare Metal Software Drivers
R4.1.6
Reference Manual
|
This section describes functions and macros of the driver's API.
Macros | |
#define | SPI_Enable(module) |
Enables SPI module. This macro enables the SPI module and dedicates the SPI port pins to SPI system functions. More... | |
#define | SPI_Disable(module) |
Disables SPI module. This macro disables the SPI module. After calling this macro, the selected SPI module is disabled and forced into an idle state, and all status bits in the status register are reset. More... | |
#define | SPI_TxIsrDisable(module) |
Disables transmit interrupt request. More... | |
#define | SPI_TxIsrEnable(module) |
Enables transmit interrupt request. More... | |
#define | SPI_GetByte(module) |
Returns 8-bit data from the SPI receive buffer. More... | |
#define | SPI_GetWord(module) |
Returns 16-bit data from the SPI receive buffer. More... | |
#define | SPI_PutByte(module, c) |
Writes 8-bit data to the SPI transmit buffer. More... | |
#define | SPI_PutWord(module, c) |
Writes 16-bit data to the SPI transmit buffer. More... | |
#define | SPI_RxFull(module) |
Returns SPI receiver state. More... | |
#define | SPI_TxCmpl(module) |
Returns SPI transmitter state. More... | |
#define | SPI_TxFifoFull(module) |
Returns SPI transmit FIFO state. More... | |
#define | SPI_RxFifoEmpty(module) |
Returns SPI receive FIFO state. More... | |
#define | SPI_TxRxWord(module, data) |
Transmit and receives one word. More... | |
#define | SPI_TxRxByte(module, data) |
Transmit and receives one byte. More... | |
#define | SPI_CommWord(module, txd, txcnt, rxd, rxcnt) |
Transmits and receives whole data packet (16-bit length). More... | |
#define | SPI_CommByte(module, txd, txcnt, rxd, rxcnt) |
Transmits and receives whole data packet (8-bit length). More... | |
#define | SPI_PutWordToFifo(module, txd, txcnt) |
Writes data packet to the SPI transmit FIFO (16-bit length) More... | |
#define | SPI_PutByteToFifo(module, txd, txcnt) |
Writes data packet to the SPI transmit FIFO (8-bit length) More... | |
#define | SPI_GetWordFromFifo(module, rxd, rxcnt) |
Saves 16-bit data packet from the SPI receive FIFO. More... | |
#define | SPI_GetByteFromFifo(module, rxd, rxcnt) |
Saves 8-bit data packet from the SPI receive FIFO. More... | |
#define | SPI_Init(module, cfg, call2, ip, call1) |
SPI initialization. More... | |
#define SPI_Enable | ( | module | ) |
#define SPI_Disable | ( | module | ) |
#define SPI_TxIsrDisable | ( | module | ) |
This macro disables transmit interrupt request for specified module.
module | SPI0,SPI1. |
#define SPI_TxIsrEnable | ( | module | ) |
This macro enables transmit interrupt request for specified module.
module | SPI0,SPI1. |
#define SPI_GetByte | ( | module | ) |
This macro returns 8-bit data from the specified module.
module | SPI0,SPI1. |
#define SPI_GetWord | ( | module | ) |
This macro returns 16-bit data from the specified module.
module | SPI0,SPI1. |
#define SPI_PutByte | ( | module, | |
c | |||
) |
This macro writes 8-bit data to the specified module.
module | SPI0,SPI1. |
c | Data to be sent (8-bit). |
#define SPI_PutWord | ( | module, | |
c | |||
) |
This macro writes 16-bit data to the specified module.
module | SPI0,SPI1. |
c | Data to be sent (16-bit). |
#define SPI_RxFull | ( | module | ) |
This macro returns receiver state for the specified module.
module | SPI0,SPI1. |
#define SPI_TxCmpl | ( | module | ) |
This macro returns transmitter state for the specified module.
module | SPI0,SPI1. |
#define SPI_TxFifoFull | ( | module | ) |
This macro returns transmit FIFO state for the specified module.
module | SPI1. |
#define SPI_RxFifoEmpty | ( | module | ) |
This macro returns receive FIFO state for the specified module.
module | SPI1. |
#define SPI_TxRxWord | ( | module, | |
data | |||
) |
This macro transmits and receives one word.
module | SPI0,SPI1. |
data | Data for transferring. |
#define SPI_TxRxByte | ( | module, | |
data | |||
) |
This macro transmits and receives one byte.
module | SPI0,SPI1. |
data | Data for transferring. |
#define SPI_CommWord | ( | module, | |
txd, | |||
txcnt, | |||
rxd, | |||
rxcnt | |||
) |
This macro transmits and receives whole data packet.
module | SPI0,SPI1. |
txd | Pointer to buffer where writing data is stored. |
txcnt | Number of words for writing. |
rxd | Pointer to buffer where reading data will be saved. |
rxcnt | Number of words for reading. |
#define SPI_CommByte | ( | module, | |
txd, | |||
txcnt, | |||
rxd, | |||
rxcnt | |||
) |
This macro transmits and receives whole data packet.
module | SPI0,SPI1. |
txd | Pointer to buffer where writing data is stored. |
txcnt | Number of bytes for writing. |
rxd | Pointer to buffer where reading data will be saved. |
rxcnt | Number of bytes for reading. |
#define SPI_PutWordToFifo | ( | module, | |
txd, | |||
txcnt | |||
) |
This macro writes whole data packet to the SPI transmit FIFO.
module | SPI1. |
txd | Pointer to buffer where writing data is stored. |
txcnt | Number of words for writing. |
#define SPI_PutByteToFifo | ( | module, | |
txd, | |||
txcnt | |||
) |
This macro writes whole data packet to the SPI transmit FIFO.
module | SPI1. |
txd | Pointer to buffer where writing data is stored. |
txcnt | Number of bytes for writing. |
#define SPI_GetWordFromFifo | ( | module, | |
rxd, | |||
rxcnt | |||
) |
This macro saves 16-bit data from the SPI receive FIFO.
module | SPI1. |
rxd | Pointer to buffer where reading data will be saved. |
rxcnt | Number of words for reading. |
#define SPI_GetByteFromFifo | ( | module, | |
rxd, | |||
rxcnt | |||
) |
This macro saves 8-bit data packet from the SPI receive FIFO.
module | SPI1. |
rxd | Pointer to buffer where reading data will be saved. |
rxcnt | Number of bytes for reading. |
#define SPI_Init | ( | module, | |
cfg, | |||
call2, | |||
ip, | |||
call1 | |||
) |
This macro initializes SPI module. It also installs callback function for interrupt vectors associated with initialized SPI modules: vector 20(SPI0) and vector 21(SPI1).
module | SPI0,SPI1 |
cfg | Select one of SPI Configuration Structures. |
call2 | Pointer to SPI Slave Select Control Callback Function where SS pin is manually driven. |
ip | Select one of the ARM Cortex-M0+ Interrupt Priority Levels. |
call1 | Pointer to the SPI Callback Function. |