Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
Go to the source code of this file.
Functions | |
void | display_drawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) |
draw line More... | |
void | display_drawRect (uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) |
draw rectangle More... | |
void | display_fillRect (uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) |
draw filled rectangle More... | |
void | display_drawCircle (uint16_t x0, uint16_t y0, uint16_t r, uint16_t color) |
draw circle More... | |
void | display_fillCircle (uint16_t x0, uint16_t y0, uint16_t r, uint16_t color) |
draw a filled circle More... | |
void | display_setCursor (uint16_t x, uint16_t y) |
Set text cursor location. More... | |
void | display_setTextSize (uint8_t s) |
Set text 'magnification' size. More... | |
void | display_setTextColor (uint16_t c, uint16_t b) |
Set text font color with custom background color. More... | |
void | display_putc (uint8_t c) |
Print one byte/character of data. More... | |
void | display_puts (const uint8_t *s) |
Print a string to the display. More... | |
void | display_puts_max_n (const uint8_t *s, uint8_t n) |
Print a maximum of (n - 1) characters from the input string to the display and put "..." as the nth character afterwards to indicate that the string was truncated. More... | |
void | display_double (char *text, int text_size, double v, int decimalDigits) |
convert a float to a string More... | |
void | display_setRotation (uint16_t rotation) |
set the rotation prints starting at the cursor position. More... | |
uint16_t | getCursorX (void) |
Get text cursor X location. More... | |
uint16_t | getCursorY (void) |
Get text cursor Y location. More... | |
uint16_t | display_getWidth () |
Get display Width. More... | |
uint16_t | display_getHeight () |
Get display Height. More... | |
void | display_clear (void) |
clears the frame buffer intializes the background on white. More... | |
void | display_fixed_image (const uint8_t *image) |
Displays the image provided, using full update (slow). More... | |
void | display_drawTriangle (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color) |
Draw a triangle with no fill color. More... | |
void | display_fillTriangle (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color) |
Draw a triangle with color-fill. More... | |
void | display_drawRoundRect (uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t radius, uint16_t color) |
Draw a rounded rectangle with no fill color. More... | |
void | display_fillRoundRect (uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint16_t radius, uint16_t color) |
Draw a rounded rectangle with fill color. More... | |
void | display_drawBitmapV1 (uint16_t x, uint16_t y, const uint8_t *bitmap, uint16_t w, uint16_t h, uint16_t color) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent). More... | |
void | display_drawBitmapV1_bg (uint16_t x, uint16_t y, const uint8_t *bitmap, uint16_t w, uint16_t h, uint16_t color, uint16_t bg) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors. More... | |
void | display_drawBitmapV2 (uint16_t x, uint16_t y, const uint8_t *bitmap, uint16_t w, uint16_t h, uint16_t color) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent). More... | |
void | display_drawBitmapV2_bg (uint16_t x, uint16_t y, const uint8_t *bitmap, uint16_t w, uint16_t h, uint16_t color, uint16_t bg) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors. More... | |
void | display_drawPixel (int16_t x, int16_t y, uint16_t color) |
uint8_t | display_getRotation () |
Get rotation setting for display. More... | |
void | display_customChar (const uint8_t *c) |
void | display_drawChar (uint16_t x, uint16_t y, uint8_t c, uint16_t color, uint16_t bg, uint8_t size) |
Draw a single character. More... | |
void | display_setContrast (uint32_t contrast) |
void | display_slider (int x, int y, int length, int value) |
void | display_progressbar (int x, int y, int length, int value) |
void display_clear | ( | void | ) |
clears the frame buffer intializes the background on white.
void display_customChar | ( | const uint8_t * | c | ) |
void display_double | ( | char * | text, |
int | text_size, | ||
double | v, | ||
int | decimalDigits | ||
) |
convert a float to a string
text | the text buffer to write in |
text_size | the size of the text buffer |
v | the floating number to display |
decimalDigits | the decimal digit to display |
void display_drawBitmapV1 | ( | uint16_t | x, |
uint16_t | y, | ||
const uint8_t * | bitmap, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | color | ||
) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent).
x | Top left corner x coordinate |
y | Top left corner y coordinate |
bitmap | byte array with monochrome bitmap |
w | Width of bitmap in pixels |
h | Hieght of bitmap in pixels |
color | 16-bit 5-6-5 Color to draw with |
void display_drawBitmapV1_bg | ( | uint16_t | x, |
uint16_t | y, | ||
const uint8_t * | bitmap, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | color, | ||
uint16_t | bg | ||
) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors.
x | Top left corner x coordinate |
y | Top left corner y coordinate |
bitmap | byte array with monochrome bitmap |
w | Width of bitmap in pixels |
h | Hieght of bitmap in pixels |
color | 16-bit 5-6-5 Color to draw pixels with |
bg | 16-bit 5-6-5 Color to draw background with |
void display_drawBitmapV2 | ( | uint16_t | x, |
uint16_t | y, | ||
const uint8_t * | bitmap, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | color | ||
) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent).
x | Top left corner x coordinate |
y | Top left corner y coordinate |
bitmap | byte array with monochrome bitmap |
w | Width of bitmap in pixels |
h | Hieght of bitmap in pixels |
color | 16-bit 5-6-5 Color to draw pixels with |
void display_drawBitmapV2_bg | ( | uint16_t | x, |
uint16_t | y, | ||
const uint8_t * | bitmap, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | color, | ||
uint16_t | bg | ||
) |
Draw a ROM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors.
x | Top left corner x coordinate |
y | Top left corner y coordinate |
bitmap | byte array with monochrome bitmap |
w | Width of bitmap in pixels |
h | Hieght of bitmap in pixels |
color | 16-bit 5-6-5 Color to draw pixels with |
bg | 16-bit 5-6-5 Color to draw background with |
void display_drawChar | ( | uint16_t | x, |
uint16_t | y, | ||
uint8_t | c, | ||
uint16_t | color, | ||
uint16_t | bg, | ||
uint8_t | size | ||
) |
Draw a single character.
x | Bottom left corner x coordinate |
y | Bottom left corner y coordinate |
c | The 8-bit font-indexed character (likely ascii) |
color | 16-bit 5-6-5 Color to draw chraracter with |
bg | 16-bit 5-6-5 Color to fill background with (if same as color, no background) |
size | Font magnification level, 1 is 'original' size |
void display_drawCircle | ( | uint16_t | x0, |
uint16_t | y0, | ||
uint16_t | r, | ||
uint16_t | color | ||
) |
draw circle
draws a circle
x0 | the x coordinate |
y0 | the y coordinate |
r | the radius in pixels |
color | the color of the circle (BLACK or WHITE) |
draw circle
x0 | Center-point x coordinate |
y0 | Center-point y coordinate |
r | Radius of circle |
color | 16-bit 5-6-5 Color to draw with |
void display_drawLine | ( | uint16_t | x0, |
uint16_t | y0, | ||
uint16_t | x1, | ||
uint16_t | y1, | ||
uint16_t | color | ||
) |
draw line
draws a line. NOTE: Under some circumstances, the line drawn will exceed the bounds of the provided coordinates by 1 pixel. So some trial-error and manual adjustments may be needed when using this function.
x0 | the lower x coordinate |
y0 | the lower y coordinate |
x1 | the higher x coordinate |
y1 | the higher y coordinate |
color | the color of the line (BLACK or WHITE) |
draw line
x0 | Start point x coordinate |
y0 | Start point y coordinate |
x1 | End point x coordinate |
y1 | End point y coordinate |
color | 16-bit 5-6-5 Color to draw with |
void display_drawPixel | ( | int16_t | x, |
int16_t | y, | ||
uint16_t | color | ||
) |
void display_drawRect | ( | uint16_t | x, |
uint16_t | y, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | color | ||
) |
draw rectangle
draws a rectangle
x0 | the x coordinate |
y0 | the y coordinate |
w | the width of the rectangle |
h | the height of the rectangle |
color | the color of the line (BLACK or WHITE) |
draw rectangle
x | Top left corner x coordinate |
y | Top left corner y coordinate |
w | Width in pixels |
h | Height in pixels |
color | 16-bit 5-6-5 Color to draw with |
void display_drawRoundRect | ( | uint16_t | x, |
uint16_t | y, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | r, | ||
uint16_t | color | ||
) |
Draw a rounded rectangle with no fill color.
x | Top left corner x coordinate |
y | Top left corner y coordinate |
w | Width in pixels |
h | Height in pixels |
r | Radius of corner rounding |
color | 16-bit 5-6-5 Color to draw with |
void display_drawTriangle | ( | uint16_t | x0, |
uint16_t | y0, | ||
uint16_t | x1, | ||
uint16_t | y1, | ||
uint16_t | x2, | ||
uint16_t | y2, | ||
uint16_t | color | ||
) |
Draw a triangle with no fill color.
x0 | Vertex #0 x coordinate |
y0 | Vertex #0 y coordinate |
x1 | Vertex #1 x coordinate |
y1 | Vertex #1 y coordinate |
x2 | Vertex #2 x coordinate |
y2 | Vertex #2 y coordinate |
color | 16-bit 5-6-5 Color to draw with |
void display_fillCircle | ( | uint16_t | x0, |
uint16_t | y0, | ||
uint16_t | r, | ||
uint16_t | color | ||
) |
draw a filled circle
draws a filled circle
x0 | the x coordinate |
y0 | the y coordinate |
r | the radius in pixels |
color | the color of the circle (BLACK or WHITE) |
draw a filled circle
x0 | Center-point x coordinate |
y0 | Center-point y coordinate |
r | Radius of circle |
color | 16-bit 5-6-5 Color to fill with |
void display_fillRect | ( | uint16_t | x, |
uint16_t | y, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | color | ||
) |
draw filled rectangle
draws a filled rectangle
x0 | the x coordinate |
y0 | the y coordinate |
w | the width of the rectangle |
h | the height of the rectangle |
color | the color of the line (BLACK or WHITE) |
void display_fillRoundRect | ( | uint16_t | x, |
uint16_t | y, | ||
uint16_t | w, | ||
uint16_t | h, | ||
uint16_t | r, | ||
uint16_t | color | ||
) |
Draw a rounded rectangle with fill color.
x | Top left corner x coordinate |
y | Top left corner y coordinate |
w | Width in pixels |
h | Height in pixels |
r | Radius of corner rounding |
color | 16-bit 5-6-5 Color to draw/fill with |
void display_fillTriangle | ( | uint16_t | x0, |
uint16_t | y0, | ||
uint16_t | x1, | ||
uint16_t | y1, | ||
uint16_t | x2, | ||
uint16_t | y2, | ||
uint16_t | color | ||
) |
Draw a triangle with color-fill.
x0 | Vertex #0 x coordinate |
y0 | Vertex #0 y coordinate |
x1 | Vertex #1 x coordinate |
y1 | Vertex #1 y coordinate |
x2 | Vertex #2 x coordinate |
y2 | Vertex #2 y coordinate |
color | 16-bit 5-6-5 Color to fill/draw with |
void display_fixed_image | ( | const uint8_t * | image | ) |
Displays the image provided, using full update (slow).
image | The image to be displayed. |
uint16_t display_getHeight | ( | void | ) |
Get display Height.
Get display Height.
uint8_t display_getRotation | ( | void | ) |
Get rotation setting for display.
uint16_t display_getWidth | ( | void | ) |
Get display Width.
Get display Width.
void display_progressbar | ( | int | x, |
int | y, | ||
int | length, | ||
int | value | ||
) |
void display_putc | ( | uint8_t | c | ) |
Print one byte/character of data.
c | The 8-bit ascii character to write |
note use snprintf to format text
c | The 8-bit ascii character to write |
void display_puts | ( | const uint8_t * | s | ) |
Print a string to the display.
s | The string to write |
note use snprintf to format text snprintf does not display floating numbers use display_double() to display floating numbers
void display_puts_max_n | ( | const uint8_t * | s, |
uint8_t | n | ||
) |
Print a maximum of (n - 1) characters from the input string to the display and put "..." as the nth character afterwards to indicate that the string was truncated.
s | The input string to write (will be truncated if longer than n characters) |
n | The maximum number of characters (minus 1 to leave space for "...") to display from the input string NOTE: This is only the number of VISIBLE characters, so excludes NULL terminator. |
note use snprintf to format text snprintf does not display floating numbers use display_double() to display floating numbers
EXAMPLE: const char *str = "Hello, World!"; display_puts_max_n(s, 30); // Result is: Hello, World! display_puts_max_n(s, 9); // Result is: Hello, W...
void display_setContrast | ( | uint32_t | contrast | ) |
void display_setCursor | ( | uint16_t | x, |
uint16_t | y | ||
) |
Set text cursor location.
x | X coordinate in pixels |
y | Y coordinate in pixels |
void display_setRotation | ( | uint16_t | rotation | ) |
set the rotation prints starting at the cursor position.
rotation | 0 == no rotation, 1 = 90 degrees |
void display_setTextColor | ( | uint16_t | c, |
uint16_t | b | ||
) |
Set text font color with custom background color.
c | BLACK or WHITE |
b | BLACK or WHITE |
c | 16-bit 5-6-5 Color to draw text with |
b | 16-bit 5-6-5 Color to draw background/fill with |
void display_setTextSize | ( | uint8_t | s | ) |
Set text 'magnification' size.
Each increase in s makes 1 pixel that much bigger.
s | Desired text size. 1 is default 6x8, 2 is 12x16, 3 is 18x24, etc |
void display_slider | ( | int | x, |
int | y, | ||
int | length, | ||
int | value | ||
) |
uint16_t getCursorX | ( | void | ) |
Get text cursor X location.
uint16_t getCursorY | ( | void | ) |
Get text cursor Y location.