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

Process OSD information. More...

Files

file  charosd.h
 
file  panel.c
 

Data Structures

struct  telemetry_t
 
struct  charosd_state_t
 
struct  panel_t
 

Macros

#define STACK_SIZE_BYTES   3072
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define SPLASH_TIME_MS   (5*1000)
 
#define FONT_CHAR_SIZE   ((12 * 18 * 2) / 8)
 
#define HAS_GPS   (1 << 0)
 
#define HAS_BATT   (1 << 1)
 
#define HAS_PITOT   (1 << 2)
 
#define HAS_ALT   (1 << 3)
 
#define HAS_TEMP   (1 << 4)
 
#define HAS_RSSI   (1 << 5)
 
#define HAS_NAV   (1 << 6)
 
#define HAS_COMPASS   (1 << 7)
 
#define HAS_SENSOR(available, required)   ((available & required) == required)
 
#define CHAROSD_CHAR_GPS_2D   0x01
 
#define CHAROSD_CHAR_GPS_3D   0x02
 
#define CHAROSD_CHAR_VARIO_DOWN1   0x03
 
#define CHAROSD_CHAR_VARIO_DOWN2   0x04
 
#define CHAROSD_CHAR_VARIO_DOWN3   0x05
 
#define CHAROSD_CHAR_VARIO_UP1   0x06
 
#define CHAROSD_CHAR_VARIO_UP2   0x07
 
#define CHAROSD_CHAR_VARIO_UP3   0x08
 
#define CHAROSD_CHAR_BULLET   0x09
 
#define CHAROSD_CHAR_CROSSHAIR   0x0a
 
#define CHAROSD_CHAR_GPS_SATL   0x10
 
#define CHAROSD_CHAR_GPS_SATR   0x11
 
#define CHAROSD_CHAR_HOME   0x12
 
#define CHAROSD_CHAR_BAR0   0x16
 
#define CHAROSD_CHAR_BAR1   0x17
 
#define CHAROSD_CHAR_BAR2   0x18
 
#define CHAROSD_CHAR_BAR3   0x19
 
#define CHAROSD_CHAR_BAR4   0x1a
 
#define CHAROSD_CHAR_BAR5   0x1b
 
#define CHAROSD_CHAR_BAR6   0x1c
 
#define CHAROSD_CHAR_BAR7   0x1d
 
#define CHAROSD_CHAR_BAR8   0x1e
 
#define CHAROSD_CHAR_FLAG   0x7f
 
#define CHAROSD_CHAR_GS   0x80
 
#define CHAROSD_CHAR_KMH   0x81
 
#define CHAROSD_CHAR_MAH   0x82
 
#define CHAROSD_CHAR_LAT   0x83
 
#define CHAROSD_CHAR_LON   0x84
 
#define CHAROSD_CHAR_ALT   0x85
 
#define CHAROSD_CHAR_VEL   0x86
 
#define CHAROSD_CHAR_THR   0x87
 
#define CHAROSD_CHAR_AIR   0x88
 
#define CHAROSD_CHAR_DEGC   0x8a
 
#define CHAROSD_CHAR_KM   0x8b
 
#define CHAROSD_CHAR_MS   0x8c
 
#define CHAROSD_CHAR_M   0x8d
 
#define CHAROSD_CHAR_V   0x8e
 
#define CHAROSD_CHAR_A   0x8f
 
#define CHAROSD_CHAR_ARROW_NL   0x90
 
#define CHAROSD_CHAR_ARROW_NR   0x91
 
#define CHAROSD_CHAR_ARROW_NNEL   0x92
 
#define CHAROSD_CHAR_ARROW_NNER   0x93
 
#define CHAROSD_CHAR_ARROW_NEL   0x94
 
#define CHAROSD_CHAR_ARROW_NER   0x95
 
#define CHAROSD_CHAR_ARROW_ENEL   0x96
 
#define CHAROSD_CHAR_ARROW_ENER   0x97
 
#define CHAROSD_CHAR_ARROW_EL   0x98
 
#define CHAROSD_CHAR_ARROW_ER   0x99
 
#define CHAROSD_CHAR_ARROW_ESEL   0x9a
 
#define CHAROSD_CHAR_ARROW_ESER   0x9b
 
#define CHAROSD_CHAR_ARROW_SEL   0x9c
 
#define CHAROSD_CHAR_ARROW_SER   0x9d
 
#define CHAROSD_CHAR_ARROW_SSEL   0x9e
 
#define CHAROSD_CHAR_ARROW_SSER   0x9f
 
#define CHAROSD_CHAR_ARROW_SL   0xa0
 
#define CHAROSD_CHAR_ARROW_SR   0xa1
 
#define CHAROSD_CHAR_ARROW_SSWL   0xa2
 
#define CHAROSD_CHAR_ARROW_SSWR   0xa3
 
#define CHAROSD_CHAR_ARROW_SWL   0xa4
 
#define CHAROSD_CHAR_ARROW_SWR   0xa5
 
#define CHAROSD_CHAR_ARROW_WSWL   0xa6
 
#define CHAROSD_CHAR_ARROW_WSWR   0xa7
 
