File syn_seg7.h¶
FileList > display > syn_seg7.h
Go to the source code of this file
7-Segment LED Display & Multi-Digit Array Driver.
#include "../common/syn_defs.h"#include "../port/syn_port_gpio.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_Seg7 7-Segment Display Instance Context. |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_Seg7Type 7-segment display wiring polarity. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_seg7_clear (SYN_Seg7 * seg) Clear display (turn off all segments). |
| SYN_Status | syn_seg7_init (SYN_Seg7 * seg, const SYN_GPIO_Pin segments, const SYN_GPIO_Pin * digits, uint8_t num_digits, SYN_Seg7Type type) Initialize a 7-Segment Display instance. |
| void | syn_seg7_print_float (SYN_Seg7 * seg, float val, uint8_t decimals) Display a floating-point number with specified decimal precision. |
| void | syn_seg7_print_hex (SYN_Seg7 * seg, uint32_t val) Display an integer in hexadecimal format. |
| void | syn_seg7_print_int (SYN_Seg7 * seg, int32_t val) Display an integer number. |
| void | syn_seg7_print_str (SYN_Seg7 * seg, const char * str) Display a text string (best-effort 7-segment ASCII mapping). |
| void | syn_seg7_scan (SYN_Seg7 * seg) Non-blocking multiplex scan tick. Call periodically in main/scheduler loop. |
| void | syn_seg7_set_digit_raw (SYN_Seg7 * seg, uint8_t digit_idx, uint8_t seg_mask) Set raw segment bitmask for a specific digit. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_SEG7_MAX_DIGITS 8 |
Public Types Documentation¶
enum SYN_Seg7Type¶
7-segment display wiring polarity.
Public Functions Documentation¶
function syn_seg7_clear¶
Clear display (turn off all segments).
Parameters:
seg7-segment context.
function syn_seg7_init¶
Initialize a 7-Segment Display instance.
SYN_Status syn_seg7_init (
SYN_Seg7 * seg,
const SYN_GPIO_Pin segments,
const SYN_GPIO_Pin * digits,
uint8_t num_digits,
SYN_Seg7Type type
)
Parameters:
seg7-segment context.segmentsArray of 8 segment GPIO pins (A, B, C, D, E, F, G, DP).digitsArray of digit selector GPIO pins (up to 8).num_digitsNumber of digits in the array (1 to 8).typeWiring type (Common Cathode / Common Anode).
Returns:
SYN_OK on success.
function syn_seg7_print_float¶
Display a floating-point number with specified decimal precision.
Parameters:
seg7-segment context.valFloat value to display.decimalsNumber of fractional digits after decimal point.
function syn_seg7_print_hex¶
Display an integer in hexadecimal format.
Parameters:
seg7-segment context.valUnsigned integer to display in hex.
function syn_seg7_print_int¶
Display an integer number.
Parameters:
seg7-segment context.valSigned integer value to display.
function syn_seg7_print_str¶
Display a text string (best-effort 7-segment ASCII mapping).
Parameters:
seg7-segment context.strASCII string.
function syn_seg7_scan¶
Non-blocking multiplex scan tick. Call periodically in main/scheduler loop.
Parameters:
seg7-segment context.
function syn_seg7_set_digit_raw¶
Set raw segment bitmask for a specific digit.
Parameters:
seg7-segment context.digit_idxDigit index (0 to num_digits-1).seg_maskRaw segment bitmask (Bit 0=A, Bit 1=B, ..., Bit 7=DP).
Macro Definition Documentation¶
define SYN_SEG7_MAX_DIGITS¶
The documentation for this class was generated from the following file src/syntropic/display/syn_seg7.h