mirror of
https://github.com/korneliuszo/lumiax-controller.git
synced 2026-06-14 11:25:12 +02:00
48 lines
620 B
C++
48 lines
620 B
C++
/*
|
|
* display.hpp
|
|
*
|
|
* Created on: Aug 21, 2022
|
|
* Author: kosa
|
|
*/
|
|
|
|
#ifndef DISPLAY_HPP_
|
|
#define DISPLAY_HPP_
|
|
|
|
#include <zephyr/zephyr.h>
|
|
|
|
class Display {
|
|
const struct device *dev;
|
|
k_mutex mut;
|
|
public:
|
|
uint8_t buff[128*296/8];
|
|
class Display_lock
|
|
{
|
|
k_mutex *m;
|
|
public:
|
|
Display_lock(k_mutex *_m)
|
|
: m(_m)
|
|
{
|
|
k_mutex_lock(m, K_FOREVER);
|
|
}
|
|
~Display_lock()
|
|
{
|
|
k_mutex_unlock(m);
|
|
}
|
|
};
|
|
int Init();
|
|
Display_lock lock()
|
|
{
|
|
return Display_lock(&mut);
|
|
}
|
|
void update();
|
|
void print_chr(int x, int y, char c);
|
|
void print_str(int x, int y, const char* str);
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* DISPLAY_HPP_ */
|