dRonin
adbada4
dRonin firmware
|
Fonts for OSD. More...
Files | |
file | onscreendisplay.h |
OSD gen module, handles OSD draw. Parts from CL-OSD and SUPEROSD projects. | |
file | osd_menu.h |
OSD Menu. | |
file | osd_utils.h |
OSD Utility Functions. | |
file | onscreendisplay.c |
Process OSD information. | |
file | osd_menu.c |
OSD Menu. | |
file | osd_utils.c |
OSD Utility Functions. | |
Data Structures | |
struct | FontEntry |
struct | FontDimensions |
struct | point_t |
Macros | |
#define | NUM_FONTS 4 |
#define | FONT8X10 0 |
#define | FONT_OUTLINED8X14 1 |
#define | FONT12X18 2 |
#define | FONT_OUTLINED8X8 3 |
#define | SIZEOF_ARRAY(x) (sizeof(x) / sizeof((x)[0])) |
#define | HUD_VSCALE_FLAG_CLEAR 1 |
#define | HUD_VSCALE_FLAG_NO_NEGATIVE 2 |
#define | PIXELS_PER_BIT (8 / PIOS_VIDEO_BITS_PER_PIXEL) |
#define | CALC_BIT_IN_WORD(x) (2 * ((x) & 3)) |
#define | CALC_BITSHIFT_WORD(x) (2 * ((x) & 3)) |
#define | CALC_BIT_MASK(x) (3 << (6 - CALC_BITSHIFT_WORD(x))) |
#define | PACK_BITS(mask, level) (level << 7 | mask << 6 | level << 5 | mask << 4 | level << 3 | mask << 2 | level << 1 | mask) |
#define | CALC_BIT0_IN_WORD(x) (2 * ((x) & 3)) |
#define | CALC_BIT1_IN_WORD(x) (2 * ((x) & 3) + 1) |
#define | COMPUTE_HLINE_EDGE_L_MASK(b) ((1 << (7 - (b))) - 1) |
#define | COMPUTE_HLINE_EDGE_R_MASK(b) (~((1 << (6 - (b))) - 1)) |
#define | CALC_BUFF_ADDR(x, y) (((x) / PIXELS_PER_BIT) + ((y) * BUFFER_WIDTH)) |
#define | DEBUG_DELAY |
#define | WRITE_WORD_MODE(buff, addr, mask, mode) |
#define | WRITE_WORD_NAND(buff, addr, mask) { buff[addr] &= ~mask; DEBUG_DELAY; } |
#define | WRITE_WORD_OR(buff, addr, mask) { buff[addr] |= mask; DEBUG_DELAY; } |
#define | WRITE_WORD_XOR(buff, addr, mask) { buff[addr] ^= mask; DEBUG_DELAY; } |
#define | WRITE_WORD(buff, addr, mask, value) { buff[addr] = (buff[addr] & ~mask) | (value & mask);} |
#define | COMPUTE_HLINE_ISLAND_MASK(b0, b1) (COMPUTE_HLINE_EDGE_L_MASK(b0) ^ COMPUTE_HLINE_EDGE_L_MASK(b1)); |
#define | SETUP_STROKE_FILL(stroke, fill, mode) |
#define | ENDCAP_NONE 0 |
#define | ENDCAP_ROUND 1 |
#define | ENDCAP_FLAT 2 |
#define | DRAW_ENDCAP_HLINE(e, x, y, s, f, l) |
#define | DRAW_ENDCAP_VLINE(e, x, y, s, f, l) |
#define | CIRCLE_PLOT_8(buff, cx, cy, x, y, mode) |
#define | CIRCLE_PLOT_4(buff, cx, cy, x, y, mode) |
#define | FONT_BOLD 1 |
#define | FONT_INVERT 2 |
#define | TEXT_VA_TOP 0 |
#define | TEXT_VA_MIDDLE 1 |
#define | TEXT_VA_BOTTOM 2 |
#define | TEXT_HA_LEFT 0 |
#define | TEXT_HA_CENTER 1 |
#define | TEXT_HA_RIGHT 2 |
#define | MAX3(a, b, c) MAX(a, MAX(b, c)) |
#define | MIN3(a, b, c) MIN(a, MIN(b, c)) |
#define | LIMIT(x, l, h) MAX(l, MIN(x, h)) |
#define | CHECK_COORDS(x, y) if (x < GRAPHICS_LEFT || x > GRAPHICS_RIGHT || y < GRAPHICS_TOP || y > GRAPHICS_BOTTOM) { return; } |
#define | CHECK_COORD_X(x) if (x < GRAPHICS_LEFT || x > GRAPHICS_RIGHT) { return; } |
#define | CHECK_COORD_Y(y) if (y < GRAPHICS_TOP || y > GRAPHICS_BOTTOM) { return; } |
#define | CLIP_COORDS(x, y) { CLIP_COORD_X(x); CLIP_COORD_Y(y); } |
#define | CLIP_COORD_X(x) { x = x < GRAPHICS_LEFT ? GRAPHICS_LEFT : x > GRAPHICS_RIGHT ? GRAPHICS_RIGHT : x; } |
#define | CLIP_COORD_Y(y) { y = y < GRAPHICS_TOP ? GRAPHICS_TOP : y > GRAPHICS_BOTTOM ? GRAPHICS_BOTTOM : y; } |
#define | SWAP(a, b) { a ^= b; b ^= a; a ^= b; } |
#define | ASSERT_CONCAT_(a, b) a ## b |
#define | ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b) |
#define | STATIC_ASSERT(e, m) { enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }; } |
#define | STACK_SIZE_BYTES 2048 |
#define | TASK_PRIORITY PIOS_THREAD_PRIO_LOW |
#define | BLINK_INTERVAL_FRAMES 12 |
#define | BOOT_DISPLAY_TIME_MS (10*1000) |
#define | STATS_DELAY_MS 1500 |
#define | MS_TO_KMH 3.6f |
#define | MS_TO_MPH 2.23694f |
#define | M_TO_FEET 3.28084f |
#define | VERTICAL_SCALE_FILLED_NUMBER |
#define | VSCALE_FONT FONT8X10 |
#define | COMPASS_SMALL_NUMBER |
#define | CENTER_BODY 3 |
#define | CENTER_WING 7 |
#define | CENTER_RUDDER 5 |
#define | PITCH_STEP 10 |
#define | STATS_LINE_SPACING 11 |
#define | STATS_LINE_Y 40 |
#define | STATS_LINE_X (GRAPHICS_LEFT + 10) |
#define | STATS_FONT FONT8X10 |
#define | BLANK_TIME 2000 |
#define | INTRO_TIME 5500 |
Functions | |
int32_t | OnScreenDisplayInitialize (void) |
int | render_stats () |
void | render_osd_menu () |
void | clearGraphics () |
void | draw_image (uint16_t x, uint16_t y, const struct Image *image) |
void | plotFourQuadrants (int32_t centerX, int32_t centerY, int32_t deltaX, int32_t deltaY) |
void | ellipse (int centerX, int centerY, int horizontalRadius, int verticalRadius) |
void | drawArrow (uint16_t x, uint16_t y, uint16_t angle, uint16_t size_quarter) |
void | drawBox (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) |
void | write_pixel_lm (int x, int y, int mmode, int lmode) |
void | write_hline_lm (int x0, int x1, int y, int lmode, int mmode) |
void | write_hline_outlined (int x0, int x1, int y, int endcap0, int endcap1, int mode, int mmode) |
void | write_vline_lm (int x, int y0, int y1, int lmode, int mmode) |
void | write_vline_outlined (int x, int y0, int y1, int endcap0, int endcap1, int mode, int mmode) |
void | write_filled_rectangle_lm (int x, int y, int width, int height, int lmode, int mmode) |
void | write_rectangle_outlined (int x, int y, int width, int height, int mode, int mmode) |
void | write_circle_outlined (int cx, int cy, int r, int dashp, int bmode, int mode, int mmode) |
void | write_line_lm (int x0, int y0, int x1, int y1, int mmode, int lmode) |
void | write_line_outlined (int x0, int y0, int x1, int y1, __attribute__((unused)) int endcap0, __attribute__((unused)) int endcap1, int mode, int mmode) |
void | write_line_outlined_dashed (int x0, int y0, int x1, int y1, __attribute__((unused)) int endcap0, __attribute__((unused)) int endcap1, int mode, int mmode, int dots) |
const struct FontEntry * | get_font_info (int font) |
void | calc_text_dimensions (char *str, const struct FontEntry *font, int xs, int ys, struct FontDimensions *dim) |
void | write_string (char *str, int x, int y, int xs, int ys, int va, int ha, int flags, int font) |
void | draw_polygon (int16_t x, int16_t y, float angle, const point_t *points, uint8_t n_points, int mode, int mmode) |
void | lla_to_ned (int32_t lat, int32_t lon, float alt, float *NED) |
uint8_t | PIOS_Board_Revision (void) |
static void | onScreenDisplayTask (void *parameters) |
void | drawBattery (uint16_t x, uint16_t y, uint8_t battery, uint16_t size) |
void | hud_draw_vertical_scale (int v, int range, int halign, int x, int y, int height, int mintick_step, int majtick_step, int mintick_len, int majtick_len, int boundtick_len, __attribute__((unused)) int max_val, int flags) |
void | hud_draw_linear_compass (int v, int home_dir, int range, int width, int x, int y, int mintick_step, int majtick_step, int mintick_len, int majtick_len, __attribute__((unused)) int flags) |
void | simple_artificial_horizon (float roll, float pitch, int16_t x, int16_t y, int16_t width, int16_t height, int8_t max_pitch, uint8_t n_pitch_steps, bool show_horizon, OnScreenDisplayPageSettingsCenterMarkOptions center_mark) |
void | draw_flight_mode (int x, int y, int xs, int ys, int va, int ha, int flags, int font) |
void | draw_alarms (int x, int y, int xs, int ys, int va, int ha, int flags, int font) |
void | draw_map_home_center (int width_px, int height_px, int width_m, int height_m, bool show_wp, bool show_home, bool show_tablet) |
void | draw_map_uav_center (int width_px, int height_px, int width_m, int height_m, bool show_wp, bool show_uav, bool show_tablet) |
void | introGraphics (int16_t x, int16_t y) |
void | introText (int16_t x, int16_t y) |
void | printFWVersion (int16_t x, int16_t y) |
void | showVideoType (int16_t x, int16_t y) |
void | render_user_page (OnScreenDisplayPageSettingsData *page) |
void | set_ntsc_pal_settings (enum pios_video_system video_system) |
int32_t | OnScreenDisplayStart (void) |
MODULE_INITCALL (OnScreenDisplayInitialize, OnScreenDisplayStart) | |
static float | get_accessorydesired (int idx) |
static void | onScreenDisplayTask (__attribute__((unused)) void *parameters) |
void | write_pixel (int x, int y, uint8_t value) |
void | write_hline (int x0, int x1, int y, uint8_t value) |
void | write_vline (int x, int y0, int y1, uint8_t value) |
void | write_filled_rectangle (int x, int y, int width, int height, uint8_t value) |
void | write_line (int x0, int y0, int x1, int y1, uint8_t value) |
void | write_word_misaligned_NAND (uint8_t *buff, uint16_t word, unsigned int addr, unsigned int xoff) |
void | write_word_misaligned_OR (uint8_t *buff, uint16_t word, unsigned int addr, unsigned int xoff) |
void | write_word_misaligned_MASKED (uint8_t *buff, uint16_t word, uint16_t mask, unsigned int addr, unsigned int xoff) |
void | write_char (uint8_t ch, int x, int y, const struct FontEntry *font_info) |
Fonts for OSD.
OSD Utility Functions.
OSD Menu.
Process OSD information.
#define ASSERT_CONCAT | ( | a, | |
b | |||
) | ASSERT_CONCAT_(a, b) |
Definition at line 42 of file onscreendisplay.c.
#define ASSERT_CONCAT_ | ( | a, | |
b | |||
) | a ## b |
Definition at line 41 of file onscreendisplay.c.
#define BLANK_TIME 2000 |
Main osd task. It does not return.
Definition at line 1730 of file onscreendisplay.c.
#define BLINK_INTERVAL_FRAMES 12 |
Definition at line 125 of file onscreendisplay.c.
#define BOOT_DISPLAY_TIME_MS (10*1000) |
Definition at line 126 of file onscreendisplay.c.
#define CALC_BIT0_IN_WORD | ( | x | ) | (2 * ((x) & 3)) |
Definition at line 63 of file osd_utils.h.
#define CALC_BIT1_IN_WORD | ( | x | ) | (2 * ((x) & 3) + 1) |
Definition at line 64 of file osd_utils.h.
#define CALC_BIT_IN_WORD | ( | x | ) | (2 * ((x) & 3)) |
Definition at line 59 of file osd_utils.h.
#define CALC_BIT_MASK | ( | x | ) | (3 << (6 - CALC_BITSHIFT_WORD(x))) |
Definition at line 61 of file osd_utils.h.
#define CALC_BITSHIFT_WORD | ( | x | ) | (2 * ((x) & 3)) |
Definition at line 60 of file osd_utils.h.
#define CALC_BUFF_ADDR | ( | x, | |
y | |||
) | (((x) / PIXELS_PER_BIT) + ((y) * BUFFER_WIDTH)) |
Definition at line 72 of file osd_utils.h.
#define CENTER_BODY 3 |
Definition at line 517 of file onscreendisplay.c.
#define CENTER_RUDDER 5 |
Definition at line 519 of file onscreendisplay.c.
#define CENTER_WING 7 |
Definition at line 518 of file onscreendisplay.c.
#define CHECK_COORD_X | ( | x | ) | if (x < GRAPHICS_LEFT || x > GRAPHICS_RIGHT) { return; } |
Definition at line 144 of file osd_utils.h.
#define CHECK_COORD_Y | ( | y | ) | if (y < GRAPHICS_TOP || y > GRAPHICS_BOTTOM) { return; } |
Definition at line 145 of file osd_utils.h.
#define CHECK_COORDS | ( | x, | |
y | |||
) | if (x < GRAPHICS_LEFT || x > GRAPHICS_RIGHT || y < GRAPHICS_TOP || y > GRAPHICS_BOTTOM) { return; } |
Definition at line 143 of file osd_utils.h.
#define CIRCLE_PLOT_4 | ( | buff, | |
cx, | |||
cy, | |||
x, | |||
y, | |||
mode | |||
) |
Definition at line 120 of file osd_utils.h.
#define CIRCLE_PLOT_8 | ( | buff, | |
cx, | |||
cy, | |||
x, | |||
y, | |||
mode | |||
) |
Definition at line 116 of file osd_utils.h.
#define CLIP_COORD_X | ( | x | ) | { x = x < GRAPHICS_LEFT ? GRAPHICS_LEFT : x > GRAPHICS_RIGHT ? GRAPHICS_RIGHT : x; } |
Definition at line 149 of file osd_utils.h.
#define CLIP_COORD_Y | ( | y | ) | { y = y < GRAPHICS_TOP ? GRAPHICS_TOP : y > GRAPHICS_BOTTOM ? GRAPHICS_BOTTOM : y; } |
Definition at line 150 of file osd_utils.h.
#define CLIP_COORDS | ( | x, | |
y | |||
) | { CLIP_COORD_X(x); CLIP_COORD_Y(y); } |
Definition at line 148 of file osd_utils.h.
#define COMPASS_SMALL_NUMBER |
hud_draw_compass: Draw a compass.
v | value for the compass |
range | range about value to display (+/- range/2 each direction) |
width | length in pixels |
x | x displacement |
y | y displacement |
mintick_step | how often a minor tick is shown |
majtick_step | how often a major tick (heading "xx") is shown |
mintick_len | minor tick length |
majtick_len | major tick length |
flags | special flags (see hud.h.) |
Definition at line 399 of file onscreendisplay.c.
#define COMPUTE_HLINE_EDGE_L_MASK | ( | b | ) | ((1 << (7 - (b))) - 1) |
Definition at line 67 of file osd_utils.h.
#define COMPUTE_HLINE_EDGE_R_MASK | ( | b | ) | (~((1 << (6 - (b))) - 1)) |
Definition at line 68 of file osd_utils.h.
#define COMPUTE_HLINE_ISLAND_MASK | ( | b0, | |
b1 | |||
) | (COMPUTE_HLINE_EDGE_L_MASK(b0) ^ COMPUTE_HLINE_EDGE_L_MASK(b1)); |
Definition at line 89 of file osd_utils.h.
#define DEBUG_DELAY |
Definition at line 73 of file osd_utils.h.
#define DRAW_ENDCAP_HLINE | ( | e, | |
x, | |||
y, | |||
s, | |||
f, | |||
l | |||
) |
Definition at line 103 of file osd_utils.h.
#define DRAW_ENDCAP_VLINE | ( | e, | |
x, | |||
y, | |||
s, | |||
f, | |||
l | |||
) |
Definition at line 109 of file osd_utils.h.
#define ENDCAP_FLAT 2 |
Definition at line 101 of file osd_utils.h.
#define ENDCAP_NONE 0 |
Definition at line 99 of file osd_utils.h.
#define ENDCAP_ROUND 1 |
Definition at line 100 of file osd_utils.h.
#define FONT_BOLD 1 |
Definition at line 127 of file osd_utils.h.
#define FONT_INVERT 2 |
Definition at line 128 of file osd_utils.h.
#define HUD_VSCALE_FLAG_CLEAR 1 |
Definition at line 43 of file osd_utils.h.
#define HUD_VSCALE_FLAG_NO_NEGATIVE 2 |
Definition at line 44 of file osd_utils.h.
#define INTRO_TIME 5500 |
Definition at line 1731 of file onscreendisplay.c.
Definition at line 140 of file osd_utils.h.
#define M_TO_FEET 3.28084f |
Definition at line 173 of file onscreendisplay.c.
Definition at line 138 of file osd_utils.h.
Definition at line 139 of file osd_utils.h.
#define MS_TO_KMH 3.6f |
Definition at line 171 of file onscreendisplay.c.
#define MS_TO_MPH 2.23694f |
Definition at line 172 of file onscreendisplay.c.
#define PACK_BITS | ( | mask, | |
level | |||
) | (level << 7 | mask << 6 | level << 5 | mask << 4 | level << 3 | mask << 2 | level << 1 | mask) |
Definition at line 62 of file osd_utils.h.
#define PITCH_STEP 10 |
Definition at line 520 of file onscreendisplay.c.
#define PIXELS_PER_BIT (8 / PIOS_VIDEO_BITS_PER_PIXEL) |
Definition at line 58 of file osd_utils.h.
#define SETUP_STROKE_FILL | ( | stroke, | |
fill, | |||
mode | |||
) |
Definition at line 93 of file osd_utils.h.
#define SIZEOF_ARRAY | ( | x | ) | (sizeof(x) / sizeof((x)[0])) |
Definition at line 41 of file osd_utils.h.
#define STACK_SIZE_BYTES 2048 |
Definition at line 123 of file onscreendisplay.c.
#define STATIC_ASSERT | ( | e, | |
m | |||
) | { enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }; } |
Definition at line 52 of file onscreendisplay.c.
#define STATS_DELAY_MS 1500 |
Definition at line 127 of file onscreendisplay.c.
#define STATS_FONT FONT8X10 |
Definition at line 1540 of file onscreendisplay.c.
#define STATS_LINE_SPACING 11 |
Definition at line 1537 of file onscreendisplay.c.
#define STATS_LINE_X (GRAPHICS_LEFT + 10) |
Definition at line 1539 of file onscreendisplay.c.
#define STATS_LINE_Y 40 |
Definition at line 1538 of file onscreendisplay.c.
#define SWAP | ( | a, | |
b | |||
) | { a ^= b; b ^= a; a ^= b; } |
Definition at line 153 of file osd_utils.h.
#define TASK_PRIORITY PIOS_THREAD_PRIO_LOW |
Definition at line 124 of file onscreendisplay.c.
#define TEXT_HA_CENTER 1 |
Definition at line 134 of file osd_utils.h.
#define TEXT_HA_LEFT 0 |
Definition at line 133 of file osd_utils.h.
#define TEXT_HA_RIGHT 2 |
Definition at line 135 of file osd_utils.h.
#define TEXT_VA_BOTTOM 2 |
Definition at line 132 of file osd_utils.h.
#define TEXT_VA_MIDDLE 1 |
Definition at line 131 of file osd_utils.h.
#define TEXT_VA_TOP 0 |
Definition at line 130 of file osd_utils.h.
#define VERTICAL_SCALE_FILLED_NUMBER |
hud_draw_vertical_scale: Draw a vertical scale.
v | value to display as an integer |
range | range about value to display (+/- range/2 each direction) |
halign | horizontal alignment: -1 = left, +1 = right. |
x | x displacement |
y | y displacement |
height | height of scale |
mintick_step | how often a minor tick is shown |
majtick_step | how often a major tick is shown |
mintick_len | minor tick length |
majtick_len | major tick length |
boundtick_len | boundary tick length |
max_val | maximum expected value (used to compute size of arrow ticker) |
flags | special flags (see hud.h.) |
Definition at line 235 of file onscreendisplay.c.
#define VSCALE_FONT FONT8X10 |
Definition at line 236 of file onscreendisplay.c.
#define WRITE_WORD | ( | buff, | |
addr, | |||
mask, | |||
value | |||
) | { buff[addr] = (buff[addr] & ~mask) | (value & mask);} |
Definition at line 85 of file osd_utils.h.
#define WRITE_WORD_MODE | ( | buff, | |
addr, | |||
mask, | |||
mode | |||
) |
Definition at line 76 of file osd_utils.h.
#define WRITE_WORD_NAND | ( | buff, | |
addr, | |||
mask | |||
) | { buff[addr] &= ~mask; DEBUG_DELAY; } |
Definition at line 82 of file osd_utils.h.
#define WRITE_WORD_OR | ( | buff, | |
addr, | |||
mask | |||
) | { buff[addr] |= mask; DEBUG_DELAY; } |
Definition at line 83 of file osd_utils.h.
#define WRITE_WORD_XOR | ( | buff, | |
addr, | |||
mask | |||
) | { buff[addr] ^= mask; DEBUG_DELAY; } |
Definition at line 84 of file osd_utils.h.
void calc_text_dimensions | ( | char * | str, |
const struct FontEntry * | font, | ||
int | xs, | ||
int | ys, | ||
struct FontDimensions * | dim | ||
) |
calc_text_dimensions: Calculate the dimensions of a string in a given font. Supports new lines and carriage returns in text.
str | string to calculate dimensions of |
font_info | font info structure |
xs | horizontal spacing |
ys | vertical spacing |
dim | return result: struct FontDimensions |
Definition at line 1308 of file osd_utils.c.
void clearGraphics | ( | ) |
Definition at line 60 of file osd_utils.c.
void draw_alarms | ( | int | x, |
int | y, | ||
int | xs, | ||
int | ys, | ||
int | va, | ||
int | ha, | ||
int | flags, | ||
int | font | ||
) |
Definition at line 733 of file onscreendisplay.c.
void draw_flight_mode | ( | int | x, |
int | y, | ||
int | xs, | ||
int | ys, | ||
int | va, | ||
int | ha, | ||
int | flags, | ||
int | font | ||
) |
Definition at line 635 of file onscreendisplay.c.
void draw_image | ( | uint16_t | x, |
uint16_t | y, | ||
const struct Image * | image | ||
) |
Definition at line 70 of file osd_utils.c.
void draw_map_home_center | ( | int | width_px, |
int | height_px, | ||
int | width_m, | ||
int | height_m, | ||
bool | show_wp, | ||
bool | show_home, | ||
bool | show_tablet | ||
) |
Definition at line 769 of file onscreendisplay.c.
void draw_map_uav_center | ( | int | width_px, |
int | height_px, | ||
int | width_m, | ||
int | height_m, | ||
bool | show_wp, | ||
bool | show_uav, | ||
bool | show_tablet | ||
) |
Definition at line 879 of file onscreendisplay.c.
void draw_polygon | ( | int16_t | x, |
int16_t | y, | ||
float | angle, | ||
const point_t * | points, | ||
uint8_t | n_points, | ||
int | mode, | ||
int | mmode | ||
) |
Draw a polygon
Definition at line 1396 of file osd_utils.c.
void drawArrow | ( | uint16_t | x, |
uint16_t | y, | ||
uint16_t | angle, | ||
uint16_t | size_quarter | ||
) |
Definition at line 199 of file osd_utils.c.
void drawBattery | ( | uint16_t | x, |
uint16_t | y, | ||
uint8_t | battery, | ||
uint16_t | size | ||
) |
Definition at line 209 of file onscreendisplay.c.
void drawBox | ( | uint16_t | x1, |
uint16_t | y1, | ||
uint16_t | x2, | ||
uint16_t | y2 | ||
) |
Definition at line 214 of file osd_utils.c.
void ellipse | ( | int | centerX, |
int | centerY, | ||
int | horizontalRadius, | ||
int | verticalRadius | ||
) |
Implements the midpoint ellipse drawing algorithm which is a bresenham style DDF.
centerX | the x coordinate of the center of the ellipse |
centerY | the y coordinate of the center of the ellipse |
horizontalRadius | the horizontal radius of the ellipse |
verticalRadius | the vertical radius of the ellipse |
color | the color of the ellipse border |
Definition at line 152 of file osd_utils.c.
|
static |
Definition at line 1711 of file onscreendisplay.c.
const struct FontEntry * get_font_info | ( | int | font | ) |
fetch_font_info: Fetch font info structs.
font | font id |
Definition at line 1290 of file osd_utils.c.
void hud_draw_linear_compass | ( | int | v, |
int | home_dir, | ||
int | range, | ||
int | width, | ||
int | x, | ||
int | y, | ||
int | mintick_step, | ||
int | majtick_step, | ||
int | mintick_len, | ||
int | majtick_len, | ||
__attribute__((unused)) int | flags | ||
) |
Definition at line 401 of file onscreendisplay.c.
void hud_draw_vertical_scale | ( | int | v, |
int | range, | ||
int | halign, | ||
int | x, | ||
int | y, | ||
int | height, | ||
int | mintick_step, | ||
int | majtick_step, | ||
int | mintick_len, | ||
int | majtick_len, | ||
int | boundtick_len, | ||
__attribute__((unused)) int | max_val, | ||
int | flags | ||
) |
Definition at line 237 of file onscreendisplay.c.
void introGraphics | ( | int16_t | x, |
int16_t | y | ||
) |
Definition at line 1028 of file onscreendisplay.c.
void introText | ( | int16_t | x, |
int16_t | y | ||
) |
Definition at line 1040 of file onscreendisplay.c.
void lla_to_ned | ( | int32_t | lattitude, |
int32_t | longitude, | ||
float | altitude, | ||
float * | NED | ||
) |
Convert LLA to NED coordinates
latitude | |
longitude | |
altitude | |
output |
Definition at line 1447 of file osd_utils.c.
MODULE_INITCALL | ( | OnScreenDisplayInitialize | , |
OnScreenDisplayStart | |||
) |
int32_t OnScreenDisplayInitialize | ( | void | ) |
Initialize the osd module
Definition at line 1656 of file onscreendisplay.c.
int32_t OnScreenDisplayStart | ( | void | ) |
Start the osd module
Definition at line 1633 of file onscreendisplay.c.
|
static |
|
static |
Definition at line 1732 of file onscreendisplay.c.
uint8_t PIOS_Board_Revision | ( | void | ) |
void plotFourQuadrants | ( | int32_t | centerX, |
int32_t | centerY, | ||
int32_t | deltaX, | ||
int32_t | deltaY | ||
) |
Draws four points relative to the given center point.
centerX | the x coordinate of the center point |
centerY | the y coordinate of the center point |
deltaX | the difference between the centerX coordinate and each pixel drawn |
deltaY | the difference between the centerY coordinate and each pixel drawn |
color | the color to draw the pixels with. |
Definition at line 136 of file osd_utils.c.
void printFWVersion | ( | int16_t | x, |
int16_t | y | ||
) |
Definition at line 1045 of file onscreendisplay.c.
void render_osd_menu | ( | ) |
int render_stats | ( | ) |
Definition at line 1542 of file onscreendisplay.c.
void render_user_page | ( | OnScreenDisplayPageSettingsData * | page | ) |
Definition at line 1087 of file onscreendisplay.c.
void set_ntsc_pal_settings | ( | enum pios_video_system | video_system | ) |
Definition at line 1618 of file onscreendisplay.c.
void showVideoType | ( | int16_t | x, |
int16_t | y | ||
) |
Definition at line 1078 of file onscreendisplay.c.
void simple_artificial_horizon | ( | float | roll, |
float | pitch, | ||
int16_t | x, | ||
int16_t | y, | ||
int16_t | width, | ||
int16_t | height, | ||
int8_t | max_pitch, | ||
uint8_t | n_pitch_steps, | ||
bool | show_horizon, | ||
OnScreenDisplayPageSettingsCenterMarkOptions | center_mark | ||
) |
Definition at line 521 of file onscreendisplay.c.
void write_char | ( | uint8_t | ch, |
int | x, | ||
int | y, | ||
const struct FontEntry * | font_info | ||
) |
write_char: Draw a character on the current draw buffer.
ch | character to write |
x | x coordinate (left) |
y | y coordinate (top) |
font_info | font to use |
Definition at line 1206 of file osd_utils.c.
void write_circle_outlined | ( | int | cx, |
int | cy, | ||
int | r, | ||
int | dashp, | ||
int | bmode, | ||
int | mode, | ||
int | mmode | ||
) |
void write_filled_rectangle | ( | int | x, |
int | y, | ||
int | width, | ||
int | height, | ||
uint8_t | value | ||
) |
write_filled_rectangle: draw a filled rectangle.
Uses an optimised algorithm which is similar to the horizontal line writing algorithm, but optimised for writing the lines multiple times without recalculating lots of stuff.
buff | pointer to buffer to write in |
x | x coordinate (left) |
y | y coordinate (top) |
width | rectangle width |
height | rectangle height |
mode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 594 of file osd_utils.c.
void write_filled_rectangle_lm | ( | int | x, |
int | y, | ||
int | width, | ||
int | height, | ||
int | lmode, | ||
int | mmode | ||
) |
write_filled_rectangle_lm: draw a filled rectangle on both draw buffers.
x | x coordinate (left) |
y | y coordinate (top) |
width | rectangle width |
height | rectangle height |
lmode | 0 = clear, 1 = set, 2 = toggle |
mmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 659 of file osd_utils.c.
void write_hline | ( | int | x0, |
int | x1, | ||
int | y, | ||
uint8_t | value | ||
) |
write_hline: optimised horizontal line writing algorithm
buff | pointer to buffer to write in |
x0 | x0 coordinate |
x1 | x1 coordinate |
y | y coordinate |
mode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 324 of file osd_utils.c.
void write_hline_lm | ( | int | x0, |
int | x1, | ||
int | y, | ||
int | lmode, | ||
int | mmode | ||
) |
write_hline_lm: write both level and mask buffers.
x0 | x0 coordinate |
x1 | x1 coordinate |
y | y coordinate |
lmode | 0 = clear, 1 = set, 2 = toggle |
mmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 372 of file osd_utils.c.
void write_hline_outlined | ( | int | x0, |
int | x1, | ||
int | y, | ||
int | endcap0, | ||
int | endcap1, | ||
int | mode, | ||
int | mmode | ||
) |
write_hline_outlined: outlined horizontal line with varying endcaps Always uses draw buffer.
x0 | x0 coordinate |
x1 | x1 coordinate |
y | y coordinate |
endcap0 | 0 = none, 1 = single pixel, 2 = full cap |
endcap1 | 0 = none, 1 = single pixel, 2 = full cap |
mode | 0 = black outline, white body, 1 = white outline, black body |
mmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 397 of file osd_utils.c.
void write_line | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
uint8_t | value | ||
) |
write_line: Draw a line of arbitrary angle.
buff | pointer to buffer to write in |
x0 | first x coordinate |
y0 | first y coordinate |
x1 | second x coordinate |
y1 | second y coordinate |
mode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 873 of file osd_utils.c.
void write_line_lm | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
int | mmode, | ||
int | lmode | ||
) |
write_line_lm: Draw a line of arbitrary angle.
x0 | first x coordinate |
y0 | first y coordinate |
x1 | second x coordinate |
y1 | second y coordinate |
mmode | 0 = clear, 1 = set, 2 = toggle |
lmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 922 of file osd_utils.c.
void write_line_outlined | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
__attribute__((unused)) int | endcap0, | ||
__attribute__((unused)) int | endcap1, | ||
int | mode, | ||
int | mmode | ||
) |
write_line_outlined: Draw a line of arbitrary angle, with an outline.
x0 | first x coordinate |
y0 | first y coordinate |
x1 | second x coordinate |
y1 | second y coordinate |
endcap0 | 0 = none, 1 = single pixel, 2 = full cap |
endcap1 | 0 = none, 1 = single pixel, 2 = full cap |
mode | 0 = black outline, white body, 1 = white outline, black body |
mmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 945 of file osd_utils.c.
void write_line_outlined_dashed | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
__attribute__((unused)) int | endcap0, | ||
__attribute__((unused)) int | endcap1, | ||
int | mode, | ||
int | mmode, | ||
int | dots | ||
) |
write_line_outlined_dashed: Draw a line of arbitrary angle, with an outline, potentially dashed.
x0 | first x coordinate |
y0 | first y coordinate |
x1 | second x coordinate |
y1 | second y coordinate |
endcap0 | 0 = none, 1 = single pixel, 2 = full cap |
endcap1 | 0 = none, 1 = single pixel, 2 = full cap |
mode | 0 = black outline, white body, 1 = white outline, black body |
mmode | 0 = clear, 1 = set, 2 = toggle |
dots | 0 = not dashed, > 0 = # of set/unset dots for the dashed innards |
Definition at line 1029 of file osd_utils.c.
void write_pixel | ( | int | x, |
int | y, | ||
uint8_t | value | ||
) |
Definition at line 241 of file osd_utils.c.
void write_pixel_lm | ( | int | x, |
int | y, | ||
int | mmode, | ||
int | lmode | ||
) |
write_pixel_lm: write the pixel on both surfaces (level and mask.) Uses current draw buffer.
x | x coordinate |
y | y coordinate |
mmode | 0 = clear, 1 = set, 2 = toggle |
lmode | 0 = black, 1 = white, 2 = toggle |
Definition at line 261 of file osd_utils.c.
void write_rectangle_outlined | ( | int | x, |
int | y, | ||
int | width, | ||
int | height, | ||
int | mode, | ||
int | mmode | ||
) |
write_rectangle_outlined: draw an outline of a rectangle. Essentially a convenience wrapper for draw_hline_outlined and draw_vline_outlined.
x | x coordinate (left) |
y | y coordinate (top) |
width | rectangle width |
height | rectangle height |
mode | 0 = black outline, white body, 1 = white outline, black body |
mmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 681 of file osd_utils.c.
void write_string | ( | char * | str, |
int | x, | ||
int | y, | ||
int | xs, | ||
int | ys, | ||
int | va, | ||
int | ha, | ||
int | flags, | ||
int | font | ||
) |
write_string: Draw a string on the screen with certain alignment parameters.
str | string to write |
x | x coordinate |
y | y coordinate |
xs | horizontal spacing |
ys | horizontal spacing |
va | vertical align |
ha | horizontal align |
flags | flags (passed to write_char) |
font | font |
Definition at line 1344 of file osd_utils.c.
void write_vline | ( | int | x, |
int | y0, | ||
int | y1, | ||
uint8_t | value | ||
) |
write_vline: optimised vertical line writing algorithm
buff | pointer to buffer to write in |
x | x coordinate |
y0 | y0 coordinate |
y1 | y1 coordinate |
mode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 448 of file osd_utils.c.
void write_vline_lm | ( | int | x, |
int | y0, | ||
int | y1, | ||
int | lmode, | ||
int | mmode | ||
) |
write_vline_lm: write both level and mask buffers.
x | x coordinate |
y0 | y0 coordinate |
y1 | y1 coordinate |
lmode | 0 = clear, 1 = set, 2 = toggle |
mmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 483 of file osd_utils.c.
void write_vline_outlined | ( | int | x, |
int | y0, | ||
int | y1, | ||
int | endcap0, | ||
int | endcap1, | ||
int | mode, | ||
int | mmode | ||
) |
write_vline_outlined: outlined vertical line with varying endcaps Always uses draw buffer.
x | x coordinate |
y0 | y0 coordinate |
y1 | y1 coordinate |
endcap0 | 0 = none, 1 = single pixel, 2 = full cap |
endcap1 | 0 = none, 1 = single pixel, 2 = full cap |
mode | 0 = black outline, white body, 1 = white outline, black body |
mmode | 0 = clear, 1 = set, 2 = toggle |
Definition at line 508 of file osd_utils.c.
void write_word_misaligned_MASKED | ( | uint8_t * | buff, |
uint16_t | word, | ||
uint16_t | mask, | ||
unsigned int | addr, | ||
unsigned int | xoff | ||
) |
write_word_misaligned_OR: Write a misaligned word across two addresses with an x offset, using an OR mask.
This allows for many pixels to be set in one write.
buff | buffer to write in |
word | word to write (16 bits) |
addr | address of first word |
xoff | x offset (0-15) |
This is identical to calling write_word_misaligned with a mode of 1 but it doesn't go through a lot of switch logic which slows down text writing a lot.
Definition at line 1183 of file osd_utils.c.
void write_word_misaligned_NAND | ( | uint8_t * | buff, |
uint16_t | word, | ||
unsigned int | addr, | ||
unsigned int | xoff | ||
) |
write_word_misaligned_NAND: Write a misaligned word across two addresses with an x offset, using a NAND mask.
This allows for many pixels to be set in one write.
buff | buffer to write in |
word | word to write (16 bits) |
addr | address of first word |
xoff | x offset (0-15) |
This is identical to calling write_word_misaligned with a mode of 0 but it doesn't go through a lot of switch logic which slows down text writing a lot.
Definition at line 1129 of file osd_utils.c.
void write_word_misaligned_OR | ( | uint8_t * | buff, |
uint16_t | word, | ||
unsigned int | addr, | ||
unsigned int | xoff | ||
) |
write_word_misaligned_OR: Write a misaligned word across two addresses with an x offset, using an OR mask.
This allows for many pixels to be set in one write.
buff | buffer to write in |
word | word to write (16 bits) |
addr | address of first word |
xoff | x offset (0-15) |
This is identical to calling write_word_misaligned with a mode of 1 but it doesn't go through a lot of switch logic which slows down text writing a lot.
Definition at line 1156 of file osd_utils.c.
|
static |
Definition at line 198 of file onscreendisplay.c.
float convert_distance |
Definition at line 187 of file onscreendisplay.c.
float convert_distance_divider |
Definition at line 188 of file onscreendisplay.c.
float convert_speed |
Definition at line 186 of file onscreendisplay.c.
const char digits[16] = "0123456789abcdef" |
Definition at line 192 of file onscreendisplay.c.
uint8_t* disp_buffer |
const char* dist_unit_long = METRIC_DIST_UNIT_LONG |
Definition at line 189 of file onscreendisplay.c.
const char* dist_unit_short = METRIC_DIST_UNIT_SHORT |
Definition at line 190 of file onscreendisplay.c.
uint8_t* draw_buffer |
uint8_t* draw_buffer_level |
uint8_t* draw_buffer_mask |
|
static |
|
static |
|
static |
|
static |
const struct FontEntry* fonts[NUM_FONTS] = {&font_font8x10, &font_font_outlined8x14, &font_font12x18, &font_font_outlined8x8} |
uint16_t frame_counter = 0 |
Definition at line 177 of file onscreendisplay.c.
|
static |
Definition at line 182 of file onscreendisplay.c.
|
static |
Definition at line 179 of file onscreendisplay.c.
|
static |
Definition at line 180 of file onscreendisplay.c.
|
static |
Definition at line 183 of file onscreendisplay.c.
|
static |
Definition at line 181 of file onscreendisplay.c.
const point_t HOME_ARROW[] |
Definition at line 139 of file onscreendisplay.c.
float home_baro_altitude = 0 |
Definition at line 194 of file onscreendisplay.c.
const char IMPERIAL_DIST_UNIT_LONG[] = "M" |
Definition at line 133 of file onscreendisplay.c.
const char IMPERIAL_DIST_UNIT_SHORT[] = "ft" |
Definition at line 134 of file onscreendisplay.c.
const char IMPERIAL_SPEED_UNIT[] = "MPH" |
Definition at line 135 of file onscreendisplay.c.
const uint8_t lookup_font12x18[] |
const uint8_t lookup_font8x10[] |
const uint8_t lookup_font_outlined8x14[] |
const uint8_t lookup_font_outlined8x8[] |
const char METRIC_DIST_UNIT_LONG[] = "km" |
Definition at line 129 of file onscreendisplay.c.
const char METRIC_DIST_UNIT_SHORT[] = "m" |
Definition at line 130 of file onscreendisplay.c.
const char METRIC_SPEED_UNIT[] = "km/h" |
Definition at line 131 of file onscreendisplay.c.
|
static |
Definition at line 178 of file onscreendisplay.c.
struct pios_semaphore* onScreenDisplaySemaphore = NULL |
Definition at line 185 of file onscreendisplay.c.
|
static |
Definition at line 196 of file onscreendisplay.c.
|
static |
Definition at line 197 of file onscreendisplay.c.
|
static |
Definition at line 195 of file onscreendisplay.c.
const char* speed_unit = METRIC_SPEED_UNIT |
Definition at line 191 of file onscreendisplay.c.
|
static |
Definition at line 184 of file onscreendisplay.c.
volatile bool video_active |
Definition at line 137 of file onscreendisplay.c.