Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
superbitrf.h File Reference
+ Include dependency graph for superbitrf.h:
+ This graph shows which files directly or indirectly include this file:

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. More...
 
#define SUPERBITRF_SYNC_RECV_TIME   7000
 The time to wait for a sync packet on a channel in microseconds. More...
 
#define SUPERBITRF_RECV_TIME   20000
 The time to wait for a transfer packet on a channel in microseconds. More...
 
#define SUPERBITRF_RECV_SHORT_TIME   6000
 The time to wait for a transfer packet short on a channel in microseconds. More...
 
#define SUPERBITRF_DATARECV_TIME   10000
 The time to wait for a data packet on a channel in microseconds. More...
 
#define SUPERBITRF_DATARECVB_TIME   6000
 The time to wait for a data packet on a channel during bind in microseconds. More...
 
#define IS_DSM2(x)   (x == DSM_DSM2P || x == DSM_DSM2_1 || x == DSM_DSM2_2)
 
#define IS_DSMX(x)   (!IS_DSM2(x))
 
#define SuperbitRFInit()   { }
 
#define SuperbitRFCheckFreeSpace(_x)   (((superbitrf.tx_insert_idx+1) %128) != superbitrf.tx_extract_idx)
 
#define SuperbitRFTransmit(_x)
 
#define SuperbitRFSendMessage()   { }
 
#define SuperbitRFCheckAndParse()   { }
 

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, 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. More...
 
void superbitrf_event (void)
 The superbitrf on event call. More...
 
void superbitrf_set_mfg_id (uint32_t id)
 
void superbitrf_set_protocol (uint8_t protocol)
 

Variables

struct SuperbitRF superbitrf
 

Macro Definition Documentation

#define IS_DSM2 (   x)    (x == DSM_DSM2P || x == DSM_DSM2_1 || x == DSM_DSM2_2)

Definition at line 69 of file superbitrf.h.

Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().

#define IS_DSMX (   x)    (!IS_DSM2(x))

Definition at line 70 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 36 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 40 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 41 of file superbitrf.h.

Referenced by superbitrf_event().

#define SUPERBITRF_RECV_SHORT_TIME   6000

The time to wait for a transfer packet short on a channel in microseconds.

Definition at line 39 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 38 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 37 of file superbitrf.h.

Referenced by superbitrf_event().

#define SuperbitRFCheckAndParse ( )    { }

Definition at line 130 of file superbitrf.h.

#define SuperbitRFCheckFreeSpace (   _x)    (((superbitrf.tx_insert_idx+1) %128) != superbitrf.tx_extract_idx)

Definition at line 124 of file superbitrf.h.

#define SuperbitRFInit ( )    { }

Definition at line 123 of file superbitrf.h.

#define SuperbitRFSendMessage ( )    { }

Definition at line 129 of file superbitrf.h.

#define SuperbitRFTransmit (   _x)
Value:
{ \
}
uint8_t tx_buffer[128]
The transmit buffer.
Definition: superbitrf.h:110
uint8_t tx_insert_idx
The transmit buffer insert index.
Definition: superbitrf.h:111

Definition at line 125 of file superbitrf.h.

Enumeration Type Documentation

Enumerator
DSM_DSM2_1 

The original DSM2 protocol with 1 packet of data.

DSM_DSM2_2 

The original DSM2 protocol with 2 packets of data.

DSM_DSM2P 

Our own DSM2 Paparazzi protocol.

DSM_DSMXP 

Our own DSMX Paparazzi protocol.

DSM_DSMX_1 

The original DSMX protocol with 1 packet of data.

DSM_DSMX_2 

The original DSMX protocol with 2 packets of data.

DSM_DSM2_1 

The original DSM2 protocol with 1 packet of data.

DSM_DSM2_2 

The original DSM2 protocol with 2 packets of data.

DSM_DSM2P 

Our own DSM2 Paparazzi protocol.

DSM_DSMXP 

Our own DSMX Paparazzi protocol.

DSM_DSMX_1 

The original DSMX protocol with 1 packet of data.

DSM_DSMX_2 

The original DSMX protocol with 2 packets of data.

Definition at line 61 of file superbitrf.h.

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 55 of file superbitrf.h.

Enumerator
SUPERBITRF_UNINIT 

The chip isn't initialized.

SUPERBITRF_INIT_BINDING 

The chip is initializing binding mode.

SUPERBITRF_INIT_TRANSFER 

The chip is initializing transfer mode.

SUPERBITRF_BINDING 

The chip is in binding mode.

SUPERBITRF_SYNCING_A 

The chip is in synchronizing mode for channel A.

SUPERBITRF_SYNCING_B 

The chip is in synchronizing mode for channel B.

SUPERBITRF_TRANSFER 

The chip is in transfer mode.

Definition at line 44 of file superbitrf.h.

Function Documentation

void superbitrf_event ( void  )

The superbitrf on event call.

Definition at line 254 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, FALSE, 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, Cyrf6936::status, SuperbitRF::status, superbitrf, SUPERBITRF_BIND_RECV_TIME, SUPERBITRF_BINDING, SUPERBITRF_DATARECV_TIME, SUPERBITRF_DATARECVB_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_UNINIT, SuperbitRF::timeouts, SuperbitRF::timer, SuperbitRF::timer_overflow, SuperbitRF::transfer_timeouts, TRUE, SuperbitRF::tx_buffer, SuperbitRF::tx_extract_idx, SuperbitRF::tx_insert_idx, Cyrf6936::tx_irq_status, and SuperbitRF::tx_packet_count.

+ Here is the call graph for this function:

void superbitrf_set_mfg_id ( uint32_t  id)

Definition at line 34 of file superbitrf.c.

References SuperbitRF::bind_mfg_id, SuperbitRF::bind_mfg_id32, SuperbitRF::crc_seed, SuperbitRF::data_col, SuperbitRF::sop_col, and superbitrf.

Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().

+ Here is the caller graph for this function:

void superbitrf_set_protocol ( uint8_t  protocol)

Definition at line 38 of file superbitrf.c.

References SuperbitRF::protocol, SuperbitRF::resolution, and superbitrf.

Referenced by superbitrf_event(), and superbitrf_receive_packet_cb().

+ Here is the caller graph for this function:

Variable Documentation