You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
809 B
49 lines
809 B
2 years ago
|
/**
|
||
|
* Dispay
|
||
|
*/
|
||
|
|
||
|
#include "user_interface.h"
|
||
|
#include "twi.h"
|
||
|
#include "ssd1306.h"
|
||
|
#include "sevenseg.h"
|
||
|
#include "global_state.h"
|
||
|
|
||
|
static struct SevenSeg sseg = {
|
||
|
.x0 = 0,
|
||
|
.y0 = 0,
|
||
|
.charwidth = 17,
|
||
|
.thick = 3,
|
||
|
//.charwidth = 16,
|
||
|
//.thick = 1,
|
||
|
.spacing = 4,
|
||
|
};
|
||
|
|
||
|
void init_user_interface()
|
||
|
{
|
||
|
TWI_Init();
|
||
|
ssd1306_128x32_i2c_init();
|
||
|
ssd1306_clearScreen();
|
||
|
|
||
|
// can't show anything useful at least until the first tick arrives, but more than 1 tick is needed
|
||
|
show_loading_icon();
|
||
|
}
|
||
|
|
||
|
|
||
|
void show_current_radiation()
|
||
|
{
|
||
|
// TODO
|
||
|
sseg_number(&sseg, timestamp_100ms, 5, 0);
|
||
|
}
|
||
|
|
||
|
void show_empty_battery_icon()
|
||
|
{
|
||
|
// TODO
|
||
|
sseg_number(&sseg, 9999, 5, 0);
|
||
|
}
|
||
|
|
||
|
void show_loading_icon()
|
||
|
{
|
||
|
// TODO
|
||
|
sseg_number(&sseg, 0, 5, 0);
|
||
|
}
|