#define CHAROSD_CHAR_ARROW_WL   0xa8
 
#define CHAROSD_CHAR_ARROW_WR   0xa9
 
#define CHAROSD_CHAR_ARROW_WNWL   0xaa
 
#define CHAROSD_CHAR_ARROW_WNWR   0xab
 
#define CHAROSD_CHAR_ARROW_NWL   0xac
 
#define CHAROSD_CHAR_ARROW_NWR   0xad
 
#define CHAROSD_CHAR_ARROW_NNWL   0xae
 
#define CHAROSD_CHAR_ARROW_NNWR   0xaf
 
#define CHAROSD_CHAR_DEG   0xb0
 
#define CHAROSD_CHAR_PITCH   0xb1
 
#define CHAROSD_CHAR_ROLL   0xb2
 
#define CHAROSD_CHAR_TIME   0xb3
 
#define CHAROSD_CHAR_RSSI   0xb4
 
#define CHAROSD_CHAR_YAW   0xb5
 
#define CHAROSD_CHAR_AHI_HUDL   0xb8
 
#define CHAROSD_CHAR_AHI_HUDR   0xb9
 
#define CHAROSD_CHAR_AHI_CENL   0xc8
 
#define CHAROSD_CHAR_AHI_CENR   0xc9
 
#define CHAROSD_CHAR_WINGL   0xbd
 
#define CHAROSD_CHAR_WINGM   0xbe
 
#define CHAROSD_CHAR_WINGR   0xbf
 
#define CHAROSD_CHAR_COMPASS_RULER_LOW   0xc0
 
#define CHAROSD_CHAR_COMPASS_RULER_HIGH   0xc1
 
#define CHAROSD_CHAR_COMPASS_NORTH   0xc2
 
#define CHAROSD_CHAR_COMPASS_SOUTH   0xc3
 
#define CHAROSD_CHAR_COMPASS_EAST   0xc4
 
#define CHAROSD_CHAR_COMPASS_WEST   0xc5
 
#define CHAROSD_CHAR_COMPASS_POINT   0xc6
 
#define CHAROSD_CHAR_COMPASS_INTERNAL   0xc7
 
#define CHAROSD_CHAR_COMPASS_GPS   0xb6
 
#define CHAROSD_CHAR_BOX_TL   0xd0
 
#define CHAROSD_CHAR_BOX_T   0xd1
 
#define CHAROSD_CHAR_BOX_TR   0xd2
 
#define CHAROSD_CHAR_BOX_R   0xd3
 
#define CHAROSD_CHAR_BOX_BL   0xd4
 
#define CHAROSD_CHAR_BOX_B   0xd5
 
#define CHAROSD_CHAR_BOX_BR   0xd6
 
#define CHAROSD_CHAR_BOX_L   0xd7
 
#define CHAROSD_CHAR_FILL_TL   0xd8
 
#define CHAROSD_CHAR_FILL_T   0xd9
 
#define CHAROSD_CHAR_FILL_TR   0xda
 
#define CHAROSD_CHAR_FILL_R   0xdb
 
#define CHAROSD_CHAR_FILL_BL   0xdc
 
#define CHAROSD_CHAR_FILL_B   0xdd
 
#define CHAROSD_CHAR_FILL_BR   0xde
 
#define CHAROSD_CHAR_FILL_L   0xdf
 
#define CHAROSD_CHAR_ARMED   0xe0
 
#define CHAROSD_CHAR_BIGC   0xe1
 
#define CHAROSD_CHAR_SIG1_H   0xe2
 
#define CHAROSD_CHAR_SIG2_HH   0xe3
 
#define CHAROSD_CHAR_SIG3_HH   0xe4
 
#define CHAROSD_CHAR_SIG1_L   0xe5
 
#define CHAROSD_CHAR_SIG2_HL   0xe6
 
#define CHAROSD_CHAR_SIG3_HL   0xe7
 
#define CHAROSD_CHAR_SIG23_LL   0xe8
 
#define CHAROSD_CHAR_POWER2   0xec
 
#define CHAROSD_CHAR_ENERGY2   0xed
 
#define CHAROSD_CHAR_BAT_CRIT   0xee
 
#define CHAROSD_CHAR_BAT_EMPTY   0xef
 
#define CHAROSD_CHAR_BAT_LOW   0xf0
 
#define CHAROSD_CHAR_BAT_MID   0xf1
 
#define CHAROSD_CHAR_BAT_HIGH   0xf2
 
#define CHAROSD_CHAR_BAT_FULL   0xf3
 
#define CHAROSD_CHAR_BAT2_CRIT   0xf4
 
#define CHAROSD_CHAR_BAT2_EMPTY   0xf5
 
#define CHAROSD_CHAR_BAT2_LOW   0xf6
 
#define CHAROSD_CHAR_BAT2_MID   0xf7
 
#define CHAROSD_CHAR_BAT2_HIGH   0xf8
 
#define CHAROSD_CHAR_BAT2_FULL   0xf9
 
#define CHAROSD_CHAR_POWER   0xfa
 
#define CHAROSD_CHAR_ENERGY   0xfb
 
