CC26xx Driver Library |

- Main Page
- Related Pages
- CC26xx APIs
- Register Descriptions
- Online Resources

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
[ssi] Synchronous Serial Interface

## 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_INLINE void | SSIEnable (uint32_t ui32Base)
| Enables the synchronous serial port. More...
__STATIC_INLINE 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_INLINE bool | SSIBusy (uint32_t ui32Base)
| Determines whether the SSI transmitter is busy or not. More...
__STATIC_INLINE 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 port. More...
void | SSIIntUnregister (uint32_t ui32Base)
| Unregisters an interrupt handler for the synchronous serial port. More...
__STATIC_INLINE void | SSIIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags)
| Enables individual SSI interrupt sources. More...
__STATIC_INLINE void | SSIIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags)
| Disables individual SSI interrupt sources. More...
__STATIC_INLINE void | SSIIntClear (uint32_t ui32Base, uint32_t ui32IntFlags)
| Clears SSI interrupt sources. More...
__STATIC_INLINE uint32_t | SSIIntStatus (uint32_t ui32Base, bool bMasked)
| Gets the current interrupt status. More...
__STATIC_INLINE void | SSIDMAEnable (uint32_t ui32Base, uint32_t ui32DMAFlags)
| Enable SSI DMA operation. More...
__STATIC_INLINE void | SSIDMADisable (uint32_t ui32Base, uint32_t ui32DMAFlags)
| Disable SSI DMA operation. More...

## Detailed Description

## Function Documentation

__STATIC_INLINE bool SSIBusy | ( | uint32_t | ui32Base | ) |

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.

Parameters

  ui32Base | is the base address of the SSI port.

Returns
  Returns status of the SSI transmit buffer.
  - `true` : SSI is transmitting.
  - `false` : SSI transmissions are complete.

Definition at line 385 of file ssi.h.

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:

- Master mode : FSSI >= 2 * bit rate
- Slave mode : FSSI >= 12 * bit rate

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.

Note
  The peripheral clock is not necessarily the same as the processor clock. The frequency of the peripheral clock is set by the system control.

Parameters

  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: SSI_FRF_MOTO_MODE_0 SSI_FRF_MOTO_MODE_1 SSI_FRF_MOTO_MODE_2 SSI_FRF_MOTO_MODE_3 SSI_FRF_TI SSI_FRF_NMW.
  ui32Mode | specifies the mode of operation. The parameter can be one of the following values: SSI_MODE_MASTER SSI_MODE_SLAVE SSI_MODE_SLAVE_OD
  ui32BitRate | specifies the clock rate.
  ui32DataWidth | specifies number of bits transferred per frame. Must be a value between 4 and 16, both included.

Returns
  None

Definition at line 70 of file ssi.c.

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.

Note
  Only the lower N bits of the value written to `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.

Parameters

  ui32Base | specifies the SSI module base address.
  pui32Data | is a pointer to a storage location for data that was received over the SSI interface.

Returns
  None

Definition at line 191 of file ssi.c.

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.

Note
  Only the lower N bits of the value written to `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.

Parameters

  ui32Base | specifies the SSI module base address.
  pui32Data | is a pointer to a storage location for data that was received over the SSI interface.

Returns
  Returns the number of elements read from the SSI receive FIFO.

Gets a data element from the SSI receive FIFO

Parameters

  ui32Base | specifies the SSI module base address.
  pui32Data | is a pointer to a storage location for data that was received over the SSI interface.

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.

Note
  Only the lower N bits of the value written to pui32Data contain valid data, where N is the data width as configured by

See also
  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.

Returns
  Returns the number of elements read from the SSI receive FIFO.

Definition at line 234 of file ssi.c.

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.

Note
  The upper 32 - N bits of the `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.

Parameters

  ui32Base | specifies the SSI module base address.
  ui32Data | is the data to be transmitted over the SSI interface.

Returns
  None

Definition at line 163 of file ssi.c.

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.

Note
  The upper 32 - N bits of the `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.

Parameters

  ui32Base | specifies the SSI module base address.
  ui32Data | is the data to be transmitted over the SSI interface.

Returns
  Returns the number of elements written to the SSI transmit FIFO.

Definition at line 133 of file ssi.c.

__STATIC_INLINE void SSIDisable | ( | uint32_t | ui32Base | ) |

Disables the synchronous serial port.

This function disables operation of the synchronous serial port.

Parameters

  ui32Base | specifies the SSI module base address.

Returns
  None

Definition at line 267 of file ssi.h.

__STATIC_INLINE void SSIDMADisable | ( | uint32_t | ui32Base,
|  | uint32_t | ui32DMAFlags
| ) |  |

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.

Parameters

  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: SSI_DMA_RX : Disable DMA for receive. SSI_DMA_TX : Disable DMA for transmit.

Returns
  None

Definition at line 663 of file ssi.h.

__STATIC_INLINE void SSIDMAEnable | ( | uint32_t | ui32Base,
|  | uint32_t | ui32DMAFlags
| ) |  |

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.

Note
  The uDMA controller must also be set up before DMA can be used with the SSI.

Parameters

  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: SSI_DMA_RX : Enable DMA for receive. SSI_DMA_TX : Enable DMA for transmit.

Returns
  None

Definition at line 633 of file ssi.h.

__STATIC_INLINE void SSIEnable | ( | uint32_t | ui32Base | ) |

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.

Parameters

  ui32Base | specifies the SSI module base address.

Returns
  None

Definition at line 242 of file ssi.h.

__STATIC_INLINE void SSIIntClear | ( | uint32_t | ui32Base,
|  | uint32_t | ui32IntFlags
| ) |  |

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.

