Synchronous Serial Interface#

Modules#

sl_ssi_version_t

sl_ssi_control_config_t

sl_ssi_clock_config_t

Enumerations#

enum
SSI_EVENT_TRANSFER_COMPLETE = ARM_SPI_EVENT_TRANSFER_COMPLETE
SSI_EVENT_DATA_LOST = ARM_SPI_EVENT_DATA_LOST
SSI_EVENT_MODE_FAULT = ARM_SPI_EVENT_MODE_FAULT
}

Enumeration for different SSI callback events.

enum
SL_SSI_PERIPHERAL_CPOL0_CPHA0 = ARM_SPI_CPOL0_CPHA0
SL_SSI_PERIPHERAL_CPOL0_CPHA1 = ARM_SPI_CPOL0_CPHA1
SL_SSI_PERIPHERAL_CPOL1_CPHA0 = ARM_SPI_CPOL1_CPHA0
SL_SSI_PERIPHERAL_CPOL1_CPHA1 = ARM_SPI_CPOL1_CPHA1
SL_SSI_PERIPHERAL_TI_SSI = ARM_SPI_TI_SSI
SL_SSI_PERIPHERAL_MICROWIRE = ARM_SPI_MICROWIRE
SL_SSI_PERIPHERAL_MODE_LAST
}

Enumeration for different SSI peripheral clock modes.

enum
SL_SSI_MASTER_ACTIVE = ARM_SPI_MODE_MASTER
SL_SSI_SLAVE_ACTIVE = ARM_SPI_MODE_SLAVE
SL_SSI_ULP_MASTER_ACTIVE
SL_SSI_MASTER_MODE_LAST
}

Enumeration for different SSI peripheral device modes.

enum
SL_SSI_MASTER_UNUSED = ARM_SPI_SS_MASTER_UNUSED
SL_SSI_MASTER_SW = ARM_SPI_SS_MASTER_SW
SL_SSI_MASTER_HW_OUTPUT = ARM_SPI_SS_MASTER_HW_OUTPUT
SL_SSI_MASTER_SLAVE_SELECT_MODE_LAST
}

Enumeration for different SSI master slave select modes.

enum
SL_SSI_SLAVE_HW = ARM_SPI_SS_SLAVE_HW
SL_SSI_SLAVE_SW = ARM_SPI_SS_SLAVE_SW
SL_SSI_SLAVE_MODE_SELECT_LAST
}

Enumeration for different SSI slave slave select modes.

enum
SL_SSI_MASTER
SL_SSI_SLAVE
SL_SSI_ULP_MASTER
SL_SSI_INSTANCE_LAST_ENUM
}

Enumeration for different SSI instances.

enum
SSI_SLAVE_0
SSI_SLAVE_1
SSI_SLAVE_2
SSI_SLAVE_LAST_ENUM
}

Enumeration for SSI Slave numbers.

Typedefs#

typedef ARM_POWER_STATE

renaming arm power state structure

typedef ARM_SPI_STATUS

renaming arm SPI status

typedef ARM_DRIVER_SPI

Renaming SSI driver structure.

typedef const void *

SSI Handle to be passed into APIs.

typedef ARM_SPI_SignalEvent_t

Callback typedef for SSI.

Variables#

uint8_t

Release version number.

uint8_t

sqa version number

uint8_t

dev version number

uint8_t

bit width either 8 or 16 bit

uint32_t

mode such as Master or Slave mode

uint32_t

clock mode such as CPOL0 CPHA1

uint32_t

Master SW or Master HW Output.

uint32_t

Slave SW or Slave HW Output.

uint32_t

baud rate for SSI

uint16_t

Clock Division Factor.

uint16_t

intf PLL control value

uint32_t

intf PLL clock frequency

uint32_t

intf PLL reference clock frequency

uint32_t

SoC PLL Clock frequency.

uint32_t

SoC PLL reference clock frequency.

uint8_t

SoC PLL count value.

Functions#

sl_status_t
sl_si91x_ssi_configure_clock(sl_ssi_clock_config_t *clock_config)

Configure the SSI clock.

sl_status_t
sl_si91x_ssi_init(sl_ssi_instance_t instance, sl_ssi_handle_t *ssi_handle)

Initialize the SSI master.

sl_status_t
sl_si91x_ssi_deinit(sl_ssi_handle_t ssi_handle)
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.

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.

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.

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.

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.

sl_si91x_ssi_get_status(sl_ssi_handle_t ssi_handle)

Get the SSI status.

Get the driver version.

uint32_t
sl_si91x_ssi_get_rx_data_count(sl_ssi_handle_t ssi_handle)

Get RX transferred data count with connected device.

uint32_t
sl_si91x_ssi_get_tx_data_count(sl_ssi_handle_t ssi_handle)

Get TX transferred data count with connected device.

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.

void

Unregister the user event callback.

uint32_t
sl_si91x_ssi_get_clock_division_factor(sl_ssi_handle_t ssi_handle)

Get the clock division factor.

uint32_t
sl_si91x_ssi_get_frame_length(sl_ssi_handle_t ssi_handle)

Get the frame length (bit width).

__STATIC_INLINE sl_status_t

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.


Definition at line 65 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.


Definition at line 75 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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

Definition at line 88 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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

Definition at line 99 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.


Definition at line 107 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.


Definition at line 114 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.


Definition at line 147 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

Typedef Documentation#

sl_ssi_power_state_t#

typedef ARM_POWER_STATE sl_ssi_power_state_t

renaming arm power state structure


Definition at line 52 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_ssi_status_t#

typedef ARM_SPI_STATUS sl_ssi_status_t

renaming arm SPI status


Definition at line 53 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_ssi_driver_t#

