quasar_radio.h
This module provides functions for the SPARK Radio module.
- Copyright
Copyright (C) 2026 SPARK Microsystems International Inc. All rights reserved.
- License
This source code is proprietary and subject to the SPARK Microsystems Software EULA found in this package in file EULA.txt.
- Author
SPARK FW Team.
Typedefs
-
typedef struct quasar_radio_config quasar_radio_config_t
Quasar BSP radio configuration.
Functions
-
void quasar_radio_1_init(quasar_bsp_status_t *err)
Initialize the radio 1’s peripherals.
Reset pin
Shutdown pin
IRQ pin
SPI1 SCK pin
SPI1 MOSI pin
SPI1 MISO pin
SPI1 CS pin
- Parameters:
err – [out] Pointer to store error status.
-
void quasar_radio_2_init(quasar_revision_t board_revision, quasar_bsp_status_t *err)
Initialize the radio 2’s peripherals.
Reset pin
Shutdown pin
IRQ pin
SPI2 SCK pin
SPI2 MOSI pin
SPI2 MISO pin
SPI2 CS pin
Note
Depending on the board revision the MOSI pin GPIO differs.
- Parameters:
board_revision – [in] The board revision.
err – [out] Pointer to store error status.
-
void quasar_radio_1_deinit(quasar_bsp_status_t *err)
Deinitialize the radio 1’s peripherals.
- Parameters:
err – [out] Pointer to store error status.
-
void quasar_radio_2_deinit(quasar_revision_t board_revision, quasar_bsp_status_t *err)
Deinitialize the radio 2’s peripherals.
Note
Depending on the board revision the MOSI pin GPIO differs.
- Parameters:
board_revision – [in] The board revision.
err – [out] Pointer to store error status.
-
void quasar_radio_set_radio_1_irq_callback(void (*irq_callback)(void))
This function sets the function callback for the radio pin interrupt.
- Parameters:
irq_callback – [in] External interrupt callback function pointer.
-
void quasar_radio_set_radio_2_irq_callback(void (*irq_callback)(void))
This function sets the function callback for the radio pin interrupt.
- Parameters:
irq_callback – [in] External interrupt callback function pointer.
-
void quasar_radio_set_radio_1_non_blocking_transfer_callback(void (*irq_callback)(void))
This function sets the function callback for the radio 1 DMA interrupt.
- Parameters:
irq_callback – [in] External interrupt callback function pointer.
-
void quasar_radio_set_radio_2_non_blocking_transfer_callback(void (*irq_callback)(void))
This function sets the function callback for the radio 2 DMA interrupt.
- Parameters:
irq_callback – [in] External interrupt callback function pointer.
-
bool quasar_radio_1_read_irq_pin(void)
Read the status of the on-board controller IRQ pin of the radio #1.
- Return values:
True – Pin is high.
False – Pin is low.
-
bool quasar_radio_2_read_irq_pin(void)
Read the status of the on-board controller IRQ pin of the radio #2.
- Return values:
True – Pin is high.
False – Pin is low.
-
void quasar_radio_1_enable_irq_it(void)
Enable the on-board controller IRQ external interrupt of the radio #1.
-
void quasar_radio_2_enable_irq_it(void)
Enable the on-board controller IRQ external interrupt of the radio #2.
-
void quasar_radio_1_disable_irq_it(void)
Disable the on-board controller IRQ external interrupt of the radio #1.
-
void quasar_radio_2_disable_irq_it(void)
Disable the on-board controller IRQ external interrupt of the radio #2.
-
void quasar_radio_1_enable_non_blocking_transfer_irq_it(void)
Enable the DMA SPI interrupt of the radio #1.
-
void quasar_radio_2_enable_non_blocking_transfer_irq_it(void)
Enable the DMA SPI interrupt of the radio #2.
-
void quasar_radio_1_disable_non_blocking_transfer_irq_it(void)
Disable the DMA SPI interrupt of the radio #1.
-
void quasar_radio_2_disable_non_blocking_transfer_irq_it(void)
Disable the DMA SPI interrupt of the radio #2.
-
void quasar_radio_1_set_shutdown_pin(void)
Set the on-board controller shutdown pin of the radio #1.
-
void quasar_radio_2_set_shutdown_pin(void)
Set the on-board controller shutdown pin of the radio #2.
-
void quasar_radio_1_reset_shutdown_pin(void)
Reset the on-board controller shutdown pin of the radio #1.
-
void quasar_radio_2_reset_shutdown_pin(void)
Reset the on-board controller shutdown pin of the radio #2.
-
void quasar_radio_1_set_reset_pin(void)
Set the on-board controller reset pin of the radio #1.
-
void quasar_radio_2_set_reset_pin(void)
Set the on-board controller reset pin of the radio #2.
-
void quasar_radio_1_reset_reset_pin(void)
Reset the on-board controller reset pin of the radio #1.
-
void quasar_radio_2_reset_reset_pin(void)
Reset the on-board controller reset pin of the radio #2.
-
void quasar_radio_1_set_debug_en(void)
Set the radio 1`s debug enable pin.
Note
With the SR11x0 this pin may be used as VDDIO for the radio on the demo board.
-
void quasar_radio_1_reset_debug_en(void)
Reset the radio 1 debug enable pin.
Note
With the SR11x0 this pin may be used as VDDIO for the radio on the demo board.
-
void quasar_radio_1_context_switch(void)
Software interrupt trigger to force the cpu to get into the interrupt handler of the radio #1.
-
void quasar_radio_2_context_switch(void)
Software interrupt trigger to force the cpu to get into the interrupt handler of the radio #2.
-
void quasar_radio_callback_context_switch(void)
Induce a context switch to the pendSV ISR.
-
void quasar_radio_1_set_spi_baudrate(quasar_spi_prescaler_t prescaler, quasar_bsp_status_t *err)
Change the radio 1 SPI BaudRate.
Note
By default the SPI peripheral is initialized with a prescaler of 4.
- Parameters:
prescaler – [in] SPI BaudRate Prescaler.
err – [out] Pointer to quasar_bsp_status_t for error reporting.
-
void quasar_radio_2_set_spi_baudrate(quasar_spi_prescaler_t prescaler, quasar_bsp_status_t *err)
Change the radio 2 SPI BaudRate.
Note
By default the SPI peripheral is initialized with a prescaler of 4.
- Parameters:
prescaler – [in] SPI BaudRate Prescaler.
err – [out] Pointer to quasar_bsp_status_t for error reporting.
-
void quasar_radio_1_spi_set_cs(void)
Set the on-board controller SPI chip-select pin of the radio #1.
-
void quasar_radio_2_spi_set_cs(void)
Set the on-board controller SPI chip-select pin of the radio #2.
-
void quasar_radio_1_spi_reset_cs(void)
Reset the on-board controller SPI chip-select pin of the radio #1.
-
void quasar_radio_2_spi_reset_cs(void)
Reset the on-board controller SPI chip-select pin of the radio #2.
-
void quasar_radio_1_spi_transfer_full_duplex_blocking(uint8_t *tx_data, uint8_t *rx_data, uint16_t size)
Read and Write data full duplex on the radio #1 in blocking mode.
- Parameters:
tx_data – [in] Data buffer to write.
rx_data – [out] Data received.
size – [in] Size of the data.
-
void quasar_radio_2_spi_transfer_full_duplex_blocking(uint8_t *tx_data, uint8_t *rx_data, uint16_t size)
Read and Write data full duplex on the radio #2 in blocking mode.
- Parameters:
tx_data – [in] Data buffer to write.
rx_data – [out] Data received.
size – [in] Size of the data.
-
void quasar_radio_1_spi_transfer_full_duplex_non_blocking(uint8_t *tx_data, uint8_t *rx_data, uint16_t size)
Read and Write data full duplex on the radio #1 in non-blocking mode.
- Parameters:
tx_data – [in] Data buffer to write.
rx_data – [out] Data received.
size – [in] Size of the data.
-
void quasar_radio_2_spi_transfer_full_duplex_non_blocking(uint8_t *tx_data, uint8_t *rx_data, uint16_t size)
Read and Write data full duplex on the radio #2 in non-blocking mode.
- Parameters:
tx_data – [in] Data buffer to write.
rx_data – [out] Data received.
size – [in] Size of the data.
-
bool quasar_radio_1_is_spi_busy(void)
Read the status of the radio’s SPI of the radio #1.
- Return values:
true – SPI is busy.
false – SPI is not busy.
-
bool quasar_radio_2_is_spi_busy(void)
Read the status of the radio’s SPI of the radio #2.
- Return values:
true – SPI is busy.
false – SPI is not busy.
-
void quasar_radio_init_unused_qspi_gpios(void)
Initialize QSPI GPIOs as inputs while those pins are not used.
-
void quasar_radio_1_init_unused_spi_gpios(void)
Initialize SPI GPIOs as inputs while those pins are not used.
-
void quasar_radio_2_init_unused_spi_gpios(quasar_revision_t board_revision)
Initialize SPI GPIOs as inputs while those pins are not used.
- Parameters:
board_revision – [in] The board revision.
-
struct quasar_radio_config
- #include <quasar_radio.h>
Quasar BSP radio configuration.
Public Members
-
quasar_gpio_config_t reset_io
Selected GPIO configuration used for reset pin.
-
quasar_gpio_config_t shutdown_io
Selected GPIO configuration used for shutdown pin.
-
quasar_gpio_config_t irq_io
Selected GPIO configuration used for irq pin.
-
quasar_irq_priority_t irq_priority_of_irq_io
Selected IRQ priority used for irq pin.
-
quasar_spi_config_t spi_config
Selected SPI configuration.
-
quasar_dma_config_t dma_config
Selected DMA configuration.
-
quasar_qspi_config_t qspi_config
Selected QSPI configuration.
-
quasar_gpio_config_t reset_io