Note
  Because there is a write buffer in the Cortex-M3 processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (because the interrupt controller still sees the interrupt source asserted).

Parameters

  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: SSI_RXTO : Timeout interrupt. SSI_RXOR : Overrun interrupt.

Returns
  None

Definition at line 558 of file ssi.h.

__STATIC_INLINE void SSIIntDisable | ( | uint32_t | ui32Base,
|  | uint32_t | ui32IntFlags
| ) |  |

Disables individual SSI interrupt sources.

Disables the indicated SSI interrupt sources.

Parameters

  ui32Base | specifies the SSI module base address.
  ui32IntFlags | is a bit mask of the interrupt sources to be disabled. SSI_TXFF SSI_RXFF SSI_RXTO SSI_RXOR

Returns
  None

Definition at line 518 of file ssi.h.

__STATIC_INLINE void SSIIntEnable | ( | uint32_t | ui32Base,
|  | uint32_t | ui32IntFlags
| ) |  |

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.

Parameters

  ui32Base | specifies the SSI module base address.
  ui32IntFlags | is a bit mask of the interrupt sources to be enabled. SSI_TXFF SSI_RXFF SSI_RXTO SSI_RXOR

Returns
  None

Definition at line 488 of file ssi.h.

void SSIIntRegister | ( | uint32_t | ui32Base,
|  | void(*)(void) | pfnHandler
| ) |  |

Registers an interrupt handler for the synchronous serial port.

This sets the handler to be called when an SSI interrupt occurs. This will enable the global 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().

Parameters

  ui32Base | specifies the SSI module base address.
  pfnHandler | is a pointer to the function to be called when the synchronous serial port interrupt occurs.

Returns
  None

See also
  IntRegister() for important information about registering interrupt handlers.

Registers an interrupt handler for the synchronous serial port

Parameters

  ui32Base | specifies the SSI module base address.
  pfnHandler | is a pointer to the function to be called when the synchronous serial port interrupt occurs.

This sets the handler to be called when an SSI interrupt occurs. This will enable the global 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().

See also
  IntRegister() for important information about registering interrupt handlers.

Returns
  None

Definition at line 276 of file ssi.c.

__STATIC_INLINE uint32_t SSIIntStatus | ( | uint32_t | ui32Base,
|  | bool | bMasked
| ) |  |

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.

Parameters

  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.

Returns
  Returns the current interrupt status as an OR'ed combination of:
  - SSI_TXFF
  - SSI_RXFF
  - SSI_RXTO
  - SSI_RXOR

Definition at line 592 of file ssi.h.

void SSIIntUnregister | ( | uint32_t | ui32Base | ) |

Unregisters an interrupt handler for the synchronous serial port.

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.

Parameters

  ui32Base | specifies the SSI module base address.

Returns
  None

See also
  IntRegister() for important information about registering interrupt handlers.

Unregisters an interrupt handler for the synchronous serial port

Parameters

  ui32Base | specifies the SSI module base address.

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.

See also
  IntRegister() for important information about registering interrupt handlers.

Returns
  None

Definition at line 318 of file ssi.c.

__STATIC_INLINE uint32_t SSIStatus | ( | uint32_t | ui32Base | ) |

Get the status of the SSI data buffers.

This funtion is used to poll the status of the internal FIFOs in the SSI module. The status of both TX and RX FIFO is returned.

Parameters

  ui32Base | specifies the SSI module base address.

Returns
  Returns the current status of the internal SSI data buffers. The status is a bitwise OR'ed combination of:
  - SSI_RX_FULL : Receive FIFO full.
  - SSI_RX_NOT_EMPTY : Receive FIFO not empty.
  - SSI_TX_NOT_FULL : Transmit FIFO not full.
  - SSI_TX_EMPTY : Transmit FIFO empty.

Definition at line 416 of file ssi.h.

## Macro Definition Documentation

#define SSI_DMA_RX 0x00000001

Definition at line 138 of file ssi.h.

#define SSI_DMA_TX 0x00000002

Definition at line 137 of file ssi.h.

#define SSI_FRF_MOTO_MODE_0 0x00000000

Definition at line 121 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_FRF_MOTO_MODE_1 0x00000002

Definition at line 122 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_FRF_MOTO_MODE_2 0x00000001

Definition at line 123 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_FRF_MOTO_MODE_3 0x00000003

Definition at line 124 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_FRF_NMW 0x00000020

Definition at line 126 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_FRF_TI 0x00000010

Definition at line 125 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_MODE_MASTER 0x00000000

Definition at line 128 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_MODE_SLAVE 0x00000001

Definition at line 129 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_MODE_SLAVE_OD 0x00000002

Definition at line 130 of file ssi.h.

Referenced by SSIConfigSetExpClk().

#define SSI_RX_FULL 0x00000008

Definition at line 110 of file ssi.h.

#define SSI_RX_NOT_EMPTY 0x00000004

Definition at line 111 of file ssi.h.

#define SSI_RXFF 0x00000004

Definition at line 101 of file ssi.h.

#define SSI_RXOR 0x00000001

Definition at line 103 of file ssi.h.

#define SSI_RXTO 0x00000002

Definition at line 102 of file ssi.h.

#define SSI_STATUS_MASK 0x0000000F

Definition at line 114 of file ssi.h.

Referenced by SSIStatus().

#define SSI_TX_EMPTY 0x00000001

Definition at line 113 of file ssi.h.

#define SSI_TX_NOT_FULL 0x00000002

Definition at line 112 of file ssi.h.

#define SSI_TXFF 0x00000008

Definition at line 100 of file ssi.h.