Si446x Radio SPI Driver#

Provide functions to control Si4446x Radio via SPI interface.

Enumerations#

enum
SL_EXT_DEVICE_HAS_NOTHING = 0x00u
SL_EXT_DEVICE_HAS_POWER = 0x01u
SL_EXT_DEVICE_HAS_READY = 0x02u
SL_EXT_DEVICE_HAS_SELECT = 0x04u
SL_EXT_DEVICE_HAS_INTERRUPT = 0x08u
SL_EXT_DEVICE_HAS_READY_IRQ = 0x20u
SL_EXT_DEVICE_HAS_INTERRUPT_IRQ = 0x80u
}

Device GPIO Capabilities.

enum
SL_EXT_DEVICE_INTERRUPT_DEPTH_ON = 0x00u
SL_EXT_DEVICE_INTERRUPT_DEPTH_OFF = 0x01u
SL_EXT_DEVICE_INTERRUPT_UNCONFIGURED = 0xFFu
}

Device interrupt depth state.

Typedefs#

typedef void(*

Event Handler callback type.

Variables#

const SPIDRV_Init_t

Device SPI driver configuration.

SPIDRV_Handle_t

Device SPI driver instance handle (pointer)

Functions#

sl_ext_device_init(sl_ext_device_handler_t interrupt_handler, sl_ext_device_handler_t ready_handler)

Initialize Device GPIOs.

Decrement interrupt nesting level and, if 0, enable device interrupt.

Macros#

#define

Power down the device per GPIO.

#define

Power up the device per GPIO.

#define

Indicate if the device is ready per GPIO.

#define

Indicate if the device is not ready per GPIO.

#define

Wait for the device to become ready per GPIO.

#define

Select the external device.

#define

Unselect the external device.

#define

Indicate if the device is selected.

#define

Indicate if the device is not selected.

#define

Indicate if device interrupt GPIO is pending.

#define

Indicate if device interrupt is not pending.

#define

Disable device interrupt and increment interrupt nesting level.

#define

Specifies GPIO pin polarity is inverted (assert = low)

#define

Specifies GPIO pin polarity is normal (assert = high)

#define
sl_ext_device_init sl_si446x_init
#define
sl_ext_device_enable_interrupt sl_si446x_enable_interrupt
#define
sl_ext_device_spi_config sl_si446x_spi_config

Enumeration Documentation#

sl_ext_device_config_t#

sl_ext_device_config_t

Device GPIO Capabilities.

Enumerator
SL_EXT_DEVICE_HAS_NOTHING

Not any of the others.

SL_EXT_DEVICE_HAS_POWER

Device has power input pin.

SL_EXT_DEVICE_HAS_READY

Device has ready output pin.

SL_EXT_DEVICE_HAS_SELECT

Device has select input pin.

SL_EXT_DEVICE_HAS_INTERRUPT

Device has interrupt output pin.

SL_EXT_DEVICE_HAS_READY_IRQ

An IRQ is assigned to ready pin.

SL_EXT_DEVICE_HAS_INTERRUPT_IRQ

An IRQ is assigned to interrupt pin.


sl_ext_device_interrupt_depth_t#

sl_ext_device_interrupt_depth_t

Device interrupt depth state.

Enumerator
SL_EXT_DEVICE_INTERRUPT_DEPTH_ON

Interrupt is enabled.

SL_EXT_DEVICE_INTERRUPT_DEPTH_OFF

Interrupt lowest depth disabled.

SL_EXT_DEVICE_INTERRUPT_UNCONFIGURED

Interrupt is not configured.


Typedef Documentation#

sl_ext_device_handler_t#

typedef void(* sl_ext_device_handler_t) (void) )(void)

Event Handler callback type.


Variable Documentation#

sl_ext_device_spi_config#

const SPIDRV_Init_t sl_ext_device_spi_config

Device SPI driver configuration.


sl_ext_device_spi_handle#

SPIDRV_Handle_t sl_ext_device_spi_handle

Device SPI driver instance handle (pointer)