#define CHAROSD_CHAR_LEFTRIGHT   0xfc
 
#define CHAROSD_CHAR_TEMP   0xfd
 
#define CHAROSD_CHAR_ROUTE   0xfe
 
#define ERR_STR   "---"
 
#define terminate_buffer()   do { buffer [sizeof(buffer) - 1] = 0; } while (0)
 
#define STD_UPDATE(__name, n, fmt,...)
 
#define STD_PANEL(__name, bs, fmt,...)   STD_UPDATE(__name, bs, fmt, __VA_ARGS__);
 
#define _PAN_CLIMB_SYMB   0x03
 
#define _PAN_GPS_2D   0x01
 
#define _PAN_GPS_3D   0x02
 
#define PANEL_HORIZON_WIDTH   14
 
#define PANEL_HORIZON_HEIGHT   5
 
#define _PAN_HORZ_LINE   0x16
 
#define _PAN_HORZ_TOP   0x0e
 
#define _PAN_HORZ_CHAR_LINES   18
 
#define _PAN_HORZ_VRES   9
 
#define _PAN_HORZ_INT_WIDTH   (PANEL_HORIZON_WIDTH - 2)
 
#define _PAN_HORZ_LINES   (PANEL_HORIZON_HEIGHT * _PAN_HORZ_VRES)
 
#define _PAN_HORZ_TOTAL_LINES   (PANEL_HORIZON_HEIGHT * _PAN_HORZ_CHAR_LINES)
 
#define _ARROWS   CHAROSD_CHAR_ARROW_NL
 
#define MAX_ALARM_LEN   MAX7456_COLUMNS
 
#define declare_panel(__name, __req)
 

Typedefs

typedef void(* update_t )(charosd_state_t state, uint8_t x, uint8_t y)
 

Functions

static void panel_draw (charosd_state_t state, uint8_t panel, uint8_t x, uint8_t y)
 
static void screen_draw (charosd_state_t state, CharOnScreenDisplaySettingsData *page)
 
static void set_mode (charosd_state_t state, uint8_t video_std)
 
static void program_characters (charosd_state_t state, uint8_t font)
 
static void update_availability (charosd_state_t state)
 
static void update_telemetry (charosd_state_t state)
 
static void splash_screen (charosd_state_t state)
 
static void CharOnScreenDisplayTask (void *parameters)
 
int32_t CharOnScreenDisplayInitialize (void)
 
int32_t CharOnScreenDisplayStart (void)
 
 MODULE_INITCALL (CharOnScreenDisplayInitialize, CharOnScreenDisplayStart)
 
static float pythag (float a, float b)
 
static void draw_rect (charosd_state_t state, uint8_t l, uint8_t t, uint8_t w, uint8_t h, bool filled, uint8_t attr)
 
 STD_PANEL (ALTITUDE, 8,"\x85%d\x8d",(int16_t) round(-state->telemetry.position_actual.Down))
 
static void CLIMB_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void FLIGHTMODE_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void ARMEDFLAG_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void FLIGHTTIME_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (ROLL, 7,"\xb2%d\xb0",(int16_t) state->telemetry.attitude_actual.Roll)
 
 STD_PANEL (PITCH, 7,"\xb1%d\xb0",(int16_t) state->telemetry.attitude_actual.Pitch)
 
static void GPS_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (LATITUDE, 11,"\x83%02.6f",(double) state->telemetry.gps_position.Latitude/10000000.0)
 
 STD_PANEL (LONGITUDE, 11,"\x84%02.6f",(double) state->telemetry.gps_position.Longitude/10000000.0)
 
void HORIZON_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (THROTTLE, 7,"\x87%d%%",(int) MAX(-99, state->telemetry.manual.thrust *100))
 
 STD_PANEL (GROUNDSPEED, 7,"\x80%d\x81",(int) roundf(pythag(state->telemetry.velocity_actual.North, state->telemetry.velocity_actual.East)*3.6f))
 
 STD_PANEL (BATTERYVOLT, 8,"%.2f\x8e",(double) state->telemetry.battery.Voltage)
 
 STD_PANEL (BATTERYCURRENT, 8,"%.2f\x8f",(double) state->telemetry.battery.Current)
 
 STD_PANEL (BATTERYCONSUMED, 8,"%u\x82",(uint16_t) state->telemetry.battery.ConsumedEnergy)
 
static void RSSIFLAG_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void HOMEDISTANCE_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void HOMEDIRECTION_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (HEADING, 6,"%d%c",(int)(round(state->telemetry.attitude_actual.Yaw)+360)%360, CHAROSD_CHAR_DEG)
 
 STD_PANEL (CALLSIGN, 11,"%s", state->custom_text)
 
 STD_PANEL (TEMPERATURE, 9,"\xfd%.1f\x8a", 0.0)
 
static void RSSI_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void COMPASS_update (charosd_state_t state, uint8_t x, uint8_t y)
 
static void AIRSPEED_update (charosd_state_t state, uint8_t x, uint8_t y)
 
 STD_PANEL (CROSSHAIR, 2,"%c", 0x0a)
 
