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.


Definition at line 58 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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.


Definition at line 80 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

Typedef Documentation#

sl_ext_device_handler_t#

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

Event Handler callback type.


Definition at line 53 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

Variable Documentation#

sl_ext_device_spi_config#

const SPIDRV_Init_t sl_ext_device_spi_config

Device SPI driver configuration.


Definition at line 121 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_spi_handle#

SPIDRV_Handle_t sl_ext_device_spi_handle

Device SPI driver instance handle (pointer)


Definition at line 125 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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
N/Ainterrupt_handler

The handler for device general interrupt (NULL to disable)

N/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.


Definition at line 143 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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
N/AclearPending

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

Returns

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


Definition at line 214 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

Macro Definition Documentation#

sl_ext_device_power_down#

#define sl_ext_device_power_down
Value:
(void)

Power down the device per GPIO.


Definition at line 102 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_power_up#

#define sl_ext_device_power_up
Value:
(void)

Power up the device per GPIO.


Definition at line 103 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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


Definition at line 104 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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


Definition at line 105 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_wait_ready#

#define sl_ext_device_wait_ready
Value:
(void)

Wait for the device to become ready per GPIO.


Definition at line 106 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_select#

#define sl_ext_device_select
Value:
(void)

Select the external device.


Definition at line 107 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_deselect#

#define sl_ext_device_deselect
Value:
(void)

Unselect the external device.


Definition at line 108 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_is_selected#

#define sl_ext_device_is_selected
Value:
(void)

Indicate if the device is selected.


Definition at line 109 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_not_selected#

#define sl_ext_device_not_selected
Value:
(void)

Indicate if the device is not selected.


Definition at line 110 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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


Definition at line 111 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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


Definition at line 112 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

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)


Definition at line 113 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

SL_EXT_DEVICE_POLARITY_INVERT#

#define SL_EXT_DEVICE_POLARITY_INVERT
Value:
false

Specifies GPIO pin polarity is inverted (assert = low)


Definition at line 94 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

SL_EXT_DEVICE_POLARITY_NORMAL#

#define SL_EXT_DEVICE_POLARITY_NORMAL
Value:
true

Specifies GPIO pin polarity is normal (assert = high)


Definition at line 97 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_init#

#define sl_ext_device_init
Value:
sl_si446x_init

Definition at line 101 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_enable_interrupt#

#define sl_ext_device_enable_interrupt
Value:
sl_si446x_enable_interrupt

Definition at line 114 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h

sl_ext_device_spi_config#

#define sl_ext_device_spi_config
Value:
sl_si446x_spi_config

Definition at line 115 of file hardware/driver/si446x_radio/inc/sl_si446x_radio.h