dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Module

Files

file  tbs_smartaudio.h
 This module configures the video transmitter.
 
file  tbs_smartaudio.c
 This module configures the video transmitter.
 
file  VTXConfig.c
 This module configures the video transmitter.
 

Data Structures

struct  __attribute__
 

Macros

#define NUM_TBS_CH   40
 
#define STACK_SIZE_BYTES   560
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define MAX_FAILS   5
 
#define TBS_MIN_BAUD   4600
 
#define TBS_MAX_BAUD   5100
 

Enumerations

enum  TBS_VTX_PROTOCOL { UNKNOWN, TBS_SMARTAUDIO_1, TBS_SMARTAUDIO_2 }
 
enum  VTXTYPE { VTX_NONE, VTX_TBS_SMARTAUDIO }
 
enum  STATE { DISCONNECTED, CONNECTED }
 

Functions

int32_t tbsvtx_get_state (uintptr_t usart_id, VTXInfoData *info)
 
int32_t tbsvtx_set_freq (uintptr_t usart_id, uint16_t frequency)
 
int32_t tbsvtx_set_power (uintptr_t usart_id, uint16_t power)
 
static int32_t tbsvtx_tx_msg (uintptr_t usart_id, uint8_t *buff, uint8_t n_bytes)
 
int32_t tbsvtx_rx_msg (uintptr_t usart_id, uint8_t n_bytes, uint8_t *buff, uint16_t timeout)
 
static int32_t tbsvtx_set_mode (uintptr_t usart_id, uint8_t mode)
 
static void vtxConfigTask (void *parameters)
 
int32_t VTXConfigStart (void)
 
int32_t VTXConfigInitialize (void)
 
 MODULE_INITCALL (VTXConfigInitialize, VTXConfigStart)
 

Variables

const uint16_t TBS_CH [NUM_TBS_CH]
 
uint8_t __attribute__::command
 
uint8_t __attribute__::length
 
uint8_t __attribute__::channel
 
uint8_t __attribute__::pwr_level
 
uint8_t __attribute__::operation_mode
 
uint8_t __attribute__::freq0
 
uint8_t __attribute__::freq1
 
uint8_t __attribute__::crc
 
uint8_t __attribute__::dummy
 
uint8_t __attribute__::pwr
 
uint8_t __attribute__::mode
 
static enum TBS_VTX_PROTOCOL vtx_protocol = UNKNOWN
 
static const uint16_t BAND_5G8_A_FREQS [VTXSETTINGS_BAND_5G8_A_FREQUENCY_MAXOPTVAL+1]
 
static const uint16_t BAND_5G8_B_FREQS [VTXSETTINGS_BAND_5G8_B_FREQUENCY_MAXOPTVAL+1]
 
static const uint16_t BAND_5G8_E_FREQS [VTXSETTINGS_BAND_5G8_E_FREQUENCY_MAXOPTVAL+1]
 
static const uint16_t AIRWAVE_FREQS [VTXSETTINGS_AIRWAVE_FREQUENCY_MAXOPTVAL+1]
 
static const uint16_t RACEBAND_FREQS [VTXSETTINGS_RACEBAND_FREQUENCY_MAXOPTVAL+1]
 
static const uint16_t VTX_POWER [VTXSETTINGS_POWER_GLOBAL_MAXOPTVAL+1]
 
static uint32_t vtxConfigPort
 
static bool module_enabled = false
 
static volatile bool settings_updated = false
 
static struct pios_thread * vtxConfigTaskHandle
 
static enum VTXTYPE vtx_type = VTX_NONE
 

Detailed Description

Macro Definition Documentation

#define MAX_FAILS   5

Definition at line 66 of file VTXConfig.c.

#define NUM_TBS_CH   40

Definition at line 41 of file tbs_smartaudio.c.

#define STACK_SIZE_BYTES   560

Definition at line 63 of file VTXConfig.c.

#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW

