25#include <etl/delegate.h>
26#include <etl/vector.h>
34#include <satnogs-comms-lib/version.hpp>
74 error_msg{
"Radio error",
"radioerr", err})
104 uint8_t rf24_irqs, uint8_t bbc0_irqs,
148 std::pair<uint32_t, uint32_t>
freq;
246 std::array<mixer_param, 2>
248 std::array<mixer_param, 2>
291 uint8_t
pdu[AT86RF215_MAX_PDU];
393 static constexpr uint8_t TX_RF_IRQM = 0x0;
395 static constexpr uint8_t TX_BB_IRQM = bit<uint8_t, 4>();
398 static constexpr uint8_t RX_RF_IRQM = 0x0;
401 static constexpr uint8_t RX_BB_IRQM = bit<uint8_t, 1>();
404 static constexpr uint32_t clk_rfsw_delay_us = 50;
407 static constexpr uint32_t pll_ch_sw_delay_us = 100;
413 std::array<mixer_param, 2> m_tx_mixer_params;
414 std::array<mixer_param, 2> m_rx_mixer_params;
415 mutable struct at86rf215 m_at86;
416 bool m_iface_enabled[2];
424 etl::delegate<void(
interface)> m_rx_drop;
430 at86rf215_enable(
bool enable =
true);
434 uint8_t rf24_irqs, uint8_t bbc0_irqs,
450 enable_uhf(
bool yes =
true);
453 enable_sband(
bool yes =
true);
Chrono device abstraction.
Message queue device abstraction.
A class representing error messages in the SatNOGS-COMMS system.
severity
Severity levels of exceptions.
@ MINOR
Failure having minimal impact.
@ MAJOR
Failure causing minor mission degradation.
exception(severity sev, const char *file, int lineno, const error_msg &err_msg)
Constructor for the exception class.
pll_ls_exception(string_type file_name, numeric_type line)
Manages power supplies and monitors subsystem status.
FSK configuration parameters.
at86rf215_fsk_srate_t rate
FSK data rate.
float excess_bw
FSK 3-dB bandwidth of the shaping filter.
IO configuration that is necessary for the radio to operate.
rf_frontend24::io_conf & rffe24_io
rf_frontend09::io_conf & rffe09_io
bsp::gpio & nreset
nRST signal for the AT86RF215
bsp::spi & spi_ctrl
SPI device controlling the AT86RF215.
Configuration parameters for the RF mixer.
std::pair< uint32_t, uint32_t > freq
Initialization parameters of the radio class.
std::array< mixer_param, 2 > rx_mixer_params
RF mixer parameters for the RX path.
frame_len uhf_len
The frame length of the UHF radio.
frame_len sband_len
The frame length of the UHF radio.
rf_frontend::params rffe24_params
Parameters of the S-Band frontend.
std::array< mixer_param, 2 > tx_mixer_params
RF mixer parameters for the TX path.
rf_frontend::params rffe09_params
Parameters of the UHF frontend.
RX configuration parameters.
fsk_conf fsk
FSK parameters.
uint32_t sync
The synchronization word.
rf_frontend::filter filter
Hardware filter selection.
uint32_t freq
The desired RX frequency to set.
rf_frontend::rx_gain_params gain
Gain settings to set.
uint8_t preamble_len
The length of the preamble in bytes.
Metadata for a received frame.
float edv
Not currently in use.
uint32_t len
The frame length.
The RX message accompanied by its metadata.
uint8_t pdu[AT86RF215_MAX_PDU]
Buffer to hold the received frame.
uint32_t sync
The synchronization word.
fsk_conf fsk
FSK parameters.
uint32_t freq
The desired RX frequency to set.
uint8_t preamble_len
The length of the preamble in bytes.
radio_exception(string_type file_name, numeric_type line, int err)
radio_exception(string_type file_name, numeric_type line)
void rx_async(interface iface, const rx_conf &conf)
Sets the radio in reception mode asynchronously.
rf_frontend::dir direction(interface iface) const
Fetches the current direction (RX/TX) of the specific interface.
op_mode
Radio Operational mode.
@ BASEBAND
The baseband core is active.
@ IQ
The IQ functionality is active.
static const uint16_t UHF_AGC_VOUT_DAC_CH
static int trx_irq_handler()
The IRQ handler of the AT86RF215 IRQ.
modulation
Supported modulation schemes.
void tx(interface iface, const uint8_t *b)
Performs a TX in blocking mode.
friend int at86rf215_irq_user_callback(struct at86rf215 *h, uint8_t rf09_irqs, uint8_t rf24_irqs, uint8_t bbc0_irqs, uint8_t bbc1_irqs)
void register_rx_drop_callback(etl::delegate< void(interface)> callback)
Registers a callback for the RX drop message event.
void set_frequency(interface iface, rf_frontend::dir d, uint32_t freq)
Sets the frequency and the direction.
interface
Radio interface identifier.
bool mixer_lock()
Gets the status of the RF mixer lock.
clk_src
PLL Reference Clock identifier.
@ INTERNAL
Internal Crystal Oscillator.
@ EXTERNAL
External Reference Clock (TCXO).
uint32_t frequency(interface iface, rf_frontend::dir d) const
Returns the actual frequency that the hardware reports.
uint32_t rx_len(interface iface) const
Retrieves the configured RX frame size for a specific interface.
radio(const params &p, const io_conf &cnf, power &pwr, bsp::imsgq< rx_msg > &rx_msgq)
Construct a new radio::radio object.
void set_tx_conf(interface iface, const tx_conf &conf)
Performs the configuration of a specific interface for TX.
void stop(interface iface, size_t timeout_ms=1000)
Sets the FSM of the AT86RF215 interface to TRXOFF.
bool get_pll_ls(interface iface)
Checks the PLL lock status of the AT86RF215 transceiver for the specified radio interface.
static const uint16_t SBAND_AGC_VOUT_DAC_CH
void enable(bool yes=true)
Enable/disable the radio chain.
clk_src get_clk_src() const
Retrieves the current clock source of the AT86RF215 PLL.
void set_tx_gain(interface iface, float gain)
Sets the TX gain of the AT86RF215.
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.
bool enabled() const
Checks if the radio transceiver is in an operational state. This means that their powesr sources are ...
void set_clk_src(clk_src src)
Sets the clock source for the AT86RF215 PLL.
RF-frontend for the UHF interface.
IO configuration for controlling the various peripherals of the S-Band frontend.
RF-frontend for the S-Band interface.
RF frontend initialization settings.
RX gain settings for the two different gain stages. Gain0 stage corresponds to the first stage (close...
unsupported_freq_exception(string_type file_name, numeric_type line)
#define ERADIO
Error in radio.
#define EPLL
PLL unlocked.
#define EBADFREQ
Unsupported frequency.
int at86rf215_irq_user_callback(struct at86rf215 *h, uint8_t rf09_irqs, uint8_t rf24_irqs, uint8_t bbc0_irqs, uint8_t bbc1_irqs)