![]() |
SatNOGS-COMMS
4.1.0
A COMMS subsystem for CubeSats
|
Radio subsystem providing TX/RX functionality on UHF and S-Band. More...
#include <radio.hpp>
Classes | |
| class | mixer_param |
| Configuration parameters for the RF mixer. More... | |
| class | frame_len |
| class | io_conf |
| IO configuration that is necessary for the radio to operate. More... | |
| class | params |
| Initialization parameters of the radio class. More... | |
| class | fsk_conf |
| FSK configuration parameters. More... | |
| class | rx_info |
| Metadata for a received frame. More... | |
| class | rx_msg |
| The RX message accompanied by its metadata. More... | |
| class | rx_conf |
| RX configuration parameters. More... | |
| class | tx_conf |
Public Types | |
| enum class | clk_src : bool { INTERNAL = 0 , EXTERNAL = 1 } |
| PLL Reference Clock identifier. More... | |
| enum class | interface : uint8_t { UHF = 0 , SBAND = 1 } |
| Radio interface identifier. More... | |
| enum class | op_mode : uint8_t { BASEBAND , IQ } |
| Radio Operational mode. More... | |
| enum class | modulation : uint8_t { FSK , FSK4 , QPSK } |
| Supported modulation schemes. More... | |
Public Member Functions | |
| radio (const params &p, const io_conf &cnf, power &pwr, bsp::imsgq< rx_msg > &rx_msgq) | |
| Construct a new radio::radio object. | |
| void | enable (bool yes=true) |
| Enable/disable the radio chain. | |
| void | enable (interface iface, bool yes=true) |
| Enable/disable the radio chain of a specific band. | |
| bool | enabled () const |
| Checks if the radio transceiver is in an operational state. This means that their powesr sources are enabled and each component has been successfully initialized and there is basic connectivity with the radio ICs. | |
| void | stop (interface iface, size_t timeout_ms=1000) |
| Sets the FSM of the AT86RF215 interface to TRXOFF. | |
| bool | enabled (interface iface) const |
| Returns the state of a specific interface. | |
| rf_frontend::dir | direction (interface iface) const |
| Fetches the current direction (RX/TX) of the specific interface. | |
| void | set_frequency (interface iface, rf_frontend::dir d, uint32_t freq) |
| Sets the frequency and the direction. | |
| uint32_t | frequency (interface iface, rf_frontend::dir d) const |
| Returns the actual frequency that the hardware reports. | |
| void | set_tx_gain (interface iface, float gain) |
| Sets the TX gain of the AT86RF215. | |
| void | set_tx_conf (interface iface, const tx_conf &conf) |
| Performs the configuration of a specific interface for TX. | |
| void | tx (interface iface, const uint8_t *b) |
| Performs a TX in blocking mode. | |
| void | rx_async (interface iface, const rx_conf &conf) |
| Sets the radio in reception mode asynchronously. | |
| bool | mixer_lock () |
| Gets the status of the RF mixer lock. | |
| clk_src | get_clk_src () const |
| Retrieves the current clock source of the AT86RF215 PLL. | |
| rf_frontend09 & | uhf () |
| rf_frontend24 & | sband () |
| int | recv_msg (rx_msg &msg, size_t timeout_ms) |
| Gets an available message from the receive message queue. | |
| uint32_t | tx_len (interface iface) const |
| Retrieves the configured TX frame size for a specific interface. | |
| uint32_t | rx_len (interface iface) const |
| Retrieves the configured RX frame size for a specific interface. | |
| void | set_clk_src (clk_src src) |
| Sets the clock source for the AT86RF215 PLL. | |
| bool | get_pll_ls (interface iface) |
| Checks the PLL lock status of the AT86RF215 transceiver for the specified radio interface. | |
| void | register_rx_drop_callback (etl::delegate< void(interface)> callback) |
| Registers a callback for the RX drop message event. | |
Static Public Member Functions | |
| static int | trx_irq_handler () |
| The IRQ handler of the AT86RF215 IRQ. | |
Static Public Attributes | |
| static const uint16_t | UHF_AGC_VOUT_DAC_CH = 2 |
| static const uint16_t | SBAND_AGC_VOUT_DAC_CH = 1 |
Friends | |
| int | at86rf215_irq_user_callback (struct at86rf215 *h, uint8_t rf09_irqs, uint8_t rf24_irqs, uint8_t bbc0_irqs, uint8_t bbc1_irqs) |
Radio subsystem providing TX/RX functionality on UHF and S-Band.
The radio class is the main control interface for both UHF and S-Band interfaces as well as the RF frontends.
TX of frames is implemented for now using blocking mode. The calling task that calls the radio::tx() blocks until the successful transmission of the desired frame, or until a timeout. This is expected to change in later releases of the library.
On the other hand, reception is performed asynchronously. After a call of the radio::rx_async(), the radio enters RX mode and the calling task continues its execution. The radio will continue to stay in RX mode until either the radio interface is disabled, or a TX is performed by calling the radio::tx().
|
strong |
|
strong |
|
strong |
|
strong |
| satnogs::comms::lib::radio::radio | ( | const params & | p, |
| const io_conf & | cnf, | ||
| power & | pwr, | ||
| bsp::imsgq< rx_msg > & | rx_msgq ) |
Construct a new radio::radio object.
| p | configuration parameters |
| cnf | IO configuration for controlling the peripherals of the radio |
| pwr | reference to the power subsystem. Necessary to power up/down the radio components depending on the user calls |
| rx_msgq | a thread safe message queue that will hold the RX messages from both UHF and S-Band interfaces at they received and validated |
| rf_frontend::dir satnogs::comms::lib::radio::direction | ( | interface | iface | ) | const |
Fetches the current direction (RX/TX) of the specific interface.
| iface | the desired interface |
| void satnogs::comms::lib::radio::enable | ( | bool | yes = true | ) |
Enable/disable the radio chain.
| yes | true to enable, false to disable |
| void satnogs::comms::lib::radio::enable | ( | interface | iface, |
| bool | yes = true ) |
Enable/disable the radio chain of a specific band.
If the interface is already enabled, this method has no effect. If not, it enables and set the default direction which is rf_frontend::dir::RX
| iface | the target interface (UHF/S-Band) |
| yes | true to enable, false to disable |
| bool satnogs::comms::lib::radio::enabled | ( | ) | const |
Checks if the radio transceiver is in an operational state. This means that their powesr sources are enabled and each component has been successfully initialized and there is basic connectivity with the radio ICs.
| bool satnogs::comms::lib::radio::enabled | ( | interface | iface | ) | const |
| uint32_t satnogs::comms::lib::radio::frequency | ( | interface | iface, |
| rf_frontend::dir | d ) const |
Returns the actual frequency that the hardware reports.
| iface | the desired interface |
| d | the direction to check the tuned frequency |
| radio::clk_src satnogs::comms::lib::radio::get_clk_src | ( | ) | const |
Retrieves the current clock source of the AT86RF215 PLL.
| bool satnogs::comms::lib::radio::get_pll_ls | ( | interface | iface | ) |
| bool satnogs::comms::lib::radio::mixer_lock | ( | ) |
| int satnogs::comms::lib::radio::recv_msg | ( | rx_msg & | msg, |
| size_t | timeout_ms ) |
| void satnogs::comms::lib::radio::register_rx_drop_callback | ( | etl::delegate< void(interface)> | callback | ) |
Registers a callback for the RX drop message event.
In case the processing of the RX frames is slower than the rate they arrive, the radio subsystem will drop the new incoming frames. Users may notified by registering a custom callback.
| callback | the callback to regsiter. It should accept the interface that the drop event occured as parameter |
Sets the radio in reception mode asynchronously.
This method sets the radio in RX state with the given configuration parameters and exits immediately. Any received frame will be pushed on the reception message queue of the radio subsystem. Users can poll for received messages utilizing the radio::recv_msg() method
| iface | the desired interface |
| conf | the reception configuration for the RF frontend and the modem |
| uint32_t satnogs::comms::lib::radio::rx_len | ( | interface | iface | ) | const |
| rf_frontend24 & satnogs::comms::lib::radio::sband | ( | ) |
| void satnogs::comms::lib::radio::set_clk_src | ( | clk_src | src | ) |
Sets the clock source for the AT86RF215 PLL.
| src | radio::clk_src The clock source of the PLL |
| void satnogs::comms::lib::radio::set_frequency | ( | interface | iface, |
| rf_frontend::dir | d, | ||
| uint32_t | freq ) |
| void satnogs::comms::lib::radio::set_tx_gain | ( | interface | iface, |
| float | gain ) |
| void satnogs::comms::lib::radio::stop | ( | interface | iface, |
| size_t | timeout_ms = 1000 ) |
Sets the FSM of the AT86RF215 interface to TRXOFF.
| iface | the target interface (UHF/S-Band) |
| timeout_ms | timeout in ms |
|
static |
| void satnogs::comms::lib::radio::tx | ( | interface | iface, |
| const uint8_t * | b ) |
Performs a TX in blocking mode.
Performs a TX in blocking mode. If the radio was in RX state, it is automatically set to TX mode. After the end of the transmission (or on failure), the method leaves the radio in idle state.
| iface | the interface to send the frame |
| b | the frame buffer |
| uint32_t satnogs::comms::lib::radio::tx_len | ( | interface | iface | ) | const |
| rf_frontend09 & satnogs::comms::lib::radio::uhf | ( | ) |
|
friend |
|
static |
|
static |