Function Documentation#

sl_ext_device_init#

sl_ext_device_config_t sl_ext_device_init (sl_ext_device_handler_t interrupt_handler, sl_ext_device_handler_t ready_handler)

Initialize Device GPIOs.

Parameters
TypeDirectionArgument NameDescription
sl_ext_device_handler_tN/Ainterrupt_handler

The handler for device general interrupt (NULL to disable)

sl_ext_device_handler_tN/Aready_handler

The handler for device ready interrupt (NULL to disable)

Returns

  • bitmask of configured features for this device

Note

  • First initialization after bootup leaves the device powered down and unselected. Subsequent inits don't touch the device powered or selected states and can be used to reconfigure callback(s), which always clears any stale/pending events. For ready_handler its interrupt is enabled upon configuration; for interrupt_handler sl_ext_device_enable_interrupt() must subsequently be called to enable it.


sl_ext_device_enable_interrupt#

sl_ext_device_interrupt_depth_t sl_ext_device_enable_interrupt (bool clearPending)

Decrement interrupt nesting level and, if 0, enable device interrupt.

Parameters
TypeDirectionArgument NameDescription
boolN/AclearPending

if true clears any "stale" pending interrupt just prior to enabling device interrupt.

Returns

  • interrupt level prior to enabling (0=interrupts were enabled)


Macro Definition Documentation#

sl_ext_device_power_down#

#define sl_ext_device_power_down
Value:
(void)

Power down the device per GPIO.


sl_ext_device_power_up#

#define sl_ext_device_power_up
Value:
(void)

Power up the device per GPIO.


sl_ext_device_is_ready#

#define sl_ext_device_is_ready
Value:
(void)

Indicate if the device is ready per GPIO.

Returns

  • true if device is ready, false otherwise


sl_ext_device_not_ready#

#define sl_ext_device_not_ready
Value:
(void)

Indicate if the device is not ready per GPIO.

Returns

  • true if device is not ready, false otherwise


sl_ext_device_wait_ready#

#define sl_ext_device_wait_ready
Value:
(void)

Wait for the device to become ready per GPIO.


sl_ext_device_select#

#define sl_ext_device_select
Value:
(void)

Select the external device.


sl_ext_device_deselect#

#define sl_ext_device_deselect
Value:
(void)

Unselect the external device.


sl_ext_device_is_selected#

#define sl_ext_device_is_selected
Value:
(void)

Indicate if the device is selected.


sl_ext_device_not_selected#

#define sl_ext_device_not_selected
Value:
(void)

Indicate if the device is not selected.


sl_ext_device_is_interrupt_pending#

#define sl_ext_device_is_interrupt_pending
Value:
(void)

Indicate if device interrupt GPIO is pending.

Returns

  • true if device interrupt is pending, false otherwise


sl_ext_device_no_interrupt_pending#

#define sl_ext_device_no_interrupt_pending
Value:
(void)

Indicate if device interrupt is not pending.

Returns

  • true if device interrupt is not pending, false otherwise


sl_ext_device_disable_interrupt#

#define sl_ext_device_disable_interrupt
Value:
(void)

Disable device interrupt and increment interrupt nesting level.

Returns

  • interrupt level prior to disabling (0=interrupts were enabled)


SL_EXT_DEVICE_POLARITY_INVERT#

#define SL_EXT_DEVICE_POLARITY_INVERT
Value:
false

Specifies GPIO pin polarity is inverted (assert = low)


SL_EXT_DEVICE_POLARITY_NORMAL#

#define SL_EXT_DEVICE_POLARITY_NORMAL
Value:
true

Specifies GPIO pin polarity is normal (assert = high)


sl_ext_device_init#

#define sl_ext_device_init
Value:
sl_si446x_init

sl_ext_device_enable_interrupt#

#define sl_ext_device_enable_interrupt
Value:
sl_si446x_enable_interrupt

sl_ext_device_spi_config#

#define sl_ext_device_spi_config
Value:
sl_si446x_spi_config