aboutsummaryrefslogtreecommitdiff
path: root/src/display.h
blob: f01ee739f2fcdb4064126d3d1cec51285e3c3b37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef _LOADED_DISPLAY
#define _LOADED_DISPLAY
#include <stdint.h>

#include "rtc.h"

// "_gfedcba"
// Reversed because a-g is mapped to pa0-6. (pa7 is decimal)
// Complemented because display is common anode
static const uint32_t digit_masks[] = {
    0b1000000, 0b1111001, 0b0100100, 0b0110000, 0b0011001,
    0b0010010, 0b0000010, 0b1111000, 0b0000000, 0b0010000,
};

// Current digit position
volatile extern uint8_t current_digit;

void display_setup(void);

void write_time(uint8_t digit_index);

void display_render(void);

#endif