|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "mcu_periph/gpio.h"#include "peripherals/cyrf6936.h"#include "pprzlink/pprzlink_device.h"#include "pprzlink/pprz_transport.h"#include "modules/datalink/datalink.h"Go to the source code of this file.
Data Structures | |
| struct | SuperbitRF |
Macros | |
| #define | SUPERBITRF_BIND_RECV_TIME 10000 |
| The time to wait for a bind packet on a channel in microseconds. | |
| #define | SUPERBITRF_SYNC_RECV_TIME 7000 |
| The time to wait for a sync packet on a channel in microseconds. | |
| #define | SUPERBITRF_RECV_TIME 20000 |
| The time to wait for a transfer packet on a channel in microseconds. | |
| #define | SUPERBITRF_RECV_SHORT_TIME 6000 |
| The time to wait for a transfer packet short on a channel in microseconds. | |
| #define | SUPERBITRF_DATARECV_TIME 10000 |
| The time to wait for a data packet on a channel in microseconds. | |
| #define | SUPERBITRF_DATARECVB_TIME 6000 |
| The time to wait for a data packet on a channel during bind in microseconds. | |
| #define | IS_DSM2(x) |
| #define | IS_DSMX(x) |
| #define | SUPERBITRF_TX_BUFFER_SIZE 128 |
Enumerations | |
| enum | SuperbitRFStatus { SUPERBITRF_UNINIT , SUPERBITRF_INIT_BINDING , SUPERBITRF_INIT_TRANSFER , SUPERBITRF_BINDING , SUPERBITRF_SYNCING_A , SUPERBITRF_SYNCING_B , SUPERBITRF_TRANSFER } |
| enum | dsm_resolution { SUPERBITRF_10_BIT_RESOLUTION = 0x00 , SUPERBITRF_11_BIT_RESOLUTION = 0x01 } |
| enum | dsm_protocol { DSM_DSM2_1 = 0x01 , DSM_DSM2_2 = 0x02 , DSM_DSM2P = 0x10 , DSM_DSMXP = 0x11 , DSM_DSMX_1 = 0xA2 , DSM_DSMX_2 = 0xB2 } |
Functions | |
| void | superbitrf_init (void) |
| Initialize the superbitrf. | |
| void | superbitrf_event (void) |
| The superbitrf on event call. | |
| void | superbitrf_dl_init (void) |
| Initialize datalink part. | |
| void | superbitrf_dl_event (void) |
| The superbitrf datalink event call. | |
| void | superbitrf_set_mfg_id (uint32_t id) |
| void | superbitrf_set_protocol (uint8_t protocol) |
Variables | |
| struct SuperbitRF | superbitrf |
| struct pprz_transport | pprz_srf_tp |
| struct SuperbitRF |
Definition at line 43 of file superbitrf.h.
| Data Fields | ||
|---|---|---|
| uint8_t | bind_mfg_id[4] | The MFG id where the receiver is bound to. |
| uint32_t | bind_mfg_id32 | The MFG id where the receiver is bound to in uint32. |
| uint8_t | channel | The current channel number. |
| uint8_t | channel_idx | The current channel index. |
| uint8_t | channels[23] | The channels used for DSM2/DSMX. |
| uint16_t | crc_seed | The CRC seed that is calculated with the bind MFG id. |
| struct Cyrf6936 | cyrf6936 | The cyrf chip used. |
| uint8_t | data_col | The data code column number calculated with the bind MFG id. |
| struct link_device | device | Generic device interface. |
| uint32_t | irq_count | How many interrupts are made. |
| uint8_t | num_channels | The number of channels the transmitter has. |
| bool | packet_loss | When we have packet loss last packet. |
| uint8_t | packet_loss_bit | The packet loss indicating bit. |
| enum dsm_protocol | protocol | The protocol the transmitter uses. |
| uint32_t | rc_count | How many valid RC packages are received. |
| bool | rc_frame_available | When a RC frame is available. |
| int16_t | rc_values[14] | The rc values from the packet. |
| enum dsm_resolution | resolution | The resolution that the transmitter has. |
| uint32_t | resync_count | The amount of resyncs needed during transfer. |
| uint32_t | rx_packet_count | How many packets are received(also the invalid). |
| struct pprz_transport | rx_transport | The receive transport. |
| uint8_t | sop_col | The sop code column number calculated with the bind MFG id. |
| uint8_t | state | The states each status can be in. |
| enum SuperbitRFStatus | status | The status of the superbitRF. |
| uint8_t | timeouts | The amount of timeouts. |
| uint32_t | timer | The timer in microseconds. |
| bool | timer_overflow | When the timer overflows. |
| uint32_t | timing1 | Time between last receive in microseconds. |
| uint32_t | timing2 | Time between second last receive in microseconds. |
| uint32_t | transfer_timeouts | The amount of timeouts during transfer. |
| uint8_t | tx_buffer[SUPERBITRF_TX_BUFFER_SIZE] | The transmit buffer. |
| uint8_t | tx_extract_idx | The transmit buffer extract index. |
| uint8_t | tx_insert_idx | The transmit buffer insert index. |
| uint32_t | tx_packet_count | How many packets are send(also the invalid). |
| uint32_t | uplink_count | How many valid uplink packages are received. |
| #define IS_DSM2 | ( | x | ) |
Definition at line 70 of file superbitrf.h.
Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().
| #define IS_DSMX | ( | x | ) |
Definition at line 71 of file superbitrf.h.
Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().
| #define SUPERBITRF_BIND_RECV_TIME 10000 |
The time to wait for a bind packet on a channel in microseconds.
Definition at line 37 of file superbitrf.h.
Referenced by superbitrf_event().
| #define SUPERBITRF_DATARECV_TIME 10000 |
The time to wait for a data packet on a channel in microseconds.
Definition at line 41 of file superbitrf.h.
Referenced by superbitrf_event().
| #define SUPERBITRF_DATARECVB_TIME 6000 |
The time to wait for a data packet on a channel during bind in microseconds.
Definition at line 42 of file superbitrf.h.
| #define SUPERBITRF_RECV_SHORT_TIME 6000 |
The time to wait for a transfer packet short on a channel in microseconds.
Definition at line 40 of file superbitrf.h.
Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().
| #define SUPERBITRF_RECV_TIME 20000 |
The time to wait for a transfer packet on a channel in microseconds.
Definition at line 39 of file superbitrf.h.
Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().
| #define SUPERBITRF_SYNC_RECV_TIME 7000 |
The time to wait for a sync packet on a channel in microseconds.
Definition at line 38 of file superbitrf.h.
Referenced by superbitrf_event().
| #define SUPERBITRF_TX_BUFFER_SIZE 128 |
Definition at line 73 of file superbitrf.h.
Referenced by superbitrf_check_free_space(), superbitrf_event(), and superbitrf_transmit().
| enum dsm_protocol |
Definition at line 62 of file superbitrf.h.
| enum dsm_resolution |
| Enumerator | |
|---|---|
| SUPERBITRF_10_BIT_RESOLUTION | The transmitter has a 10 bit resolution. |
| SUPERBITRF_11_BIT_RESOLUTION | The transmitter has a 11 bit resolution. |
Definition at line 56 of file superbitrf.h.
| enum SuperbitRFStatus |
Definition at line 45 of file superbitrf.h.
|
extern |
The superbitrf datalink event call.
Definition at line 294 of file superbitrf.c.
References datalink_get_buffer(), dl_msg_available, DlCheckAndParse(), DOWNLINK_DEVICE, pprz_srf_tp, and SUPERBITRF_UPDATE_DL.
|
extern |
|
extern |
The superbitrf on event call.
Definition at line 322 of file superbitrf.c.
References 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, get_sys_time_usec(), gpio_get(), IS_DSM2, IS_DSMX, LED_ON, LED_TOGGLE, pn_bind, pn_codes, PRINT_CONFIG_VAR(), SPEKTRUM_BIND_PIN, SPEKTRUM_BIND_PIN_PORT, 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, and SUPERBITRF_UNINIT.
Referenced by superbitrf_rc_event().
|
extern |
Initialize the superbitrf.
Definition at line 242 of file superbitrf.c.
References cyrf6936_init(), DefaultPeriodic, gpio_setup_input(), null_byte_function(), null_function(), register_periodic_telemetry(), send_superbit(), SPEKTRUM_BIND_PIN, SPEKTRUM_BIND_PIN_PORT, 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(), and SUPERBITRF_UNINIT.
Referenced by superbitrf_rc_init().
|
extern |
Definition at line 34 of file superbitrf.c.
References superbitrf.
Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().
|
extern |
Definition at line 39 of file superbitrf.c.
References SuperbitRF::protocol, and superbitrf.
Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().
|
extern |
Definition at line 77 of file superbitrf.c.
Referenced by superbitrf_dl_event(), and superbitrf_dl_init().
|
extern |
Definition at line 32 of file superbitrf.c.
Referenced by send_superbit(), superbitrf_event(), superbitrf_gen_dsmx_channels(), superbitrf_init(), superbitrf_rc_event(), superbitrf_receive_packet_cb(), superbitrf_send_packet_cb(), superbitrf_set_mfg_id(), and superbitrf_set_protocol().