typedef ARM_DRIVER_SPI sl_ssi_driver_t

Renaming SSI driver structure.


Definition at line 54 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_ssi_handle_t#

typedef const void* sl_ssi_handle_t

SSI Handle to be passed into APIs.


Definition at line 55 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_ssi_signal_event_t#

typedef ARM_SPI_SignalEvent_t sl_ssi_signal_event_t

Callback typedef for SSI.


Definition at line 56 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

Variable Documentation#

release#

uint8_t sl_ssi_version_t::release

Release version number.


Definition at line 59 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

major#

uint8_t sl_ssi_version_t::major

sqa version number


Definition at line 60 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

minor#

uint8_t sl_ssi_version_t::minor

dev version number


Definition at line 61 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

bit_width#

uint8_t sl_ssi_control_config_t::bit_width

bit width either 8 or 16 bit


Definition at line 125 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

device_mode#

uint32_t sl_ssi_control_config_t::device_mode

mode such as Master or Slave mode


Definition at line 126 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

clock_mode#

uint32_t sl_ssi_control_config_t::clock_mode

clock mode such as CPOL0 CPHA1


Definition at line 127 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

master_ssm#

uint32_t sl_ssi_control_config_t::master_ssm

Master SW or Master HW Output.


Definition at line 128 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

slave_ssm#

uint32_t sl_ssi_control_config_t::slave_ssm

Slave SW or Slave HW Output.


Definition at line 129 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

baud_rate#

uint32_t sl_ssi_control_config_t::baud_rate

baud rate for SSI


Definition at line 130 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

division_factor#

uint16_t sl_ssi_clock_config_t::division_factor

Clock Division Factor.


Definition at line 137 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

intf_pll_500_control_value#

uint16_t sl_ssi_clock_config_t::intf_pll_500_control_value

intf PLL control value


Definition at line 138 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

intf_pll_clock#

uint32_t sl_ssi_clock_config_t::intf_pll_clock

intf PLL clock frequency


Definition at line 139 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

intf_pll_reference_clock#

uint32_t sl_ssi_clock_config_t::intf_pll_reference_clock

intf PLL reference clock frequency


Definition at line 140 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

soc_pll_clock#

uint32_t sl_ssi_clock_config_t::soc_pll_clock

SoC PLL Clock frequency.


Definition at line 141 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

soc_pll_reference_clock#

uint32_t sl_ssi_clock_config_t::soc_pll_reference_clock

SoC PLL reference clock frequency.


Definition at line 142 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

soc_pll_mm_count_value#

uint8_t sl_ssi_clock_config_t::soc_pll_mm_count_value

SoC PLL count value.


Definition at line 143 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[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
    

Definition at line 162 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]instance

(Master/Slave/ULP Master), ssi_handle

N/Assi_handle

Returns

  • status 0 if successful, else error code.

        SL_STATUS_OK (0x0000) - Success, otherwise fail error code
    

Definition at line 172 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_si91x_ssi_deinit#

sl_status_t sl_si91x_ssi_deinit (sl_ssi_handle_t ssi_handle)
Parameters
N/Assi_handle

Definition at line 182 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle, power state power off or full state.

N/Astate

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


Definition at line 192 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle, pointer to control config structure.

N/Acontrol_configuration

Returns

  • status 0 if successful, else error code. SL_STATUS_INVALID_PARAMETER (0x0021) - invalid parameters SL_STATUS_OK (0x0000) - Success,


Definition at line 202 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle, pointer to Rx data buffer, length of data

N/Adata
N/Adata_length

Returns

  • status 0 if successful, else error code. SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer SL_STATUS_OK (0x0000) - Success


Definition at line 212 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle, pointer to Tx data buffer, length of data

N/Adata
N/Adata_length

Returns

  • status 0 if successful, else error code. SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer SL_STATUS_OK (0x0000) - Success


Definition at line 222 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle, pointer to Tx buffer, pointer to Rx buffer and data length

N/Adata_out
N/Adata_in
N/Adata_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.


Definition at line 233 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_si91x_ssi_get_status#

sl_ssi_status_t sl_si91x_ssi_get_status (sl_ssi_handle_t ssi_handle)

Get the SSI status.

Parameters
[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


Definition at line 245 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_si91x_ssi_get_version#

sl_ssi_version_t sl_si91x_ssi_get_version (void )

Get the driver version.

Parameters
[in]

Returns

  • driver version.


Definition at line 254 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle

Returns

  • transferred data count


Definition at line 270 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle

Returns

  • transferred data count


Definition at line 278 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]ssi_handle

handle

[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.


Definition at line 292 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_si91x_gspi_unregister_event_callback#

void sl_si91x_gspi_unregister_event_callback (void )

Unregister the user event callback.

Parameters
[in]

It unregisters the callback, i.e., clears the callback function address and passes a NULL value to the variable.


Definition at line 301 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_si91x_ssi_get_clock_division_factor#

uint32_t sl_si91x_ssi_get_clock_division_factor (sl_ssi_handle_t ssi_handle)

Get the clock division factor.

Parameters
[in]ssi_handle

Pointer to the SSI driver handle

Returns

  • factor(int32_t) Clock division factor


Definition at line 309 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

sl_si91x_ssi_get_frame_length#

uint32_t sl_si91x_ssi_get_frame_length (sl_ssi_handle_t ssi_handle)

Get the frame length (bit width).

Parameters
[in]ssi_handle

Pointer to the SSI driver handle

Returns

  • frame_length (uint32_t) Frame length


Definition at line 317 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h

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.

Parameters
[in]number

Slave number

For single secondary also, this API needs to be called before transferring the data.

Returns

  • none


Definition at line 327 of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_ssi.h