Definition at line 64 of file VTXConfig.c.

#define TBS_MAX_BAUD   5100

Definition at line 68 of file VTXConfig.c.

#define TBS_MIN_BAUD   4600

Definition at line 67 of file VTXConfig.c.

Enumeration Type Documentation

enum STATE
Enumerator
DISCONNECTED 
CONNECTED 

Definition at line 56 of file VTXConfig.c.

Enumerator
UNKNOWN 
TBS_SMARTAUDIO_1 
TBS_SMARTAUDIO_2 

Definition at line 51 of file tbs_smartaudio.c.

enum VTXTYPE
Enumerator
VTX_NONE 
VTX_TBS_SMARTAUDIO 

Definition at line 51 of file VTXConfig.c.

Function Documentation

MODULE_INITCALL ( VTXConfigInitialize  ,
VTXConfigStart   
)
int32_t tbsvtx_get_state ( uintptr_t  usart_id,
VTXInfoData *  info 
)

Definition at line 158 of file tbs_smartaudio.c.

int32_t tbsvtx_rx_msg ( uintptr_t  usart_id,
uint8_t  n_bytes,
uint8_t *  buff,
uint16_t  timeout 
)

Definition at line 113 of file tbs_smartaudio.c.

int32_t tbsvtx_set_freq ( uintptr_t  usart_id,
uint16_t  frequency 
)

Definition at line 244 of file tbs_smartaudio.c.

static int32_t tbsvtx_set_mode ( uintptr_t  usart_id,
uint8_t  mode 
)
static

Definition at line 276 of file tbs_smartaudio.c.

int32_t tbsvtx_set_power ( uintptr_t  usart_id,
uint16_t  power 
)

Definition at line 295 of file tbs_smartaudio.c.

static int32_t tbsvtx_tx_msg ( uintptr_t  usart_id,
uint8_t *  buff,
uint8_t  n_bytes 
)
static

Definition at line 97 of file tbs_smartaudio.c.

int32_t VTXConfigInitialize ( void  )

Initialise the VTXConfig module

Returns
-1 if initialisation failed
0 on success

Definition at line 174 of file VTXConfig.c.

int32_t VTXConfigStart ( void  )

Initialise the VTXConfig module

Returns
-1 if initialisation failed
0 on success

Definition at line 156 of file VTXConfig.c.

static void vtxConfigTask ( void *  parameters)
static

Main VTXConfig Task

Definition at line 207 of file VTXConfig.c.

Variable Documentation

const uint16_t AIRWAVE_FREQS[VTXSETTINGS_AIRWAVE_FREQUENCY_MAXOPTVAL+1]
static
Initial value:
= {
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH15740] = 5740,
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH25760] = 5760,
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH35780] = 5780,
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH45800] = 5800,
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH55820] = 5820,
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH65840] = 5840,
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH75860] = 5860,
[VTXSETTINGS_AIRWAVE_FREQUENCY_CH85880] = 5880
}

Definition at line 105 of file VTXConfig.c.

const uint16_t BAND_5G8_A_FREQS[VTXSETTINGS_BAND_5G8_A_FREQUENCY_MAXOPTVAL+1]
static
Initial value:
= {
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH15865] = 5865,
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH25845] = 5845,
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH35825] = 5825,
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH45805] = 5805,
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH55785] = 5785,
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH65765] = 5765,
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH75745] = 5745,
[VTXSETTINGS_BAND_5G8_A_FREQUENCY_CH85725] = 5725
}

Definition at line 72 of file VTXConfig.c.

const uint16_t BAND_5G8_B_FREQS[VTXSETTINGS_BAND_5G8_B_FREQUENCY_MAXOPTVAL+1]
static
Initial value:
= {
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH15733] = 5733,
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH25752] = 5752,
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH35771] = 5771,
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH45790] = 5790,
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH55809] = 5809,
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH65828] = 5828,
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH75847] = 5847,
[VTXSETTINGS_BAND_5G8_B_FREQUENCY_CH85866] = 5866
}

