1
0
mirror of https://github.com/CovidBraceletPrj/CovidBracelet.git synced 2025-01-09 04:44:22 +01:00
CovidBracelet/src/display.h

73 lines
1.8 KiB
C
Raw Normal View History

2021-05-28 14:36:46 +02:00
#ifndef DISPLAY_H
#define DISPLAY_H
2021-12-07 16:16:25 +01:00
/**
* @brief Initializes all display elements and adds them to the canvas.
*
* @return int
*/
2021-05-28 14:36:46 +02:00
int init_display();
2021-12-07 16:16:25 +01:00
/**
* @brief Updates all information on the display using the get functions, defined by `display.c`. Alternatively the
* values of the displayed elements can be set explicitly via set `display_set_<property>`-functions.
*
* @return int
*/
2021-05-28 14:36:46 +02:00
int update_display();
2021-12-07 16:16:25 +01:00
/**
* @brief This is the entry point for the display thread. It peridocially updates the display and handles input events.
*
*/
2021-06-14 15:44:07 +02:00
void display_thread(void*, void*, void*);
2021-12-07 16:16:25 +01:00
/**
* @brief Displays a message at the bottom of the display. The message will persist until it is removed expicitly, by calling `display_set_message("")`.
*
* @param msg A pointer to the string that should be displayed
* @return int
*/
int display_set_message(char* msg);
2021-12-07 16:16:25 +01:00
/**
* @brief Sets the on display clock. The time should have the format `h * 100 + m`. So `display_set_time(1145)` sets the clock to 11:45.
*
* @param time A number representation of the time
* @return int
*/
2021-06-02 17:22:38 +02:00
int display_set_time(int time);
2021-12-07 16:16:25 +01:00
/**
* @brief Set the battery level percentage.
*
* @param bat The battery level in percent
* @return int
*/
int display_set_bat(int bat);
2021-12-07 16:16:25 +01:00
/**
* @brief Set the non-volatile memory state.
*
* @param mem The occupied memory in percent
* @return int
*/
int display_set_mem(int mem);
2021-12-07 16:16:25 +01:00
/**
* @brief Set the number of total registered contacts in the last 14 days.
*
* @param contacts The number of contacts
* @return int
*/
int display_set_contacts(int contacts);
2021-12-07 16:16:25 +01:00
/**
* @brief Set the number of contacts that were tested positively on Covid and registered in the last 14 days.
*
* @param risk_contacts The number of risk contacts
* @return int
*/
int display_set_risk_contacts(int risk_contacts);
2021-05-28 14:36:46 +02:00
#endif