static void ALARMS_update (charosd_state_t state, uint8_t x, uint8_t y)
 

Variables

bool module_enabled
 
static const uint8_t charosd_font_data []
 
static const uint8_t charosd_font_small_data []
 
static const uint8_t charosd_font_thin_data []
 
const panel_t panels []
 
const uint8_t panels_count
 
const char _horz_line [PANEL_HORIZON_WIDTH+1] = "\xb8 \xb9"
 
const char _horz_center [PANEL_HORIZON_WIDTH+1] = "\xc8 \xc9"
 
const panel_t panels [CHARONSCREENDISPLAYSETTINGS_PANELTYPE_MAXOPTVAL+1]
 
const uint8_t count = sizeof (panels) / sizeof (panel_t)
 

Detailed Description

Process OSD information.

Macro Definition Documentation

#define _ARROWS   CHAROSD_CHAR_ARROW_NL

Definition at line 384 of file panel.c.

#define _PAN_CLIMB_SYMB   0x03

Definition at line 137 of file panel.c.

#define _PAN_GPS_2D   0x01

Definition at line 271 of file panel.c.

#define _PAN_GPS_3D   0x02

Definition at line 272 of file panel.c.

#define _PAN_HORZ_CHAR_LINES   18

Definition at line 302 of file panel.c.

#define _PAN_HORZ_INT_WIDTH   (PANEL_HORIZON_WIDTH - 2)

Definition at line 304 of file panel.c.

#define _PAN_HORZ_LINE   0x16

Definition at line 299 of file panel.c.

#define _PAN_HORZ_LINES   (PANEL_HORIZON_HEIGHT * _PAN_HORZ_VRES)

Definition at line 305 of file panel.c.

#define _PAN_HORZ_TOP   0x0e

Definition at line 300 of file panel.c.

#define _PAN_HORZ_TOTAL_LINES   (PANEL_HORIZON_HEIGHT * _PAN_HORZ_CHAR_LINES)

Definition at line 306 of file panel.c.

#define _PAN_HORZ_VRES   9

Definition at line 303 of file panel.c.

#define CHAROSD_CHAR_A   0x8f

Definition at line 136 of file charosd.h.

#define CHAROSD_CHAR_AHI_CENL   0xc8

Definition at line 177 of file charosd.h.

#define CHAROSD_CHAR_AHI_CENR   0xc9

Definition at line 178 of file charosd.h.

#define CHAROSD_CHAR_AHI_HUDL   0xb8

Definition at line 175 of file charosd.h.

#define CHAROSD_CHAR_AHI_HUDR   0xb9

Definition at line 176 of file charosd.h.

#define CHAROSD_CHAR_AIR   0x88

Definition at line 130 of file charosd.h.

#define CHAROSD_CHAR_ALT   0x85

Definition at line 127 of file charosd.h.

#define CHAROSD_CHAR_ARMED   0xe0

Definition at line 207 of file charosd.h.

#define CHAROSD_CHAR_ARROW_EL   0x98

Definition at line 145 of file charosd.h.

#define CHAROSD_CHAR_ARROW_ENEL   0x96

Definition at line 143 of file charosd.h.

#define CHAROSD_CHAR_ARROW_ENER   0x97

Definition at line 144 of file charosd.h.

#define CHAROSD_CHAR_ARROW_ER   0x99

Definition at line 146 of file charosd.h.

#define CHAROSD_CHAR_ARROW_ESEL   0x9a

Definition at line 147 of file charosd.h.

#define CHAROSD_CHAR_ARROW_ESER   0x9b

Definition at line 148 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NEL   0x94

Definition at line 141 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NER   0x95

Definition at line 142 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NL   0x90

Definition at line 137 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NNEL   0x92

Definition at line 139 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NNER   0x93

Definition at line 140 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NNWL   0xae

Definition at line 167 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NNWR   0xaf

Definition at line 168 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NR   0x91

Definition at line 138 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NWL   0xac

Definition at line 165 of file charosd.h.

#define CHAROSD_CHAR_ARROW_NWR   0xad

Definition at line 166 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SEL   0x9c

Definition at line 149 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SER   0x9d

Definition at line 150 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SL   0xa0

Definition at line 153 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SR   0xa1

Definition at line 154 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SSEL   0x9e

Definition at line 151 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SSER   0x9f

Definition at line 152 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SSWL   0xa2

Definition at line 155 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SSWR   0xa3

Definition at line 156 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SWL   0xa4

Definition at line 157 of file charosd.h.

#define CHAROSD_CHAR_ARROW_SWR   0xa5

Definition at line 158 of file charosd.h.

#define CHAROSD_CHAR_ARROW_WL   0xa8

Definition at line 161 of file charosd.h.

#define CHAROSD_CHAR_ARROW_WNWL   0xaa

Definition at line 163 of file charosd.h.

#define CHAROSD_CHAR_ARROW_WNWR   0xab

Definition at line 164 of file charosd.h.

#define CHAROSD_CHAR_ARROW_WR   0xa9

Definition at line 162 of file charosd.h.

#define CHAROSD_CHAR_ARROW_WSWL   0xa6

