Functions | |
void | SSIConfigSetExpClk (uint32_t ui32Base, uint32_t ui32SSIClk, uint32_t ui32Protocol, uint32_t ui32Mode, uint32_t ui32BitRate, uint32_t ui32DataWidth) |
Configures the synchronous serial port. More... | |
static void | SSIEnable (uint32_t ui32Base) |
Enables the synchronous serial port. More... | |
static void | SSIDisable (uint32_t ui32Base) |
Disables the synchronous serial port. More... | |
void | SSIDataPut (uint32_t ui32Base, uint32_t ui32Data) |
Puts a data element into the SSI transmit FIFO. More... | |
int32_t | SSIDataPutNonBlocking (uint32_t ui32Base, uint32_t ui32Data) |
Puts a data element into the SSI transmit FIFO. More... | |
void | SSIDataGet (uint32_t ui32Base, uint32_t *pui32Data) |
Gets a data element from the SSI receive FIFO. More... | |
int32_t | SSIDataGetNonBlocking (uint32_t ui32Base, uint32_t *pui32Data) |
Gets a data element from the SSI receive FIFO. More... | |
static bool | SSIBusy (uint32_t ui32Base) |
Determines whether the SSI transmitter is busy or not. More... | |
static uint32_t | SSIStatus (uint32_t ui32Base) |
Get the status of the SSI data buffers. More... | |
void | SSIIntRegister (uint32_t ui32Base, void(*pfnHandler)(void)) |
Registers an interrupt handler for the Synchronous Serial Interface in the dynamic interrupt table. More... | |
void | SSIIntUnregister (uint32_t ui32Base) |
Unregisters an interrupt handler for the Synchronous Serial Interface in the dynamic interrupt table. More... | |
static void | SSIIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags) |
Enables individual SSI interrupt sources. More... | |
static void | SSIIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags) |
Disables individual SSI interrupt sources. More... | |
static void | SSIIntClear (uint32_t ui32Base, uint32_t ui32IntFlags) |
Clears SSI interrupt sources. More... | |
static uint32_t | SSIIntStatus (uint32_t ui32Base, bool bMasked) |
Gets the current interrupt status. More... | |
static void | SSIDMAEnable (uint32_t ui32Base, uint32_t ui32DMAFlags) |
Enable SSI DMA operation. More... | |
static void | SSIDMADisable (uint32_t ui32Base, uint32_t ui32DMAFlags) |
Disable SSI DMA operation. More... | |
|
inlinestatic |
Determines whether the SSI transmitter is busy or not.
Allows the caller to determine whether all transmitted bytes have cleared the transmitter hardware. If false
is returned, then the transmit FIFO is empty and all bits of the last transmitted word have left the hardware shift register.
ui32Base | is the base address of the SSI port. |
true
: SSI is transmitting.false
: SSI transmissions are complete. void SSIConfigSetExpClk | ( | uint32_t | ui32Base, |
uint32_t | ui32SSIClk, | ||
uint32_t | ui32Protocol, | ||
uint32_t | ui32Mode, | ||
uint32_t | ui32BitRate, | ||
uint32_t | ui32DataWidth | ||
) |
Configures the synchronous serial port.
This function configures the synchronous serial port. It sets the SSI protocol, mode of operation, bit rate, and data width.
The ui32Protocol
parameter defines the data frame format. The Motorola frame formats imply the following polarity and phase configurations:
Polarity Phase Mode 0 0 SSI_FRF_MOTO_MODE_0 0 1 SSI_FRF_MOTO_MODE_1 1 0 SSI_FRF_MOTO_MODE_2 1 1 SSI_FRF_MOTO_MODE_3
The ui32Mode
parameter defines the operating mode of the SSI module. The SSI module can operate as a master or slave; if a slave, the SSI can be configured to disable output on its serial output line.
The ui32BitRate
parameter defines the bit rate for the SSI. This bit rate must satisfy the following clock ratio criteria:
where FSSI is the frequency of the clock supplied to the SSI module.
The ui32DataWidth
parameter defines the width of the data transfers, and can be a value between 4 and 16, inclusive.
ui32Base | specifies the SSI module base address. |
ui32SSIClk | is the rate of the clock supplied to the SSI module. |
ui32Protocol | specifies the data transfer protocol. The parameter can be one of the following values: |
ui32Mode | specifies the mode of operation. The parameter can be one of the following values: |
ui32BitRate | specifies the clock rate. |
ui32DataWidth | specifies number of bits transferred per frame. Must be a value between 4 and 16, both included. |
void SSIDataGet | ( | uint32_t | ui32Base, |
uint32_t * | pui32Data | ||
) |
Gets a data element from the SSI receive FIFO.
This function gets received data from the receive FIFO of the specified SSI module and places that data into the location specified by the pui32Data
parameter.
pui32Data
contain valid data, where N is the data width as configured by SSIConfigSetExpClk(). For example, if the interface is configured for 8-bit data width, only the lower 8 bits of the value written to pui32Data
contain valid data.ui32Base | specifies the SSI module base address. |
pui32Data | is a pointer to a storage location for data that was received over the SSI interface. |
int32_t SSIDataGetNonBlocking | ( | uint32_t | ui32Base, |
uint32_t * | pui32Data | ||
) |
Gets a data element from the SSI receive FIFO.
This function gets received data from the receive FIFO of the specified SSI module and places that data into the location specified by the ui32Data
parameter. If there is no data in the FIFO, then this function returns a zero.
pui32Data
contain valid data, where N is the data width as configured by SSIConfigSetExpClk(). For example, if the interface is configured for 8-bit data width, only the lower 8 bits of the value written to pui32Data
contain valid data.ui32Base | specifies the SSI module base address. |
pui32Data | is a pointer to a storage location for data that was received over the SSI interface. |
void SSIDataPut | ( | uint32_t | ui32Base, |
uint32_t | ui32Data | ||
) |
Puts a data element into the SSI transmit FIFO.
This function places the supplied data into the transmit FIFO of the specified SSI module.
ui32Data
are discarded by the hardware, where N is the data width as configured by SSIConfigSetExpClk(). For example, if the interface is configured for 8-bit data width, the upper 24 bits of ui32Data
are discarded.ui32Base | specifies the SSI module base address. |
ui32Data | is the data to be transmitted over the SSI interface. |
int32_t SSIDataPutNonBlocking | ( | uint32_t | ui32Base, |
uint32_t | ui32Data | ||
) |
Puts a data element into the SSI transmit FIFO.
This function places the supplied data into the transmit FIFO of the specified SSI module. If there is no space in the FIFO, then this function returns a zero.
ui32Data
are discarded by the hardware, where N is the data width as configured by SSIConfigSetExpClk(). For example, if the interface is configured for 8-bit data width, the upper 24 bits of ui32Data
are discarded.ui32Base | specifies the SSI module base address. |
ui32Data | is the data to be transmitted over the SSI interface. |
|
inlinestatic |
Disables the synchronous serial port.
This function disables operation of the synchronous serial port.
ui32Base | specifies the SSI module base address. |
|
inlinestatic |
Disable SSI DMA operation.
This function is used to disable SSI DMA features that were enabled by SSIDMAEnable(). The specified SSI DMA features are disabled.
ui32Base | is the base address of the SSI port. |
ui32DMAFlags | is a bit mask of the DMA features to disable. The parameter is the bitwise OR of any of the following values:
|
|
inlinestatic |
Enable SSI DMA operation.
The specified SSI DMA features are enabled. The SSI can be configured to use DMA for transmit and/or receive data transfers.
ui32Base | is the base address of the SSI port. |
ui32DMAFlags | is a bit mask of the DMA features to enable. The parameter is the bitwise OR of any of the following values:
|
|
inlinestatic |
Enables the synchronous serial port.
This function enables operation of the synchronous serial port. The synchronous serial port must be configured before it is enabled.
ui32Base | specifies the SSI module base address. |
|
inlinestatic |
Clears SSI interrupt sources.
The specified SSI interrupt sources are cleared so that they no longer assert. This function must be called in the interrupt handler to keep the interrupts from being recognized again immediately upon exit.
ui32Base | specifies the SSI module base address. |
ui32IntFlags | is a bit mask of the interrupt sources to be cleared. The parameter can consist of either or both of: |
|
inlinestatic |
Disables individual SSI interrupt sources.
Disables the indicated SSI interrupt sources.
ui32Base | specifies the SSI module base address. |
ui32IntFlags | is a bit mask of the interrupt sources to be disabled. |
|
inlinestatic |
Enables individual SSI interrupt sources.
Enables the indicated SSI interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
ui32Base | specifies the SSI module base address. |
ui32IntFlags | is a bit mask of the interrupt sources to be enabled. |
void SSIIntRegister | ( | uint32_t | ui32Base, |
void(*)(void) | pfnHandler | ||
) |
Registers an interrupt handler for the Synchronous Serial Interface in the dynamic interrupt table.
This function registers a function as the interrupt handler for a specific interrupt and enables the corresponding interrupt in the interrupt controller.
Specific SSI interrupts must be enabled via SSIIntEnable(). If necessary, it is the interrupt handler's responsibility to clear the interrupt source via SSIIntClear().
ui32Base | specifies the SSI module base address. |
pfnHandler | is a pointer to the function to be called when the synchronous serial port interrupt occurs. |
|
inlinestatic |
Gets the current interrupt status.
This function returns the interrupt status for the SSI module. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.
ui32Base | specifies the SSI module base address. |
bMasked | selects either raw or masked interrupt. false : Raw interrupt status is required. true : Masked interrupt status is required. |
void SSIIntUnregister | ( | uint32_t | ui32Base | ) |
Unregisters an interrupt handler for the Synchronous Serial Interface in the dynamic interrupt table.
This function will clear the handler to be called when a SSI interrupt occurs. This will also mask off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
ui32Base | specifies the SSI module base address. |
|
inlinestatic |
Get the status of the SSI data buffers.
This function is used to poll the status of the internal FIFOs in the SSI module. The status of both TX and RX FIFO is returned.
ui32Base | specifies the SSI module base address. |
#define SSI_DMA_RX 0x00000001 |
#define SSI_DMA_TX 0x00000002 |
#define SSI_FRF_MOTO_MODE_0 0x00000000 |
Referenced by SSIConfigSetExpClk().
#define SSI_FRF_MOTO_MODE_1 0x00000002 |
Referenced by SSIConfigSetExpClk().
#define SSI_FRF_MOTO_MODE_2 0x00000001 |
Referenced by SSIConfigSetExpClk().
#define SSI_FRF_MOTO_MODE_3 0x00000003 |
Referenced by SSIConfigSetExpClk().
#define SSI_FRF_NMW 0x00000020 |
Referenced by SSIConfigSetExpClk().
#define SSI_FRF_TI 0x00000010 |
Referenced by SSIConfigSetExpClk().
#define SSI_MODE_MASTER 0x00000000 |
Referenced by SSIConfigSetExpClk().
#define SSI_MODE_SLAVE 0x00000001 |
Referenced by SSIConfigSetExpClk().
#define SSI_MODE_SLAVE_OD 0x00000002 |
Referenced by SSIConfigSetExpClk().
#define SSI_RX_FULL 0x00000008 |
#define SSI_RX_NOT_EMPTY 0x00000004 |
#define SSI_RXFF 0x00000004 |
#define SSI_RXOR 0x00000001 |
#define SSI_RXTO 0x00000002 |
#define SSI_STATUS_MASK 0x0000000F |
Referenced by SSIStatus().
#define SSI_TX_EMPTY 0x00000001 |
#define SSI_TX_NOT_FULL 0x00000002 |
#define SSI_TXFF 0x00000008 |