Skip to content

Commit

Permalink
implement SLCD blink and animation
Browse files Browse the repository at this point in the history
  • Loading branch information
joeycastillo committed Jul 10, 2024
1 parent b6da50b commit 481a46f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions peripherals/slcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ void slcd_set_frame_counter_enabled(uint8_t fc, bool enabled) {
}

void slcd_configure_blink(bool blink_all, uint8_t bss0, uint8_t bss1, uint8_t fc) {
/// TODO: Implement blinking
SLCD->BCFG.bit.FCS = fc;
if (blink_all) {
SLCD->BCFG.bit.MODE = 0;
} else {
SLCD->BCFG.bit.MODE = 1;
SLCD->BCFG.bit.BSS0 = bss0;
SLCD->BCFG.bit.BSS1 = bss1;
}
}

void slcd_set_blink_enabled(bool enabled) {
Expand All @@ -142,7 +149,10 @@ void slcd_set_blink_enabled(bool enabled) {
}

void slcd_configure_circular_shift_animation(uint16_t initial_value, uint8_t size, slcd_csrshift_value_t shift_dir, uint8_t fc) {
/// TODO: Implement circular shift animation
SLCD->CSRCFG.bit.FCS = fc;
SLCD->CSRCFG.bit.SIZE = size;
SLCD->CSRCFG.bit.DIR = shift_dir;
SLCD->CSRCFG.bit.DATA = initial_value;
}

void slcd_set_circular_shift_animation_enabled(bool enabled) {
Expand Down

0 comments on commit 481a46f

Please sign in to comment.