![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ssp
Data Structures | |
struct | ssp_spi_mode_config_t |
ssp motorola spi mode configuration More... | |
struct | ssp_psp_mode_config_t |
ssp psp mode configuration More... | |
struct | ssp_config_t |
ssp configuration More... | |
struct | ssp_transfer_t |
ssp transfer content More... | |
struct | ssp_handle_t |
SSP handle. More... | |
SSP Initialization and deinitialization | |
void | SSP_GetDefaultConfig (ssp_config_t *config) |
SSP get default configuration. More... | |
void | SSP_Init (SSP_Type *base, const ssp_config_t *config) |
SSP module initialization function. More... | |
void | SSP_Deinit (SSP_Type *base) |
Deinitializes the SSP. More... | |
uint32_t | SSP_GetInstance (SSP_Type *base) |
Get SSP instance index. More... | |
SSP bus functional interface | |
void | SSP_GetDefaultSPIModeConfig (ssp_spi_mode_config_t *config) |
SSP get default SPI mode configuration. More... | |
void | SSP_SetSPIModeConfig (SSP_Type *base, const ssp_spi_mode_config_t *config) |
SSP set SPI mode configuration. More... | |
void | SSP_GetDefaultPSPModeConfig (ssp_psp_mode_config_t *config) |
SSP get default PSP mode configuration. More... | |
void | SSP_SetPSPModeConfig (SSP_Type *base, const ssp_psp_mode_config_t *config) |
SSP set PSP mode configuration. More... | |
static void | SSP_EnableLoopBackMode (SSP_Type *base, bool enable) |
SSP enable/disable loop back mode. More... | |
static void | SSP_WriteData (SSP_Type *base, uint32_t data) |
SSP write data fifo. More... | |
static uint32_t | SSP_ReadData (SSP_Type *base) |
SSP read data fifo. More... | |
static void | SSP_Enable (SSP_Type *base, bool enable) |
SSP enable/disable. More... | |
SSP interrupt functional interface | |
void | SSP_EnableInterrupt (SSP_Type *base, uint32_t interruptMask) |
SSP enable interrupt. More... | |
void | SSP_DisableInterrupt (SSP_Type *base, uint32_t interruptMask) |
SSP disable interrupt. More... | |
void | SSP_ClearInterruptStatus (SSP_Type *base, uint32_t interruptMask) |
SSP clear interrupt status. More... | |
uint32_t | SSP_GetInterruptStatus (SSP_Type *base) |
brief SSP get interrupt status. More... | |
SSP dma functional interface | |
static void | SSP_EnableSendDMARequest (SSP_Type *base, bool enable) |
SSP enable/disable tx DMA requst. More... | |
static void | SSP_EnableReceiveDMARequest (SSP_Type *base, bool enable) |
SSP enable/disable rx DMA requst. More... | |
static uint32_t | SSP_GetFifoAddress (SSP_Type *base) |
SSP get data fifo address. More... | |
SSP transactional interface | |
void | SSP_TransferSendCreateHandle (SSP_Type *base, ssp_handle_t *handle, ssp_transfer_callback_t callback, void *userData) |
Creates the SSP send handle. More... | |
void | SSP_TransferReceiveCreateHandle (SSP_Type *base, ssp_handle_t *handle, ssp_transfer_callback_t callback, void *userData) |
Creates the SSP receive handle. More... | |
status_t | SSP_TransferSendNonBlocking (ssp_handle_t *handle, ssp_transfer_t *transfer) |
Send the data using an interrupt and an asynchronous method. More... | |
status_t | SSP_TransferReceiveNonBlocking (ssp_handle_t *handle, ssp_transfer_t *transfer) |
Receive the data using an interrupt and an asynchronous method. More... | |
void | SSP_TransferAbortSend (ssp_handle_t *handle) |
Aborts the current send. More... | |
void | SSP_TransferAbortReceive (ssp_handle_t *handle) |
Aborts the current IRQ receive. More... | |
void | SSP_TransferSendHandleIRQ (ssp_handle_t *handle) |
IRQ handler for the SSP transmitter. More... | |
void | SSP_TransferReceiveHandleIRQ (ssp_handle_t *handle) |
IRQ handler for the SSP receiver. More... | |
struct ssp_spi_mode_config_t |
Data Fields | |
ssp_clock_polarity_t | spiClockPolarity |
SPI clock polarity. | |
ssp_spi_clock_phase_t | spiClockPhase |
SPI clock pahse. | |
ssp_clock_direction_t | spiClockDirection |
SPI clock direction for serial bit clock direction and frame clock direction. | |
ssp_data_width_t | dataWidth |
data width 8/16/18/32 bits | |
ssp_txd_idle_state_t | txdIdleState |
txd state when idle | |
ssp_txd_last_phase_state_t | txdLastPhaseState |
txd last phase state | |
struct ssp_psp_mode_config_t |
Data Fields | |
ssp_clock_direction_t | bitClockDirection |
bit clock generate internally or input externally | |
ssp_bit_clock_mode_t | bitClockMode |
bit clock mode | |
ssp_clock_direction_t | frameClockDirection |
frame clock generate internally or input externally | |
ssp_clock_polarity_t | frameClockPolarity |
frame clock polarity | |
ssp_frame_sync_relative_timing_t | frameRelativeTiming |
frame sync relative timing | |
ssp_txd_idle_state_t | txdIdleState |
txd state when idle | |
ssp_txd_last_phase_state_t | txdLastPhaseState |
txd last phase state | |
ssp_txd_end_transfer_state_t | txdEndTransferState |
txd end transfer state | |
ssp_data_width_t | dataWidth |
data width 8/16/18/32 bits | |
uint8_t | frameLength |
frame length, valid range 1-0x3F SSPSCLKx cycles | |
uint8_t | dummyStartDelay |
The MSB of the dummy start delay. | |
uint8_t | dummyStopDelay |
The MSB of the dummy stop delay. | |
uint8_t | startDelay |
number of 0-7 non-active clocks that defines the duration of idle time | |
uint8_t | frameDelay |
Programmed value specifies the number (0 -127) of active one-half clocks (SSPSCLKx) asserted from the most-significant bit of TXDx (output) or RXD (input) being driven to SSPSFRMx. More... | |
bool | enableNetWorkMode |
network should be enabled when emulating I2S protocol | |
uint8_t | frameSlotsNumber |
the tims slots number per frame, 1-8 can be specified | |
uint8_t | txActiveSlotMask |
the each bit in the txActiveSlotMask represent a time slot 0 is the SSP does not transmit data in this time slot, 1 is the SSP does transmit data in this time slot, so txActiveSlotMask = 3 means slot 0 and 1 is enabled, other slots are disabled | |
uint8_t | rxActiveSlotMask |
the each bit in the txActiveSlotMask represent a time slot 0 is the SSP does not transmit data in this time slot, 1 is the SSP does transmit data in this time slot, so txActiveSlotMask = 3 means slot 0 and 1 is enabled, other slots are disabled | |
uint8_t ssp_psp_mode_config_t::frameDelay |
struct ssp_config_t |
Data Fields | |
bool | enableRXHalfCycleDelay |
true is enable rx half cycle delay, false is disable | |
bool | enableMasterClockReturn |
true is enable master clock delay, false is disable | |
bool | enableSlaveClockFreeRuning |
true is clock input to SSPSCLKx is only active during data transfer false is clock input to SSPSCLKx is continuously runing | |
bool | enableFifoPackingMode |
fifo packing mode | |
uint8_t | txFifoWaterMark |
tx fifo watermark value | |
uint8_t | rxFifoWaterMark |
rx fifo watermark value | |
ssp_transcevier_mode_t | mode |
transceiver work mode | |
ssp_transceiver_format_t | format |
transceiver work format | |
void * | transceiverConfig |
transceiver configuration pointer, should be a pointer of More... | |
void* ssp_config_t::transceiverConfig |
struct ssp_transfer_t |
Data Fields | |
void * | dataBuffer |
the pointer of data buffer | |
uint32_t | dataSize |
the size of data to be transferred | |
struct _ssp_handle |
SSP handle typedef.
Defines the structure to save the SSP state information and callback function. A ssp_handle variable can be used to represent either SSP TX or SSP RX.
Data Fields | |
SSP_Type * | base |
ssp base address | |
uint32_t | bitWidth |
bit width | |
uint32_t | sspFifoWatermark |
ssp fifo WaterMark | |
ssp_transfer_t | sspQueue [SSP_XFER_QUEUE_SIZE] |
ssp queue storing queued transfer | |
volatile uint8_t | sspQueueUser |
Index for user to queue transfer. | |
volatile uint8_t | sspQueueDriver |
Index for driver to get the transfer data and size. | |
ssp_transfer_callback_t | callback |
Callback function. More... | |
void * | userData |
Parameter for transfer complete callback. More... | |
ssp_transfer_callback_t ssp_handle_t::callback |
void* ssp_handle_t::userData |
#define FSL_SSP_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 0U)) |
anonymous enum |
anonymous enum |
enum ssp_data_width_t |
enum ssp_txd_idle_state_t |
enum ssp_clock_polarity_t |
enum ssp_bit_clock_mode_t |
void SSP_GetDefaultConfig | ( | ssp_config_t * | config | ) |
config | the pointer of ssp configuration structure. |
void SSP_Init | ( | SSP_Type * | base, |
const ssp_config_t * | config | ||
) |
Configures the SSP according to the user configuration.
base | SSP peripheral base address. |
config | SSP configuration information. |
void SSP_Deinit | ( | SSP_Type * | base | ) |
base | SSP peripheral base address. |
uint32_t SSP_GetInstance | ( | SSP_Type * | base | ) |
Used for SSP DMA driver only.
base | SSP peripheral base address. |
void SSP_GetDefaultSPIModeConfig | ( | ssp_spi_mode_config_t * | config | ) |
The default SSP SPI mode configurations:
config | the pointer of ssp configuration structure. |
void SSP_SetSPIModeConfig | ( | SSP_Type * | base, |
const ssp_spi_mode_config_t * | config | ||
) |
base | SSP peripheral base address. |
config | the pointer of ssp spi mode configuration structure. |
void SSP_GetDefaultPSPModeConfig | ( | ssp_psp_mode_config_t * | config | ) |
The default SSP PSP mode configurations are 16bit, 2 slots, i2s protocol.
config | the pointer of PSP configuration structure. |
void SSP_SetPSPModeConfig | ( | SSP_Type * | base, |
const ssp_psp_mode_config_t * | config | ||
) |
base | SSP peripheral base address. |
config | the pointer of ssp psp mode configuration structure. |
|
inlinestatic |
The tx serial shifter is internally connected to input of RX serial shifter, the loopback mode used for test purpose only.
base | SSP peripheral base address. |
enable | true is enable the loop back mode, false is disable the loop back mode. |
|
inlinestatic |
When a data sample size of less than 32-bits is selected, or 16 bits for packed mode, software should right-justify the data that is written to the SSP Data Register for automatic insertion into the TXFIFO. The transmit logic left-justifies the data and ignores any unused bits, cannot perform a write in packed mode of less than 32 bits wide.
base | SSP peripheral base address. |
data | data to write. |
|
inlinestatic |
Received data of less than 32 bits is right-justified automatically in the RXFIFO
base | SSP peripheral base address. |
|
inlinestatic |
base | SSP peripheral base address. |
enable | true is enable, false is disable. |
void SSP_EnableInterrupt | ( | SSP_Type * | base, |
uint32_t | interruptMask | ||
) |
base | SSP peripheral base address |
interruptMask | the Interrupt to be enabled, can a value or OR value of _ssp_interrupt_mask. |
void SSP_DisableInterrupt | ( | SSP_Type * | base, |
uint32_t | interruptMask | ||
) |
base | SSP peripheral base address |
interruptMask | the Interrupt to be disable, can a value or OR value of _ssp_interrupt_mask. |
void SSP_ClearInterruptStatus | ( | SSP_Type * | base, |
uint32_t | interruptMask | ||
) |
Note: Transmit fifo ready flag and receive fifo flag do not support clear by software.
base | SSP peripheral base address |
interruptMask | the Interrupt to be cleared, can a value or OR'ed value of _ssp_interrupt_mask. |
uint32_t SSP_GetInterruptStatus | ( | SSP_Type * | base | ) |
base | SSP peripheral base address |
|
inlinestatic |
base | SSP peripheral base address. |
enable | true is enable TX dma request, false is disable |
|
inlinestatic |
base | SSP peripheral base address. |
enable | true is enable RX dma request, false is disable |
|
inlinestatic |
base | SSP peripheral base address. |
void SSP_TransferSendCreateHandle | ( | SSP_Type * | base, |
ssp_handle_t * | handle, | ||
ssp_transfer_callback_t | callback, | ||
void * | userData | ||
) |
base | SSP peripheral base address. |
handle | SSP handle pointer. |
callback | Structure pointer to contain all callback functions. |
userData | Callback function parameter. |
void SSP_TransferReceiveCreateHandle | ( | SSP_Type * | base, |
ssp_handle_t * | handle, | ||
ssp_transfer_callback_t | callback, | ||
void * | userData | ||
) |
base | SSP peripheral base address. |
handle | SSP handle pointer. |
callback | Structure pointer to contain all callback functions. |
userData | Callback function parameter. |
status_t SSP_TransferSendNonBlocking | ( | ssp_handle_t * | handle, |
ssp_transfer_t * | transfer | ||
) |
This function sends data and returns immediately. It doesn't wait for the transfer to complete or to encounter an error. The application can submit multiple transfer requests without waiting previous transfer request complete, since the SSP driver maintained a software transfer queue, the sizeof the queue is configurable by macro SSP_XFER_QUEUE_SIZE which indicates how many request can be submitted at the same time.
handle | SSP handle. |
transfer | transfer pointer. |
kStatus_InvalidArgument | Argument is invalid. |
kSSP_TransferStatusBusy | Busy transferring. |
kStatus_Success | Operate successfully. |
status_t SSP_TransferReceiveNonBlocking | ( | ssp_handle_t * | handle, |
ssp_transfer_t * | transfer | ||
) |
This function sends data and returns immediately. It doesn't wait for the transfer to complete or to encounter an error. The application can submit multiple transfer requests without waiting previous transfer request complete, since the SSP driver maintained a software transfer queue, the sizeof the queue is configurable by macro SSP_XFER_QUEUE_SIZE which indicates how many request can be submitted at the same time.
handle | SSP handle. |
transfer | transfer pointer. |
kStatus_InvalidArgument | Argument is invalid. |
kSSP_TransferStatusBusy | Busy transferring. |
kStatus_Success | Operate successfully. |
void SSP_TransferAbortSend | ( | ssp_handle_t * | handle | ) |
handle | Pointer to the ssp_handle_t structure which stores the transfer state. |
void SSP_TransferAbortReceive | ( | ssp_handle_t * | handle | ) |
handle | Pointer to the ssp_handle_t structure which stores the transfer state. |
void SSP_TransferSendHandleIRQ | ( | ssp_handle_t * | handle | ) |
This function deals with the IRQs on the given host controller.
handle | SSP handle. |
void SSP_TransferReceiveHandleIRQ | ( | ssp_handle_t * | handle | ) |
This function deals with the IRQs on the given host controller.
handle | SSP handle. |