Synchronous Serial Interface#
Modules#
Enumerations#
Enumeration for different SSI callback events.
Enumeration for different SSI peripheral clock modes.
Enumeration for different SSI peripheral device modes.
Enumeration for different SSI master slave select modes.
Enumeration for different SSI slave slave select modes.
Enumeration for different SSI instances.
Enumeration for SSI Slave numbers.
Typedefs#
renaming arm power state structure
renaming arm SPI status
Renaming SSI driver structure.
SSI Handle to be passed into APIs.
Callback typedef for SSI.
Variables#
Release version number.
sqa version number
dev version number
bit width either 8 or 16 bit
mode such as Master or Slave mode
clock mode such as CPOL0 CPHA1
Master SW or Master HW Output.
Slave SW or Slave HW Output.
baud rate for SSI
Clock Division Factor.
intf PLL control value
intf PLL clock frequency
intf PLL reference clock frequency
SoC PLL Clock frequency.
SoC PLL reference clock frequency.
SoC PLL count value.
Functions#
Configure the SSI clock.
Initialize the SSI master.
Control the SPI interface power.
Control the SPI interface.
Start receiving data from the SPI interface.
Start sending data from SPI interface.
Start sending/receiving bi-directional full duplex data to/from SPI secondary.
Get the SSI status.
Get the driver version.
Get RX transferred data count with connected device.
Get TX transferred data count with connected device.
Register the user event callback.
Unregister the user event callback.
Set the secondary number in multi-secondary operation.
Enumeration Documentation#
ssi_event_typedef_t#
ssi_event_typedef_t
Enumeration for different SSI callback events.
Enumerator | |
---|---|
SSI_EVENT_TRANSFER_COMPLETE | Transfer complete event. |
SSI_EVENT_DATA_LOST | Data lost event. |
SSI_EVENT_MODE_FAULT | Mode fault event. |
ssi_peripheral_clock_mode_t#
ssi_peripheral_clock_mode_t
Enumeration for different SSI peripheral clock modes.
Enumerator | |
---|---|
SL_SSI_PERIPHERAL_CPOL0_CPHA0 | SSI_PERIPHERAL MODE 0 CPOL0_CPHA0. |
SL_SSI_PERIPHERAL_CPOL0_CPHA1 | SSI_PERIPHERAL MODE 1 CPOL0_CPHA1. |
SL_SSI_PERIPHERAL_CPOL1_CPHA0 | SSI_PERIPHERAL MODE 2 CPOL1_CPHA0. |
SL_SSI_PERIPHERAL_CPOL1_CPHA1 | SSI_PERIPHERAL MODE 3 CPOL1_CPHA1. |
SL_SSI_PERIPHERAL_TI_SSI | SSI_PERIPHERAL MODE TI_SSI. |
SL_SSI_PERIPHERAL_MICROWIRE | SSI_PERIPHERAL MODE MICROWIRE. |
SL_SSI_PERIPHERAL_MODE_LAST | SSI_PERIPHERAL MODE_LAST. |
ssi_peripheral_device_mode_t#
ssi_peripheral_device_mode_t
Enumeration for different SSI peripheral device modes.
Enumerator | |
---|---|
SL_SSI_MASTER_ACTIVE | SSI DEVICE MODE MASTER. |
SL_SSI_SLAVE_ACTIVE | SSI DEVICE MODE SLAVE. |
SL_SSI_ULP_MASTER_ACTIVE | |
SL_SSI_MASTER_MODE_LAST |
ssi_master_ssm_t#
ssi_master_ssm_t
Enumeration for different SSI master slave select modes.
Enumerator | |
---|---|
SL_SSI_MASTER_UNUSED | SSI MASTER UNUSED. |
SL_SSI_MASTER_SW | SSI MASTER SW. |
SL_SSI_MASTER_HW_OUTPUT | SSI MASTER HW OUTPUT. |
SL_SSI_MASTER_SLAVE_SELECT_MODE_LAST |
ssi_slave_ssm_t#
ssi_slave_ssm_t
Enumeration for different SSI slave slave select modes.
Enumerator | |
---|---|
SL_SSI_SLAVE_HW | SSI SLAVE HW. |
SL_SSI_SLAVE_SW | SSI SLAVE SW. |
SL_SSI_SLAVE_MODE_SELECT_LAST | Last member of slave mode select. |
sl_ssi_instance_t#
sl_ssi_instance_t
Enumeration for different SSI instances.
Enumerator | |
---|---|
SL_SSI_MASTER | SSI MASTER INSTANCE. |
SL_SSI_SLAVE | SSI SLAVE INSTANCE. |
SL_SSI_ULP_MASTER | SSI ULP MASTER INSTANCE. |
SL_SSI_INSTANCE_LAST_ENUM | Last member of enum for validation. |
sl_ssi_slave_number_t#
sl_ssi_slave_number_t
Enumeration for SSI Slave numbers.
Enumerator | |
---|---|
SSI_SLAVE_0 | Slave No. 1. |
SSI_SLAVE_1 | Slave No. 2. |
SSI_SLAVE_2 | Slave No. 2. |
SSI_SLAVE_LAST_ENUM | Last member of enum for validation. |
Typedef Documentation#
sl_ssi_power_state_t#
typedef ARM_POWER_STATE sl_ssi_power_state_t
renaming arm power state structure
Variable Documentation#
intf_pll_500_control_value#
uint16_t sl_ssi_clock_config_t::intf_pll_500_control_value
intf PLL control value
intf_pll_reference_clock#
uint32_t sl_ssi_clock_config_t::intf_pll_reference_clock
intf PLL reference clock frequency
soc_pll_reference_clock#
uint32_t sl_ssi_clock_config_t::soc_pll_reference_clock
SoC PLL reference clock frequency.
Function Documentation#
sl_si91x_ssi_configure_clock#
sl_status_t sl_si91x_ssi_configure_clock (sl_ssi_clock_config_t * clock_config)
Configure the SSI clock.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_clock_config_t * | [in] | clock_config | to clock config structure |
Returns
status 0 if successful, else error code.
SL_STATUS_OK (0x0000) - Success, timer clock-source parameters configured properly
sl_si91x_ssi_init#
sl_status_t sl_si91x_ssi_init (sl_ssi_instance_t instance, sl_ssi_handle_t * ssi_handle)
Initialize the SSI master.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_instance_t | [in] | instance | (Master/Slave/ULP Master), ssi_handle |
sl_ssi_handle_t * | N/A | ssi_handle |
Returns
status 0 if successful, else error code.
SL_STATUS_OK (0x0000) - Success, otherwise fail error code
sl_si91x_ssi_deinit#
sl_status_t sl_si91x_ssi_deinit (sl_ssi_handle_t ssi_handle)
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | N/A | ssi_handle |
sl_si91x_ssi_configure_power_mode#
sl_status_t sl_si91x_ssi_configure_power_mode (sl_ssi_handle_t ssi_handle, sl_ssi_power_state_t state)
Control the SPI interface power.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle, power state power off or full state. |
sl_ssi_power_state_t | N/A | state |
Returns
status 0 if successful, else error code. SL_STATUS_INVALID_PARAMETER (0x0021) - power state is invalid SL_STATUS_OK (0x0000) - Success, otherwise error code on failure
sl_si91x_ssi_set_configuration#
sl_status_t sl_si91x_ssi_set_configuration (sl_ssi_handle_t ssi_handle, sl_ssi_control_config_t * control_configuration)
Control the SPI interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle, pointer to control config structure. |
sl_ssi_control_config_t * | N/A | control_configuration |
Returns
status 0 if successful, else error code. SL_STATUS_INVALID_PARAMETER (0x0021) - invalid parameters SL_STATUS_OK (0x0000) - Success,
sl_si91x_ssi_receive_data#
sl_status_t sl_si91x_ssi_receive_data (sl_ssi_handle_t ssi_handle, void * data, uint32_t data_length)
Start receiving data from the SPI interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle, pointer to Rx data buffer, length of data |
void * | N/A | data | |
uint32_t | N/A | data_length |
Returns
status 0 if successful, else error code. SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer SL_STATUS_OK (0x0000) - Success
sl_si91x_ssi_send_data#
sl_status_t sl_si91x_ssi_send_data (sl_ssi_handle_t ssi_handle, const void * data, uint32_t data_length)
Start sending data from SPI interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle, pointer to Tx data buffer, length of data |
const void * | N/A | data | |
uint32_t | N/A | data_length |
Returns
status 0 if successful, else error code. SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer SL_STATUS_OK (0x0000) - Success
sl_si91x_ssi_transfer_data#
sl_status_t sl_si91x_ssi_transfer_data (sl_ssi_handle_t ssi_handle, const void * data_out, void * data_in, uint32_t data_length)
Start sending/receiving bi-directional full duplex data to/from SPI secondary.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle, pointer to Tx buffer, pointer to Rx buffer and data length |
const void * | N/A | data_out | |
void * | N/A | data_in | |
uint32_t | N/A | data_length |
Returns
status 0 if successful, else error code. SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer SL_STATUS_OK (0x0000) - Success, otherwise error code on failure.
sl_si91x_ssi_get_status#
sl_ssi_status_t sl_si91x_ssi_get_status (sl_ssi_handle_t ssi_handle)
Get the SSI status.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle |
Get the SPI secondary status.
Returns
busy, data lost or mode fault returns as a bit field.
Returns
busy, data lost or mode fault
sl_si91x_ssi_get_version#
sl_ssi_version_t sl_si91x_ssi_get_version (void )
Get the driver version.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
Returns
driver version.
sl_si91x_ssi_get_rx_data_count#
uint32_t sl_si91x_ssi_get_rx_data_count (sl_ssi_handle_t ssi_handle)
Get RX transferred data count with connected device.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle |
Returns
transferred data count
sl_si91x_ssi_get_tx_data_count#
uint32_t sl_si91x_ssi_get_tx_data_count (sl_ssi_handle_t ssi_handle)
Get TX transferred data count with connected device.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle |
Returns
transferred data count
sl_si91x_ssi_register_event_callback#
sl_status_t sl_si91x_ssi_register_event_callback (sl_ssi_handle_t ssi_handle, sl_ssi_signal_event_t callback_event)
Register the user event callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_ssi_handle_t | [in] | ssi_handle | handle |
sl_ssi_signal_event_t | [in] | callback_event | pointer callback_event It will returns error if any callback is already registered. |
It registers the callback, i.e., stores the callback function address and pass to the variable that is called in Interrupt Handler. If another callback is registered without unregistering previous callback then, it returns an error code, so it is mandatory to unregister the callback before registering another callback.
sl_si91x_gspi_unregister_event_callback#
void sl_si91x_gspi_unregister_event_callback (void )
Unregister the user event callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | [in] |
It unregisters the callback, i.e., clears the callback function address and passes a NULL value to the variable.
sl_si91x_ssi_set_slave_number#
__STATIC_INLINE sl_status_t sl_si91x_ssi_set_slave_number (uint8_t number)
Set the secondary number in multi-secondary operation.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | number | Slave number |
For single secondary also, this API needs to be called before transferring the data.
Returns
none