Definition at line 83 of file VTXConfig.c.

const uint16_t BAND_5G8_E_FREQS[VTXSETTINGS_BAND_5G8_E_FREQUENCY_MAXOPTVAL+1]
static
Initial value:
= {
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH15705] = 5705,
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH25685] = 5685,
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH35665] = 5665,
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH45645] = 5645,
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH55885] = 5885,
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH65905] = 5905,
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH75925] = 5925,
[VTXSETTINGS_BAND_5G8_E_FREQUENCY_CH85945] = 5945
}

Definition at line 94 of file VTXConfig.c.

uint8_t __attribute__::channel

Definition at line 61 of file tbs_smartaudio.c.

uint8_t __attribute__::command

Definition at line 59 of file tbs_smartaudio.c.

uint8_t __attribute__::crc

Definition at line 66 of file tbs_smartaudio.c.

uint8_t __attribute__::dummy

Definition at line 73 of file tbs_smartaudio.c.

uint8_t __attribute__::freq0

Definition at line 64 of file tbs_smartaudio.c.

uint8_t __attribute__::freq1

Definition at line 65 of file tbs_smartaudio.c.

uint8_t __attribute__::length

Definition at line 60 of file tbs_smartaudio.c.

uint8_t __attribute__::mode

Definition at line 89 of file tbs_smartaudio.c.

bool module_enabled = false
static

Definition at line 138 of file VTXConfig.c.

uint8_t __attribute__::operation_mode

Definition at line 63 of file tbs_smartaudio.c.

uint8_t __attribute__::pwr

Definition at line 81 of file tbs_smartaudio.c.

uint8_t __attribute__::pwr_level

Definition at line 62 of file tbs_smartaudio.c.

const uint16_t RACEBAND_FREQS[VTXSETTINGS_RACEBAND_FREQUENCY_MAXOPTVAL+1]
static
Initial value:
= {
[VTXSETTINGS_RACEBAND_FREQUENCY_CH15658] = 5658,
[VTXSETTINGS_RACEBAND_FREQUENCY_CH25695] = 5695,
[VTXSETTINGS_RACEBAND_FREQUENCY_CH35732] = 5732,
[VTXSETTINGS_RACEBAND_FREQUENCY_CH45769] = 5769,
[VTXSETTINGS_RACEBAND_FREQUENCY_CH55806] = 5806,
[VTXSETTINGS_RACEBAND_FREQUENCY_CH65843] = 5843,
[VTXSETTINGS_RACEBAND_FREQUENCY_CH75880] = 5880,
[VTXSETTINGS_RACEBAND_FREQUENCY_CH85917] = 5917
}

Definition at line 116 of file VTXConfig.c.

volatile bool settings_updated = false
static

Definition at line 139 of file VTXConfig.c.

const uint16_t TBS_CH[NUM_TBS_CH]
Initial value:
= {
5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725,
5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866,
5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945,
5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880,
5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917
}

Definition at line 43 of file tbs_smartaudio.c.

const uint16_t VTX_POWER[VTXSETTINGS_POWER_GLOBAL_MAXOPTVAL+1]
static
Initial value:
= {
[VTXSETTINGS_POWER_25] = 25,
[VTXSETTINGS_POWER_200] = 200,
[VTXSETTINGS_POWER_500] = 500,
[VTXSETTINGS_POWER_800] = 800,
}

Definition at line 127 of file VTXConfig.c.

enum TBS_VTX_PROTOCOL vtx_protocol = UNKNOWN
static

Definition at line 94 of file tbs_smartaudio.c.

enum VTXTYPE vtx_type = VTX_NONE
static

Definition at line 142 of file VTXConfig.c.

uint32_t vtxConfigPort
static

Definition at line 137 of file VTXConfig.c.

struct pios_thread* vtxConfigTaskHandle
static

Definition at line 140 of file VTXConfig.c.