Definition at line 159 of file charosd.h.

#define CHAROSD_CHAR_ARROW_WSWR   0xa7

Definition at line 160 of file charosd.h.

#define CHAROSD_CHAR_BAR0   0x16

Definition at line 112 of file charosd.h.

#define CHAROSD_CHAR_BAR1   0x17

Definition at line 113 of file charosd.h.

#define CHAROSD_CHAR_BAR2   0x18

Definition at line 114 of file charosd.h.

#define CHAROSD_CHAR_BAR3   0x19

Definition at line 115 of file charosd.h.

#define CHAROSD_CHAR_BAR4   0x1a

Definition at line 116 of file charosd.h.

#define CHAROSD_CHAR_BAR5   0x1b

Definition at line 117 of file charosd.h.

#define CHAROSD_CHAR_BAR6   0x1c

Definition at line 118 of file charosd.h.

#define CHAROSD_CHAR_BAR7   0x1d

Definition at line 119 of file charosd.h.

#define CHAROSD_CHAR_BAR8   0x1e

Definition at line 120 of file charosd.h.

#define CHAROSD_CHAR_BAT2_CRIT   0xf4

Definition at line 224 of file charosd.h.

#define CHAROSD_CHAR_BAT2_EMPTY   0xf5

Definition at line 225 of file charosd.h.

#define CHAROSD_CHAR_BAT2_FULL   0xf9

Definition at line 229 of file charosd.h.

#define CHAROSD_CHAR_BAT2_HIGH   0xf8

Definition at line 228 of file charosd.h.

#define CHAROSD_CHAR_BAT2_LOW   0xf6

Definition at line 226 of file charosd.h.

#define CHAROSD_CHAR_BAT2_MID   0xf7

Definition at line 227 of file charosd.h.

#define CHAROSD_CHAR_BAT_CRIT   0xee

Definition at line 218 of file charosd.h.

#define CHAROSD_CHAR_BAT_EMPTY   0xef

Definition at line 219 of file charosd.h.

#define CHAROSD_CHAR_BAT_FULL   0xf3

Definition at line 223 of file charosd.h.

#define CHAROSD_CHAR_BAT_HIGH   0xf2

Definition at line 222 of file charosd.h.

#define CHAROSD_CHAR_BAT_LOW   0xf0

Definition at line 220 of file charosd.h.

#define CHAROSD_CHAR_BAT_MID   0xf1

Definition at line 221 of file charosd.h.

#define CHAROSD_CHAR_BIGC   0xe1

Definition at line 208 of file charosd.h.

#define CHAROSD_CHAR_BOX_B   0xd5

Definition at line 196 of file charosd.h.

#define CHAROSD_CHAR_BOX_BL   0xd4

Definition at line 195 of file charosd.h.

#define CHAROSD_CHAR_BOX_BR   0xd6

Definition at line 197 of file charosd.h.

#define CHAROSD_CHAR_BOX_L   0xd7

Definition at line 198 of file charosd.h.

#define CHAROSD_CHAR_BOX_R   0xd3

Definition at line 194 of file charosd.h.

#define CHAROSD_CHAR_BOX_T   0xd1

Definition at line 192 of file charosd.h.

#define CHAROSD_CHAR_BOX_TL   0xd0

Definition at line 191 of file charosd.h.

#define CHAROSD_CHAR_BOX_TR   0xd2

Definition at line 193 of file charosd.h.

#define CHAROSD_CHAR_BULLET   0x09

Definition at line 107 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_EAST   0xc4

Definition at line 186 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_GPS   0xb6

Definition at line 190 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_INTERNAL   0xc7

Definition at line 189 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_NORTH   0xc2

Definition at line 184 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_POINT   0xc6

Definition at line 188 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_RULER_HIGH   0xc1

Definition at line 183 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_RULER_LOW   0xc0

Definition at line 182 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_SOUTH   0xc3

Definition at line 185 of file charosd.h.

#define CHAROSD_CHAR_COMPASS_WEST   0xc5

Definition at line 187 of file charosd.h.

#define CHAROSD_CHAR_CROSSHAIR   0x0a

Definition at line 108 of file charosd.h.

#define CHAROSD_CHAR_DEG   0xb0

Definition at line 169 of file charosd.h.

#define CHAROSD_CHAR_DEGC   0x8a

Definition at line 131 of file charosd.h.

#define CHAROSD_CHAR_ENERGY   0xfb

Definition at line 231 of file charosd.h.

#define CHAROSD_CHAR_ENERGY2   0xed

Definition at line 217 of file charosd.h.

#define CHAROSD_CHAR_FILL_B   0xdd

Definition at line 204 of file charosd.h.

#define CHAROSD_CHAR_FILL_BL   0xdc

Definition at line 203 of file charosd.h.

#define CHAROSD_CHAR_FILL_BR   0xde

Definition at line 205 of file charosd.h.

#define CHAROSD_CHAR_FILL_L   0xdf

Definition at line 206 of file charosd.h.

#define CHAROSD_CHAR_FILL_R   0xdb

Definition at line 202 of file charosd.h.

