WGR-V
 
Lade ...
Suche ...
Keine Treffer
wgrhal_ext.h
gehe zur Dokumentation dieser Datei
1
10#ifndef WGRHAL_EXT_H
11#define WGRHAL_EXT_H
12
13#include "wgrtypes.h"
14
15#ifndef HWREG32
16#define HWREG32(addr) (*((volatile uint32_t *)(addr)))
17#endif
18
22#define MULT_BASE_ADDR 0x00000500
26#define MULT_INFO_OFFSET 0x0000
30#define MUL1_OFFSET 0x0004
34#define MUL2_OFFSET 0x0008
38#define RESH_OFFSET 0x000C
42#define RESL_OFFSET 0x0010
43
47#define DIV_BASE_ADDR 0x00000600
51#define DIV_INFO_OFFSET 0x00
55#define DIV_END_OFFSET 0x04
59#define DIV_SOR_OFFSET 0x08
63#define DIV_QUO_OFFSET 0x0C
67#define DIV_REM_OFFSET 0x10
68
72#define SPI_BASE_ADDR 0x00000700
76#define SPI_CTRL_OFFSET 0x0000
80#define SPI_CLK_OFFSET 0x0004
84#define SPI_STATUS_OFFSET 0x0008
88#define SPI_TX_OFFSET 0x000C
92#define SPI_RX_OFFSET 0x0010
96#define SPI_CS_OFFSET 0x0014
97
101#define WS_BASE_ADDR 0x00000900
102
105typedef struct
106{
107 uint8_t r;
108 uint8_t g;
109 uint8_t b;
111
114typedef struct
115{
116 uint32_t dividend;
117 uint32_t divisor;
118 uint32_t quotient;
119 uint32_t remainder;
121
122/* Hardware Multiplication and Division */
130uint64_t mult_calc_64(uint32_t multiplicand, uint32_t multiplier);
131
139uint32_t mult_calc(uint32_t multiplicand, uint32_t multiplier);
140
149int32_t div_calc(uint32_t dividend, uint32_t divisor, div_result_t *result);
150
158uint32_t div_calc_quotient(uint32_t dividend, uint32_t divisor);
159
167uint32_t div_calc_remainder(uint32_t dividend, uint32_t divisor);
168
169/* SPI Functions */
173void spi_enable(void);
174
178void spi_disable(void);
179
185void spi_automatic_cs(bool active);
186
192void spi_cs(uint32_t active);
193
199void spi_set_clock_offet(uint32_t offset);
200
206void spi_set_clock_divider(uint32_t divider);
207
213uint32_t spi_get_status(void);
214
220uint32_t spi_fifo_full(void);
221
227uint32_t spi_is_ready(void);
228
234uint32_t spi_is_busy(void);
235
241uint32_t spi_rx_full(void);
242
248uint32_t spi_rx_empty(void);
249
255uint32_t spi_tx_full(void);
256
262uint32_t spi_tx_empty(void);
263
270int32_t spi_wait_rx_data(uint32_t timeout_ms);
271
279int32_t spi_write_byte(uint8_t data, uint32_t timeout_ms);
280
288int32_t spi_read_byte(uint8_t *data, uint32_t timeout_ms);
289
298int32_t spi_write_buffer(const uint8_t *buf, uint32_t length, uint32_t timeout_ms);
299
307int32_t spi_write_uint32(uint32_t value, uint32_t timeout_ms);
308
317int32_t spi_read_buffer(uint8_t *buf, uint32_t length, uint32_t timeout_ms);
318
319/* WS2812B Functions */
327int32_t ws2812_set_color(uint8_t led, rgb_color_t color);
328
335rgb_color_t ws2812_get_color(uint8_t led);
336
343int32_t ws2812_write_all(const rgb_color_t colors[8]);
344
351int32_t ws2812_fill(rgb_color_t color);
352
356void ws2812_clear(void);
357
358#ifdef PWM_NOTES
359/* Play Frequencies with the PWM Module */
363typedef enum
364{
365 NOTE_C = 0,
367 NOTE_D = 2,
369 NOTE_E = 4,
370 NOTE_F = 5,
372 NOTE_G = 7,
374 NOTE_A = 9,
375 NOTE_As = 10,
376 NOTE_B = 11
378
382extern const uint8_t note_freq_halfbase[12];
383
389int pwm_precompute_notes(void);
390
397void pwm_play_note(note_t note, uint32_t octave);
398
402void pwm_free_note_buffer(void);
403
404#endif
405
406#ifdef MALLOC
407/* malloc */
411extern char _heap_start;
412extern char _heap_end;
413extern char _sstack;
414extern char _estack;
415
422void *malloc(uint32_t size);
423
429void free(void *ptr);
430
438void *realloc(void *ptr, uint32_t size);
439
447void *calloc(uint32_t nmemb, uint32_t size);
448
454uint32_t heap_free_space(void);
455
456#endif
457
458#ifdef SSD1351
459/* SSD1351 Display with Scroll Function */
463static const uint8_t font5x7[96][5] = {
464 {0x00, 0x00, 0x00, 0x00, 0x00}, // ' ' (32)
465 {0x00, 0x00, 0x5F, 0x00, 0x00}, // '!' (33)
466 {0x00, 0x07, 0x00, 0x07, 0x00}, // '"' (34)
467 {0x14, 0x7F, 0x14, 0x7F, 0x14}, // '#' (35)
468 {0x24, 0x2A, 0x7F, 0x2A, 0x12}, // '$' (36)
469 {0x23, 0x13, 0x08, 0x64, 0x62}, // '%' (37)
470 {0x36, 0x49, 0x55, 0x22, 0x50}, // '&' (38)
471 {0x00, 0x05, 0x03, 0x00, 0x00}, // ''' (39)
472 {0x00, 0x1C, 0x22, 0x41, 0x00}, // '(' (40)
473 {0x00, 0x41, 0x22, 0x1C, 0x00}, // ')' (41)
474 {0x14, 0x08, 0x3E, 0x08, 0x14}, // '*' (42)
475 {0x08, 0x08, 0x3E, 0x08, 0x08}, // '+' (43)
476 {0x00, 0x50, 0x30, 0x00, 0x00}, // ',' (44)
477 {0x08, 0x08, 0x08, 0x08, 0x08}, // '-' (45)
478 {0x00, 0x60, 0x60, 0x00, 0x00}, // '.' (46)
479 {0x20, 0x10, 0x08, 0x04, 0x02}, // '/' (47)
480 {0x3E, 0x51, 0x49, 0x45, 0x3E}, // '0' (48)
481 {0x00, 0x42, 0x7F, 0x40, 0x00}, // '1' (49)
482 {0x42, 0x61, 0x51, 0x49, 0x46}, // '2' (50)
483 {0x21, 0x41, 0x45, 0x4B, 0x31}, // '3' (51)
484 {0x18, 0x14, 0x12, 0x7F, 0x10}, // '4' (52)
485 {0x27, 0x45, 0x45, 0x45, 0x39}, // '5' (53)
486 {0x3C, 0x4A, 0x49, 0x49, 0x30}, // '6' (54)
487 {0x01, 0x71, 0x09, 0x05, 0x03}, // '7' (55)
488 {0x36, 0x49, 0x49, 0x49, 0x36}, // '8' (56)
489 {0x06, 0x49, 0x49, 0x29, 0x1E}, // '9' (57)
490 {0x00, 0x36, 0x36, 0x00, 0x00}, // ':' (58)
491 {0x00, 0x56, 0x36, 0x00, 0x00}, // ';' (59)
492 {0x08, 0x14, 0x22, 0x41, 0x00}, // '<' (60)
493 {0x14, 0x14, 0x14, 0x14, 0x14}, // '=' (61)
494 {0x00, 0x41, 0x22, 0x14, 0x08}, // '>' (62)
495 {0x02, 0x01, 0x51, 0x09, 0x06}, // '?' (63)
496 {0x32, 0x49, 0x79, 0x41, 0x3E}, // '@' (64)
497 {0x7E, 0x11, 0x11, 0x11, 0x7E}, // 'A' (65)
498 {0x7F, 0x49, 0x49, 0x49, 0x36}, // 'B' (66)
499 {0x3E, 0x41, 0x41, 0x41, 0x22}, // 'C' (67)
500 {0x7F, 0x41, 0x41, 0x22, 0x1C}, // 'D' (68)
501 {0x7F, 0x49, 0x49, 0x49, 0x41}, // 'E' (69)
502 {0x7F, 0x09, 0x09, 0x09, 0x01}, // 'F' (70)
503 {0x3E, 0x41, 0x49, 0x49, 0x7A}, // 'G' (71)
504 {0x7F, 0x08, 0x08, 0x08, 0x7F}, // 'H' (72)
505 {0x00, 0x41, 0x7F, 0x41, 0x00}, // 'I' (73)
506 {0x20, 0x40, 0x41, 0x3F, 0x01}, // 'J' (74)
507 {0x7F, 0x10, 0x28, 0x44, 0x00}, // 'K' (75)
508 {0x7F, 0x40, 0x40, 0x40, 0x40}, // 'L' (76)
509 {0x7F, 0x02, 0x0C, 0x02, 0x7F}, // 'M' (77)
510 {0x7F, 0x04, 0x08, 0x10, 0x7F}, // 'N' (78)
511 {0x3E, 0x41, 0x41, 0x41, 0x3E}, // 'O' (79)
512 {0x7F, 0x09, 0x09, 0x09, 0x06}, // 'P' (80)
513 {0x3E, 0x41, 0x51, 0x21, 0x5E}, // 'Q' (81)
514 {0x7F, 0x09, 0x19, 0x29, 0x46}, // 'R' (82)
515 {0x46, 0x49, 0x49, 0x49, 0x31}, // 'S' (83)
516 {0x01, 0x01, 0x7F, 0x01, 0x01}, // 'T' (84)
517 {0x3F, 0x40, 0x40, 0x40, 0x3F}, // 'U' (85)
518 {0x1F, 0x20, 0x40, 0x20, 0x1F}, // 'V' (86)
519 {0x3F, 0x40, 0x38, 0x40, 0x3F}, // 'W' (87)
520 {0x63, 0x14, 0x08, 0x14, 0x63}, // 'X' (88)
521 {0x07, 0x08, 0x70, 0x08, 0x07}, // 'Y' (89)
522 {0x61, 0x51, 0x49, 0x45, 0x43}, // 'Z' (90)
523 {0x00, 0x7F, 0x41, 0x41, 0x00}, // '[' (91)
524 {0x02, 0x04, 0x08, 0x10, 0x20}, // '\' (92)
525 {0x00, 0x41, 0x41, 0x7F, 0x00}, // ']' (93)
526 {0x04, 0x02, 0x01, 0x02, 0x04}, // '^' (94)
527 {0x40, 0x40, 0x40, 0x40, 0x40}, // '_' (95)
528 {0x00, 0x01, 0x02, 0x04, 0x00}, // '`' (96)
529 {0x20, 0x54, 0x54, 0x54, 0x78}, // 'a' (97)
530 {0x7F, 0x48, 0x44, 0x44, 0x38}, // 'b' (98)
531 {0x38, 0x44, 0x44, 0x44, 0x20}, // 'c' (99)
532 {0x38, 0x44, 0x44, 0x48, 0x7F}, // 'd' (100)
533 {0x38, 0x54, 0x54, 0x54, 0x18}, // 'e' (101)
534 {0x08, 0x7E, 0x09, 0x01, 0x02}, // 'f' (102)
535 {0x0C, 0x52, 0x52, 0x52, 0x3E}, // 'g' (103)
536 {0x7F, 0x08, 0x04, 0x04, 0x78}, // 'h' (104)
537 {0x00, 0x44, 0x7D, 0x40, 0x00}, // 'i' (105)
538 {0x20, 0x40, 0x44, 0x3D, 0x00}, // 'j' (106)
539 {0x7F, 0x10, 0x28, 0x44, 0x00}, // 'k' (107)
540 {0x00, 0x41, 0x7F, 0x40, 0x00}, // 'l' (108)
541 {0x7C, 0x04, 0x18, 0x04, 0x78}, // 'm' (109)
542 {0x7C, 0x08, 0x04, 0x04, 0x78}, // 'n' (110)
543 {0x38, 0x44, 0x44, 0x44, 0x38}, // 'o' (111)
544 {0x7C, 0x14, 0x14, 0x14, 0x08}, // 'p' (112)
545 {0x08, 0x14, 0x14, 0x18, 0x7C}, // 'q' (113)
546 {0x7C, 0x08, 0x04, 0x04, 0x08}, // 'r' (114)
547 {0x48, 0x54, 0x54, 0x54, 0x20}, // 's' (115)
548 {0x04, 0x3F, 0x44, 0x40, 0x20}, // 't' (116)
549 {0x3C, 0x40, 0x40, 0x20, 0x7C}, // 'u' (117)
550 {0x1C, 0x20, 0x40, 0x20, 0x1C}, // 'v' (118)
551 {0x3C, 0x40, 0x30, 0x40, 0x3C}, // 'w' (119)
552 {0x44, 0x28, 0x10, 0x28, 0x44}, // 'x' (120)
553 {0x0C, 0x50, 0x50, 0x50, 0x3C}, // 'y' (121)
554 {0x44, 0x64, 0x54, 0x4C, 0x44}, // 'z' (122)
555 {0x00, 0x08, 0x36, 0x41, 0x00}, // '{' (123)
556 {0x00, 0x00, 0x7F, 0x00, 0x00}, // '|' (124)
557 {0x00, 0x41, 0x36, 0x08, 0x00}, // '}' (125)
558 {0x08, 0x04, 0x08, 0x10, 0x08}, // '~' (126)
559 {0x00, 0x06, 0x09, 0x09, 0x06} // DEL (127)
560};
561
565#define SSD1351_WIDTH 128
569#define SSD1351_HEIGHT 128
573#define CHAR_WIDTH 6
577#define CHAR_HEIGHT 8
581#define STATUS_BAR_ROWS 1
585#define TOTAL_ROWS (SSD1351_HEIGHT / CHAR_HEIGHT)
589#define TERM_COLS (SSD1351_WIDTH / CHAR_WIDTH)
593#define TERM_ROWS (TOTAL_ROWS)
597#define SSD1351_SPI_TIMEOUT 10
601#define HOUSEKEEPING_MS 250
602
606#define COLOR_BLACK 0x0000
610#define COLOR_WHITE 0xFFFF
614#define COLOR_RED 0x07E0
618#define COLOR_GREEN 0xF800
622#define COLOR_BLUE 0x001F
626#define COLOR_YELLOW 0xFFE0
630#define COLOR_MAGENTA 0xF81F
634#define COLOR_CYAN 0x07FF
635
639void housekeeping(void);
640
644void ssd1351_inv(void);
645
652void ssd1351_send_data(const uint8_t *data, size_t len);
653
659void ssd1351_send_command(uint8_t cmd);
660
668void ssd1351_send_command_with_data(uint8_t cmd, const uint8_t *data, size_t len);
669
676void ssd1351_send_commands(const uint8_t *buf, size_t len);
677
681void ssd1351_init(void);
682
691void ssd1351_set_position(uint8_t x, uint8_t y, uint8_t w, uint8_t h);
692
698void ssd1351_fill_screen(uint16_t color);
699
707void ssd1351_draw_pixel(uint8_t x, uint8_t y, uint16_t color);
708
712void terminal_init(void);
713
719void terminal_print(const char *str);
720
727void terminal_print_col(const char *text, uint16_t color);
728
735void print_ok_res(const char *label, int32_t value);
736
742void print_ok(const char *label);
743
749void print_error(const char *label);
750
756void terminal_put_char(char c);
757
763void terminal_set_text_color(uint16_t color);
764
770void terminal_set_bg_color(uint16_t color);
771
781void terminal_draw_text(uint8_t row, uint8_t col, const char *str, uint16_t fg_color, uint16_t bg_color);
782
790void terminal_draw_text_default(uint8_t row, uint8_t col, const char *str);
791
795void terminal_native_scroll(void);
796
802void clear_terminal_row(uint8_t row);
803
807void clear_terminal(void);
808
816void draw_status_bar(const char *text, uint16_t bg_color, uint16_t fg_color);
817
825void draw_char_cell(uint8_t row, uint8_t col, char c);
826
836void draw_char_cell_custom(uint8_t row, uint8_t col, char c, uint16_t fg, uint16_t bg);
837
843uint32_t ssd1351_cursor_x(void);
844
845#endif
846
847#endif /* WGRHAL_EXT_H */
Struktur zur Rückgabe eines Divisionsergebnisses.
Definition wgrhal_ext.h:115
uint32_t remainder
Definition wgrhal_ext.h:119
uint32_t divisor
Definition wgrhal_ext.h:117
uint32_t quotient
Definition wgrhal_ext.h:118
uint32_t dividend
Definition wgrhal_ext.h:116
Struktur zur Darstellung einer RGB-Farbe.
Definition wgrhal_ext.h:106
uint8_t g
Definition wgrhal_ext.h:108
uint8_t b
Definition wgrhal_ext.h:109
uint8_t r
Definition wgrhal_ext.h:107
uint32_t spi_is_ready(void)
Prüft, ob die SPI-Schnittstelle bereit ist.
Definition wgrhal_ext.c:173
uint32_t div_calc_quotient(uint32_t dividend, uint32_t divisor)
Berechnet den Quotienten einer Division.
Definition wgrhal_ext.c:71
void spi_set_clock_offet(uint32_t offset)
Setzt den Takt-Offset der SPI-Schnittstelle.
uint32_t spi_rx_empty(void)
Prüft, ob der SPI-Empfangspuffer leer ist.
Definition wgrhal_ext.c:188
void ws2812_clear(void)
Schaltet alle WS2812B LEDs aus.
Definition wgrhal_ext.c:362
void terminal_set_bg_color(uint16_t color)
Setzt die Hintergrundfarbe des Terminals.
void terminal_native_scroll(void)
Scrollt das Terminal um eine Zeile.
Definition wgrhal_ext.c:907
void clear_terminal_row(uint8_t row)
Löscht eine bestimmte Terminalzeile.
Definition wgrhal_ext.c:870
void ssd1351_send_data(const uint8_t *data, size_t len)
Sendet einen Datenpuffer an das SSD1351 Display.
Definition wgrhal_ext.c:755
uint32_t spi_rx_full(void)
Prüft, ob der SPI-Empfangspuffer voll ist.
Definition wgrhal_ext.c:183
int32_t spi_write_byte(uint8_t data, uint32_t timeout_ms)
Sendet ein Byte über die SPI-Schnittstelle.
Definition wgrhal_ext.c:218
void ssd1351_inv(void)
Schaltet den Invertierungsmodus des Displays um.
Definition wgrhal_ext.c:741
void housekeeping(void)
Führt periodische Wartungsarbeiten am SSD1351 Display durch (z.B. Cursor-Blinken).
int32_t spi_read_byte(uint8_t *data, uint32_t timeout_ms)
Liest ein Byte von der SPI-Schnittstelle.
Definition wgrhal_ext.c:235
const uint8_t note_freq_halfbase[12]
Frequenztabelle für Noten (Halbton-Basis).
Definition wgrhal_ext.c:387
void print_error(const char *label)
Gibt ein Label als Fehlernachricht aus.
Definition wgrhal_ext.c:997
int32_t ws2812_write_all(const rgb_color_t colors[8])
Schreibt die Farben aller 8 WS2812B LEDs.
Definition wgrhal_ext.c:332
void ssd1351_init(void)
Initialisiert das SSD1351 Display.
Definition wgrhal_ext.c:796
int32_t ws2812_fill(rgb_color_t color)
Füllt alle WS2812B LEDs mit einer einheitlichen Farbe.
Definition wgrhal_ext.c:349
int32_t spi_write_buffer(const uint8_t *buf, uint32_t length, uint32_t timeout_ms)
Sendet einen Datenpuffer über SPI.
Definition wgrhal_ext.c:257
void * realloc(void *ptr, uint32_t size)
Ändert die Größe eines allokierten Speicherblocks.
Definition wgrhal_ext.c:635
void terminal_init(void)
Initialisiert das Terminal (Display) des SSD1351.
void clear_terminal(void)
Löscht das gesamte Terminal.
Definition wgrhal_ext.c:878
note_t
Aufzählung der Noten im Halbtonsystem.
Definition wgrhal_ext.h:364
@ NOTE_A
Definition wgrhal_ext.h:374
@ NOTE_Gs
Definition wgrhal_ext.h:373
@ NOTE_As
Definition wgrhal_ext.h:375
@ NOTE_G
Definition wgrhal_ext.h:372
@ NOTE_Ds
Definition wgrhal_ext.h:368
@ NOTE_C
Definition wgrhal_ext.h:365
@ NOTE_D
Definition wgrhal_ext.h:367
@ NOTE_Cs
Definition wgrhal_ext.h:366
@ NOTE_F
Definition wgrhal_ext.h:370
@ NOTE_B
Definition wgrhal_ext.h:376
@ NOTE_Fs
Definition wgrhal_ext.h:371
@ NOTE_E
Definition wgrhal_ext.h:369
int32_t spi_write_uint32(uint32_t value, uint32_t timeout_ms)
Sendet einen 32-Bit-Wert über SPI.
Definition wgrhal_ext.c:274
int32_t ws2812_set_color(uint8_t led, rgb_color_t color)
Setzt die Farbe einer WS2812B LED.
Definition wgrhal_ext.c:307
int32_t spi_wait_rx_data(uint32_t timeout_ms)
Wartet darauf, dass Daten im SPI-Empfangspuffer verfügbar sind.
Definition wgrhal_ext.c:203
void print_ok(const char *label)
Gibt ein Label als OK-Nachricht aus.
Definition wgrhal_ext.c:992
void ssd1351_set_position(uint8_t x, uint8_t y, uint8_t w, uint8_t h)
Setzt die Schreibposition und den Bereich im SSD1351 Display.
Definition wgrhal_ext.c:819
void ssd1351_send_commands(const uint8_t *buf, size_t len)
Sendet eine Folge von Befehlen an das SSD1351 Display.
Definition wgrhal_ext.c:784
void * malloc(uint32_t size)
Allokiert einen Speicherblock.
Definition wgrhal_ext.c:563
void ssd1351_fill_screen(uint16_t color)
Füllt das gesamte Display mit einer Farbe.
void spi_enable(void)
Aktiviert die SPI-Schnittstelle.
Definition wgrhal_ext.c:109
void draw_status_bar(const char *text, uint16_t bg_color, uint16_t fg_color)
Zeichnet eine Statusleiste am oberen Displayrand.
Definition wgrhal_ext.c:888
uint32_t div_calc_remainder(uint32_t dividend, uint32_t divisor)
Berechnet den Rest einer Division.
Definition wgrhal_ext.c:87
void pwm_free_note_buffer(void)
Gibt den für PWM-Noten reservierten Speicher frei.
Definition wgrhal_ext.c:463
void pwm_play_note(note_t note, uint32_t octave)
Spielt eine bestimmte Note in einer festgelegten Oktave über den PWM aus.
Definition wgrhal_ext.c:424
int32_t div_calc(uint32_t dividend, uint32_t divisor, div_result_t *result)
Führt eine Division durch und liefert Quotient und Rest.
Definition wgrhal_ext.c:52
void terminal_print_col(const char *text, uint16_t color)
Gibt einen String im Terminal mit einer bestimmten Textfarbe aus.
Definition wgrhal_ext.c:976
uint32_t mult_calc(uint32_t multiplicand, uint32_t multiplier)
Berechnet das 32-Bit-Ergebnis einer Multiplikation.
Definition wgrhal_ext.c:41
uint32_t heap_free_space(void)
Ermittelt den aktuell freien Heap-Speicher.
Definition wgrhal_ext.c:533
void spi_automatic_cs(bool active)
Aktiviert oder deaktiviert den automatischen Chipselect (CS) der SPI-Schnittstelle.
Definition wgrhal_ext.c:123
int pwm_precompute_notes(void)
Berechnet Notenparameter für den PWM-Modus.
Definition wgrhal_ext.c:401
void ssd1351_draw_pixel(uint8_t x, uint8_t y, uint16_t color)
Zeichnet einen einzelnen Pixel an einer bestimmten Position.
void print_ok_res(const char *label, int32_t value)
Gibt ein Label und einen numerischen Wert (als String) aus, farblich als OK markiert.
Definition wgrhal_ext.c:984
void terminal_print(const char *str)
Gibt einen String im Terminal aus.
Definition wgrhal_ext.c:968
void terminal_put_char(char c)
Gibt ein einzelnes Zeichen im Terminal aus und aktualisiert den Cursor.
Definition wgrhal_ext.c:934
void spi_disable(void)
Deaktiviert die SPI-Schnittstelle.
Definition wgrhal_ext.c:116
rgb_color_t ws2812_get_color(uint8_t led)
Liest die aktuell gesetzte Farbe einer WS2812B LED.
Definition wgrhal_ext.c:318
void terminal_set_text_color(uint16_t color)
Setzt die Textfarbe des Terminals.
char _heap_start
Start- und Endadressen des Heaps und Stacks (extern deklariert).
int32_t spi_read_buffer(uint8_t *buf, uint32_t length, uint32_t timeout_ms)
Liest einen Datenpuffer von der SPI-Schnittstelle.
Definition wgrhal_ext.c:284
void spi_set_clock_divider(uint32_t divider)
Konfiguriert den Taktteiler der SPI-Schnittstelle.
Definition wgrhal_ext.c:147
void ssd1351_send_command(uint8_t cmd)
Sendet einen einzelnen Befehl an das SSD1351 Display.
Definition wgrhal_ext.c:763
void terminal_draw_text_default(uint8_t row, uint8_t col, const char *str)
Zeichnet einen Text an einer bestimmten Terminalposition mit Standardfarben.
uint32_t spi_tx_full(void)
Prüft, ob der SPI-Sende-Puffer voll ist.
Definition wgrhal_ext.c:193
uint32_t spi_tx_empty(void)
Prüft, ob der SPI-Sende-Puffer leer ist.
Definition wgrhal_ext.c:198
uint32_t ssd1351_cursor_x(void)
Gibt die aktuelle X-Position des Cursors im SSD1351 Terminal zurück.
uint32_t spi_is_busy(void)
Prüft, ob die SPI-Schnittstelle beschäftigt ist.
Definition wgrhal_ext.c:178
void terminal_draw_text(uint8_t row, uint8_t col, const char *str, uint16_t fg_color, uint16_t bg_color)
Zeichnet einen Text an einer bestimmten Terminalposition mit definierten Vorder- und Hintergrundfarbe...
uint32_t spi_get_status(void)
Liest den aktuellen Status der SPI-Schnittstelle.
Definition wgrhal_ext.c:163
void ssd1351_send_command_with_data(uint8_t cmd, const uint8_t *data, size_t len)
Sendet einen Befehl mit zugehörigen Daten an das SSD1351 Display.
Definition wgrhal_ext.c:771
void * calloc(uint32_t nmemb, uint32_t size)
Allokiert einen Speicherblock für ein Array und initialisiert diesen mit 0.
Definition wgrhal_ext.c:662
void spi_cs(uint32_t active)
Setzt den SPI-Chipselect-Zustand.
Definition wgrhal_ext.c:137
void draw_char_cell(uint8_t row, uint8_t col, char c)
Zeichnet ein einzelnes Zeichen in einer Terminalzelle.
Definition wgrhal_ext.c:865
void draw_char_cell_custom(uint8_t row, uint8_t col, char c, uint16_t fg, uint16_t bg)
Zeichnet ein einzelnes Zeichen in einer Terminalzelle mit individuellen Farben.
Definition wgrhal_ext.c:833
uint64_t mult_calc_64(uint32_t multiplicand, uint32_t multiplier)
Berechnet das 64-Bit-Ergebnis einer Multiplikation.
Definition wgrhal_ext.c:27
uint32_t spi_fifo_full(void)
Prüft, ob das SPI-FIFO voll ist.
Definition wgrhal_ext.c:168
void free(void *ptr)
Gibt einen zuvor allokierten Speicherblock frei.
Definition wgrhal_ext.c:598