![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/datalink/superbitrf.h"
#include <string.h>
#include "paparazzi.h"
#include "led.h"
#include "mcu_periph/spi.h"
#include "mcu_periph/sys_time.h"
#include "mcu_periph/gpio.h"
#include "modules/core/settings.h"
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
Variables | |
struct SuperbitRF | superbitrf |
struct pprz_transport | pprz_srf_tp |
static const uint8_t | cyrf_stratup_config [][2] |
static const uint8_t | cyrf_bind_config [][2] |
static const uint8_t | cyrf_transfer_config [][2] |
const uint8_t | cyrf_abort_receive [][2] |
const uint8_t | cyrf_start_receive [][2] |
static const uint8_t | pn_codes [5][9][8] |
static const uint8_t | pn_bind [] = { 0x98, 0x88, 0x1B, 0xE4, 0x30, 0x79, 0x03, 0x84 } |
Definition at line 59 of file superbitrf.c.
Definition at line 55 of file superbitrf.c.
Definition at line 65 of file superbitrf.c.
Definition at line 49 of file superbitrf.c.
Definition at line 45 of file superbitrf.c.
Definition at line 39 of file superbitrf.c.
Definition at line 70 of file superbitrf.c.
|
static |
Definition at line 237 of file superbitrf.c.
Referenced by superbitrf_init().
|
static |
Definition at line 236 of file superbitrf.c.
Referenced by superbitrf_init().
|
static |
Definition at line 188 of file superbitrf.c.
References SuperbitRF::bind_mfg_id32, SuperbitRF::cyrf6936, dev, foo, SuperbitRF::irq_count, Cyrf6936::mfg_id, SuperbitRF::rc_count, SuperbitRF::resync_count, SuperbitRF::rx_packet_count, SuperbitRF::status, status, Cyrf6936::status, superbitrf, SuperbitRF::timing1, SuperbitRF::timing2, SuperbitRF::transfer_timeouts, SuperbitRF::tx_packet_count, and SuperbitRF::uplink_count.
Referenced by superbitrf_init().
|
static |
Definition at line 211 of file superbitrf.c.
References foo, p, and SUPERBITRF_TX_BUFFER_SIZE.
Referenced by superbitrf_init().
The superbitrf datalink event call.
Definition at line 294 of file superbitrf.c.
References dl_buffer, dl_msg_available, DlCheckAndParse(), DOWNLINK_DEVICE, pprz_srf_tp, and SUPERBITRF_UPDATE_DL.
Initialize datalink part.
Definition at line 285 of file superbitrf.c.
References foo, and pprz_srf_tp.
The superbitrf on event call.
Definition at line 322 of file superbitrf.c.
References SuperbitRF::bind_mfg_id, SuperbitRF::bind_mfg_id32, SuperbitRF::channel, SuperbitRF::channel_idx, SuperbitRF::channels, SuperbitRF::crc_seed, SuperbitRF::cyrf6936, CYRF6936_IDLE, cyrf6936_multi_write(), cyrf6936_read_rx_irq_status_packet(), cyrf6936_send(), cyrf6936_write(), cyrf6936_write_chan_sop_data_crc(), cyrf_abort_receive, cyrf_bind_config, CYRF_CHANNEL, CYRF_RXC_IRQ, CYRF_RXE_IRQ, cyrf_start_receive, cyrf_stratup_config, cyrf_transfer_config, CYRF_TXC_IRQ, CYRF_TXE_IRQ, SuperbitRF::data_col, foo, get_sys_time_usec(), gpio_get(), Cyrf6936::has_irq, SuperbitRF::irq_count, IS_DSM2, IS_DSMX, LED_ON, LED_TOGGLE, SuperbitRF::num_channels, SuperbitRF::packet_loss, SuperbitRF::packet_loss_bit, pn_bind, pn_codes, PRINT_CONFIG_VAR(), SuperbitRF::protocol, SuperbitRF::resync_count, Cyrf6936::rx_irq_status, Cyrf6936::rx_packet, SuperbitRF::rx_packet_count, Cyrf6936::rx_status, SuperbitRF::sop_col, SPEKTRUM_BIND_PIN, SPEKTRUM_BIND_PIN_PORT, SuperbitRF::state, SuperbitRF::status, Cyrf6936::status, superbitrf, SUPERBITRF_BIND_RECV_TIME, SUPERBITRF_BINDING, SUPERBITRF_DATARECV_TIME, SUPERBITRF_DRDY_PIN, SUPERBITRF_DRDY_PORT, SUPERBITRF_FORCE_DSM2, superbitrf_gen_dsmx_channels(), SUPERBITRF_INIT_BINDING, SUPERBITRF_INIT_TRANSFER, superbitrf_receive_packet_cb(), SUPERBITRF_RECV_SHORT_TIME, SUPERBITRF_RECV_TIME, superbitrf_send_packet_cb(), superbitrf_set_mfg_id(), superbitrf_set_protocol(), SUPERBITRF_SYNC_RECV_TIME, SUPERBITRF_SYNCING_A, SUPERBITRF_SYNCING_B, SUPERBITRF_TRANSFER, SUPERBITRF_TX_BUFFER_SIZE, SUPERBITRF_UNINIT, SuperbitRF::timeouts, SuperbitRF::timer, SuperbitRF::timer_overflow, SuperbitRF::transfer_timeouts, SuperbitRF::tx_buffer, SuperbitRF::tx_extract_idx, SuperbitRF::tx_insert_idx, Cyrf6936::tx_irq_status, and SuperbitRF::tx_packet_count.
Referenced by superbitrf_rc_event().
Generate the channels.
Definition at line 1118 of file superbitrf.c.
References SuperbitRF::bind_mfg_id, SuperbitRF::channels, foo, idx, and superbitrf.
Referenced by superbitrf_event().
Initialize the superbitrf.
Definition at line 242 of file superbitrf.c.
References SuperbitRF::bind_mfg_id32, SuperbitRF::cyrf6936, cyrf6936_init(), DefaultPeriodic, SuperbitRF::device, foo, gpio_setup_input(), null_byte_function(), null_function(), SuperbitRF::num_channels, SuperbitRF::protocol, register_periodic_telemetry(), SuperbitRF::rx_packet_count, send_superbit(), SPEKTRUM_BIND_PIN, SPEKTRUM_BIND_PIN_PORT, SuperbitRF::state, SuperbitRF::status, superbitrf, superbitrf_check_free_space(), SUPERBITRF_DRDY_PIN, SUPERBITRF_DRDY_PORT, SUPERBITRF_RST_PIN, SUPERBITRF_RST_PORT, superbitrf_send(), SUPERBITRF_SPI_DEV, superbitrf_transmit(), superbitrf_transmit_buffer(), SUPERBITRF_UNINIT, SuperbitRF::timer, SuperbitRF::tx_extract_idx, SuperbitRF::tx_insert_idx, and SuperbitRF::tx_packet_count.
Referenced by superbitrf_rc_init().
|
inlinestatic |
Parse a radio channel packet.
Definition at line 1089 of file superbitrf.c.
References foo, MAX_PPRZ, and val.
Referenced by superbitrf_receive_packet_cb().
|
inlinestatic |
When we receive a packet this callback is called.
Definition at line 787 of file superbitrf.c.
References SuperbitRF::bind_mfg_id, SuperbitRF::channel, SuperbitRF::channel_idx, SuperbitRF::channels, SuperbitRF::crc_seed, SuperbitRF::cyrf6936, cyrf6936_multi_write(), CYRF_BAD_CRC, cyrf_start_receive, DatalinkFillDlBuffer, dl_msg_available, foo, get_sys_time_usec(), IS_DSM2, IS_DSMX, SuperbitRF::num_channels, SuperbitRF::packet_loss, SuperbitRF::packet_loss_bit, SuperbitRF::protocol, SuperbitRF::rc_count, SuperbitRF::rc_frame_available, SuperbitRF::rc_values, SuperbitRF::resolution, Cyrf6936::rx_count, SuperbitRF::rx_transport, settings_StoreSettings, SuperbitRF::state, SuperbitRF::status, status, superbitrf, SUPERBITRF_BINDING, SUPERBITRF_FORCE_DSM2, SUPERBITRF_INIT_TRANSFER, superbitrf_radio_to_channels(), SUPERBITRF_RECV_SHORT_TIME, SUPERBITRF_RECV_TIME, superbitrf_set_mfg_id(), superbitrf_set_protocol(), SUPERBITRF_SYNCING_A, SUPERBITRF_SYNCING_B, SUPERBITRF_TRANSFER, SuperbitRF::timeouts, SuperbitRF::timer, SuperbitRF::timing1, SuperbitRF::timing2, and SuperbitRF::uplink_count.
Referenced by superbitrf_event().
|
static |
Definition at line 234 of file superbitrf.c.
Referenced by superbitrf_init().
Definition at line 1058 of file superbitrf.c.
References SuperbitRF::state, SuperbitRF::status, superbitrf, SUPERBITRF_SYNCING_A, SUPERBITRF_SYNCING_B, and SUPERBITRF_TRANSFER.
Referenced by superbitrf_event().
Definition at line 299 of file superbitrf.c.
References SuperbitRF::bind_mfg_id, SuperbitRF::bind_mfg_id32, SuperbitRF::crc_seed, SuperbitRF::data_col, SuperbitRF::sop_col, and superbitrf.
Definition at line 313 of file superbitrf.c.
References SuperbitRF::protocol, SuperbitRF::resolution, and superbitrf.
|
static |
Definition at line 220 of file superbitrf.c.
References byte, p, and SUPERBITRF_TX_BUFFER_SIZE.
Referenced by superbitrf_init(), and superbitrf_transmit_buffer().
|
static |
Definition at line 226 of file superbitrf.c.
References fd, p, and superbitrf_transmit().
Referenced by superbitrf_init().
Definition at line 115 of file superbitrf.c.
Referenced by superbitrf_event().
Definition at line 100 of file superbitrf.c.
Referenced by superbitrf_event().
Definition at line 120 of file superbitrf.c.
Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().
Definition at line 86 of file superbitrf.c.
Referenced by superbitrf_event().
Definition at line 108 of file superbitrf.c.
Referenced by superbitrf_event().
Definition at line 183 of file superbitrf.c.
Referenced by superbitrf_event().
Definition at line 126 of file superbitrf.c.
Referenced by superbitrf_event().
struct pprz_transport pprz_srf_tp |
Definition at line 77 of file superbitrf.c.
Referenced by superbitrf_dl_event(), and superbitrf_dl_init().
struct SuperbitRF superbitrf |
Definition at line 74 of file superbitrf.c.