#define CHAROSD_CHAR_FILL_T   0xd9

Definition at line 200 of file charosd.h.

#define CHAROSD_CHAR_FILL_TL   0xd8

Definition at line 199 of file charosd.h.

#define CHAROSD_CHAR_FILL_TR   0xda

Definition at line 201 of file charosd.h.

#define CHAROSD_CHAR_FLAG   0x7f

Definition at line 121 of file charosd.h.

#define CHAROSD_CHAR_GPS_2D   0x01

Definition at line 99 of file charosd.h.

#define CHAROSD_CHAR_GPS_3D   0x02

Definition at line 100 of file charosd.h.

#define CHAROSD_CHAR_GPS_SATL   0x10

Definition at line 109 of file charosd.h.

#define CHAROSD_CHAR_GPS_SATR   0x11

Definition at line 110 of file charosd.h.

#define CHAROSD_CHAR_GS   0x80

Definition at line 122 of file charosd.h.

#define CHAROSD_CHAR_HOME   0x12

Definition at line 111 of file charosd.h.

#define CHAROSD_CHAR_KM   0x8b

Definition at line 132 of file charosd.h.

#define CHAROSD_CHAR_KMH   0x81

Definition at line 123 of file charosd.h.

#define CHAROSD_CHAR_LAT   0x83

Definition at line 125 of file charosd.h.

#define CHAROSD_CHAR_LEFTRIGHT   0xfc

Definition at line 232 of file charosd.h.

#define CHAROSD_CHAR_LON   0x84

Definition at line 126 of file charosd.h.

#define CHAROSD_CHAR_M   0x8d

Definition at line 134 of file charosd.h.

#define CHAROSD_CHAR_MAH   0x82

Definition at line 124 of file charosd.h.

#define CHAROSD_CHAR_MS   0x8c

Definition at line 133 of file charosd.h.

#define CHAROSD_CHAR_PITCH   0xb1

Definition at line 170 of file charosd.h.

#define CHAROSD_CHAR_POWER   0xfa

Definition at line 230 of file charosd.h.

#define CHAROSD_CHAR_POWER2   0xec

Definition at line 216 of file charosd.h.

#define CHAROSD_CHAR_ROLL   0xb2

Definition at line 171 of file charosd.h.

#define CHAROSD_CHAR_ROUTE   0xfe

Definition at line 234 of file charosd.h.

#define CHAROSD_CHAR_RSSI   0xb4

Definition at line 173 of file charosd.h.

#define CHAROSD_CHAR_SIG1_H   0xe2

Definition at line 209 of file charosd.h.

#define CHAROSD_CHAR_SIG1_L   0xe5

Definition at line 212 of file charosd.h.

#define CHAROSD_CHAR_SIG23_LL   0xe8

Definition at line 215 of file charosd.h.

#define CHAROSD_CHAR_SIG2_HH   0xe3

Definition at line 210 of file charosd.h.

#define CHAROSD_CHAR_SIG2_HL   0xe6

Definition at line 213 of file charosd.h.

#define CHAROSD_CHAR_SIG3_HH   0xe4

Definition at line 211 of file charosd.h.

#define CHAROSD_CHAR_SIG3_HL   0xe7

Definition at line 214 of file charosd.h.

#define CHAROSD_CHAR_TEMP   0xfd

Definition at line 233 of file charosd.h.

#define CHAROSD_CHAR_THR   0x87

Definition at line 129 of file charosd.h.

#define CHAROSD_CHAR_TIME   0xb3

Definition at line 172 of file charosd.h.

#define CHAROSD_CHAR_V   0x8e

Definition at line 135 of file charosd.h.

#define CHAROSD_CHAR_VARIO_DOWN1   0x03

Definition at line 101 of file charosd.h.

#define CHAROSD_CHAR_VARIO_DOWN2   0x04

Definition at line 102 of file charosd.h.

#define CHAROSD_CHAR_VARIO_DOWN3   0x05

Definition at line 103 of file charosd.h.

#define CHAROSD_CHAR_VARIO_UP1   0x06

Definition at line 104 of file charosd.h.

#define CHAROSD_CHAR_VARIO_UP2   0x07

Definition at line 105 of file charosd.h.

#define CHAROSD_CHAR_VARIO_UP3   0x08

Definition at line 106 of file charosd.h.

#define CHAROSD_CHAR_VEL   0x86

Definition at line 128 of file charosd.h.

#define CHAROSD_CHAR_WINGL   0xbd

Definition at line 179 of file charosd.h.

#define CHAROSD_CHAR_WINGM   0xbe

Definition at line 180 of file charosd.h.

#define CHAROSD_CHAR_WINGR   0xbf

Definition at line 181 of file charosd.h.

#define CHAROSD_CHAR_YAW   0xb5

Definition at line 174 of file charosd.h.

#define declare_panel (   __name,
  __req 
)
Value:
[CHARONSCREENDISPLAYSETTINGS_PANELTYPE_ ## __name] = { \
__name ## _update, \
__req }

Definition at line 481 of file panel.c.

#define ERR_STR   "---"

Definition at line 117 of file panel.c.

#define FONT_CHAR_SIZE   ((12 * 18 * 2) / 8)

Definition at line 143 of file charonscreendisplay.c.

#define HAS_ALT   (1 << 3)

Definition at line 87 of file charosd.h.

#define HAS_BATT   (1 << 1)

Definition at line 85 of file charosd.h.

#define HAS_COMPASS   (1 << 7)

Definition at line 91 of file charosd.h.

#define HAS_GPS   (1 << 0)

Definition at line 84 of file charosd.h.

#define HAS_NAV   (1 << 6)

Definition at line 90 of file charosd.h.

#define HAS_PITOT   (1 << 2)

Definition at line 86 of file charosd.h.

#define HAS_RSSI   (1 << 5)

Definition at line 89 of file charosd.h.

#define HAS_SENSOR (   available,
  required 
)    ((available & required) == required)

Definition at line 93 of file charosd.h.

#define HAS_TEMP   (1 << 4)

Definition at line 88 of file charosd.h.

#define MAX_ALARM_LEN   MAX7456_COLUMNS

Definition at line 468 of file panel.c.

#define PANEL_HORIZON_HEIGHT   5

Definition at line 297 of file panel.c.

#define PANEL_HORIZON_WIDTH   14

Definition at line 296 of file panel.c.

#define SPLASH_TIME_MS   (5*1000)

Definition at line 77 of file charonscreendisplay.c.

#define STACK_SIZE_BYTES   3072

Definition at line 74 of file charonscreendisplay.c.

#define STD_PANEL (   __name,
  bs,
  fmt,
  ... 
)    STD_UPDATE(__name, bs, fmt, __VA_ARGS__);

Definition at line 129 of file panel.c.

#define STD_UPDATE (   __name,
  n,
  fmt,
  ... 
)
Value:
static void __name ## _update(charosd_state_t state, uint8_t x, uint8_t y) \
{ \
char buffer[n]; \
snprintf(buffer, sizeof (buffer), fmt, __VA_ARGS__); \
PIOS_MAX7456_puts(state->dev, x, y, buffer, 0); \
}
void PIOS_MAX7456_puts(max7456_dev_t dev, uint8_t col, uint8_t row, const char *s, uint8_t attr)
Sets a string into character memory.
#define terminate_buffer()
Definition: panel.c:119
int snprintf(char *buf, size_t count, const char *format,...)
enum arena_state state

Definition at line 121 of file panel.c.

#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW

Definition at line 75 of file charonscreendisplay.c.

#define terminate_buffer ( )    do { buffer [sizeof(buffer) - 1] = 0; } while (0)

Definition at line 119 of file panel.c.

Typedef Documentation

typedef void(* update_t)(charosd_state_t state, uint8_t x, uint8_t y)

Definition at line 76 of file charosd.h.

Function Documentation

static void AIRSPEED_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 455 of file panel.c.

static void ALARMS_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 470 of file panel.c.

static void ARMEDFLAG_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 235 of file panel.c.

int32_t CharOnScreenDisplayInitialize ( void  )

Initialize the osd module

Definition at line 329 of file charonscreendisplay.c.

int32_t CharOnScreenDisplayStart ( void  )

Definition at line 340 of file charonscreendisplay.c.

static void CharOnScreenDisplayTask ( void *  parameters)
static

Main osd task. It does not return.

Definition at line 278 of file charonscreendisplay.c.

static void CLIMB_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 139 of file panel.c.

static void COMPASS_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 428 of file panel.c.

static void draw_rect ( charosd_state_t  state,
uint8_t  l,
uint8_t  t,
uint8_t  w,
uint8_t  h,
bool  filled,
uint8_t  attr 
)
static

Definition at line 78 of file panel.c.

static void FLIGHTMODE_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 159 of file panel.c.

static void FLIGHTTIME_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 242 of file panel.c.

static void GPS_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 274 of file panel.c.

static void HOMEDIRECTION_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 386 of file panel.c.

static void HOMEDISTANCE_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 367 of file panel.c.

void HORIZON_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)

Definition at line 311 of file panel.c.

static void panel_draw ( charosd_state_t  state,
uint8_t  panel,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 81 of file charonscreendisplay.c.

static void program_characters ( charosd_state_t  state,
uint8_t  font 
)
static

Definition at line 145 of file charonscreendisplay.c.

static float pythag ( float  a,
float  b 
)
inlinestatic

Definition at line 69 of file panel.c.

static void RSSI_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 409 of file panel.c.

static void RSSIFLAG_update ( charosd_state_t  state,
uint8_t  x,
uint8_t  y 
)
static

Definition at line 360 of file panel.c.

static void screen_draw ( charosd_state_t  state,
CharOnScreenDisplaySettingsData *  page 
)
static

Definition at line 91 of file charonscreendisplay.c.

static void set_mode ( charosd_state_t  state,
uint8_t  video_std 
)
static

Definition at line 115 of file charonscreendisplay.c.

static void splash_screen ( charosd_state_t  state)
static

Definition at line 260 of file charonscreendisplay.c.

STD_PANEL ( ALTITUDE  ,
,
"\x85%d\x8d"  ,
(int16_t) round(-state->telemetry.position_actual.Down)   
)
STD_PANEL ( ROLL  ,
,
"\xb2%d\xb0"  ,
(int16_t) state->telemetry.attitude_actual.  Roll 
)
STD_PANEL ( PITCH  ,
,
"\xb1%d\xb0"  ,
(int16_t) state->telemetry.attitude_actual.  Pitch 
)
STD_PANEL ( LATITUDE  ,
11  ,
"\x83%02.6f"  ,
(double) state->telemetry.gps_position.Latitude/10000000.  0 
)
STD_PANEL ( LONGITUDE  ,
11  ,
"\x84%02.6f"  ,
(double) state->telemetry.gps_position.Longitude/10000000.  0 
)
STD_PANEL ( THROTTLE  ,
,
"\x87%d%%"  ,
(int) MAX(-99, state->telemetry.manual.thrust *100)   
)
STD_PANEL ( GROUNDSPEED  ,
,
"\x80%d\x81"  ,
(int) roundf(pythag(state->telemetry.velocity_actual.North, state->telemetry.velocity_actual.East)*3.6f)   
)
STD_PANEL ( BATTERYVOLT  ,
,
"%.2f\x8e"  ,
(double) state->telemetry.battery.  Voltage 
)
STD_PANEL ( BATTERYCURRENT  ,
,
"%.2f\x8f"  ,
(double) state->telemetry.battery.  Current 
)
STD_PANEL ( BATTERYCONSUMED  ,
,
"%u\x82"  ,
(uint16_t) state->telemetry.battery.  ConsumedEnergy 
)
STD_PANEL ( HEADING  ,
,
"%d%c"  ,
(int)(round(state->telemetry.attitude_actual.Yaw)+360)%  360,
CHAROSD_CHAR_DEG   
)
STD_PANEL ( CALLSIGN  ,
11  ,
"%s"  ,
state->  custom_text 
)
STD_PANEL ( TEMPERATURE  ,
,
"\xfd%.1f\x8a"  ,
0.  0 
)
Parameters
0
Todo:
telemetry::environment::temperature
STD_PANEL ( CROSSHAIR  ,
,
"%c"  ,
0x0a   
)
static void update_availability ( charosd_state_t  state)
static

Definition at line 200 of file charonscreendisplay.c.

static void update_telemetry ( charosd_state_t  state)
static

Definition at line 236 of file charonscreendisplay.c.

Variable Documentation

const char _horz_center[PANEL_HORIZON_WIDTH+1] = "\xc8 \xc9"

Definition at line 309 of file panel.c.

const char _horz_line[PANEL_HORIZON_WIDTH+1] = "\xb8 \xb9"

Definition at line 308 of file panel.c.

const uint8_t charosd_font_data[]
static

Definition at line 101 of file charonscreendisplay.c.

const uint8_t charosd_font_small_data[]
static

Definition at line 106 of file charonscreendisplay.c.

const uint8_t charosd_font_thin_data[]
static

Definition at line 110 of file charonscreendisplay.c.

const uint8_t count = sizeof (panels) / sizeof (panel_t)

Definition at line 515 of file panel.c.

bool module_enabled

Definition at line 79 of file charonscreendisplay.c.

const panel_t panels[]

Definition at line 485 of file panel.c.

const panel_t panels[CHARONSCREENDISPLAYSETTINGS_PANELTYPE_MAXOPTVAL+1]
Initial value:
= {
declare_panel(ALTITUDE, HAS_ALT),
declare_panel(ARMEDFLAG, 0),
declare_panel(BATTERYVOLT, HAS_BATT),
declare_panel(BATTERYCURRENT, HAS_BATT),
declare_panel(BATTERYCONSUMED, HAS_BATT),
declare_panel(CALLSIGN, 0),
declare_panel(FLIGHTMODE, 0),
declare_panel(FLIGHTTIME, 0),
declare_panel(GROUNDSPEED, HAS_GPS),
declare_panel(HOMEDISTANCE, HAS_NAV),
declare_panel(HOMEDIRECTION, HAS_NAV),
declare_panel(HORIZON, 0),
declare_panel(LATITUDE, HAS_GPS),
declare_panel(LONGITUDE, HAS_GPS),
declare_panel(RSSIFLAG, HAS_RSSI),
declare_panel(TEMPERATURE, HAS_TEMP),
declare_panel(THROTTLE, 0),
declare_panel(CROSSHAIR, 0),
declare_panel(ALARMS, 0),
}
#define HAS_NAV
Definition: charosd.h:90
#define HAS_RSSI
Definition: charosd.h:89
#define HAS_PITOT
Definition: charosd.h:86
#define HAS_BATT
Definition: charosd.h:85
#define HAS_GPS
Definition: charosd.h:84
#define HAS_ALT
Definition: charosd.h:87
#define declare_panel(__name, __req)
Definition: panel.c:481
#define HAS_TEMP
Definition: charosd.h:88
#define HAS_COMPASS
Definition: charosd.h:91

Definition at line 485 of file panel.c.

const uint8_t panels_count