16#ifndef BRICK_SOMEPATH_SOMEFILE_H
17#define BRICK_SOMEPATH_SOMEFILE_H
34static inline void ui_px(
int x,
int y,
bool on) {
38 const uint8_t mask = (uint8_t)(1u << (y & 7));
39 if (on) buf[index] |= mask;
40 else buf[index] &= (uint8_t)~mask;
51static inline void ui_hline(
int x,
int y,
int w,
bool on) {
52 for (
int i = 0; i < w; ++i)
64static inline void ui_vline(
int x,
int y,
int h,
bool on) {
65 for (
int i = 0; i < h; ++i)
82static inline void ui_rect(
int x,
int y,
int w,
int h,
bool on) {
83 if (w <= 0 || h <= 0)
return;
84 ui_hline(x, y, w, on);
85 ui_hline(x, y + h - 1, w, on);
86 ui_vline(x, y, h, on);
87 ui_vline(x + w - 1, y, h, on);
99static inline void ui_fill_rect(
int x,
int y,
int w,
int h,
bool on) {
100 for (
int yy = 0; yy < h; ++yy)
101 ui_hline(x, y + yy, w, on);
120static inline void ui_blit_mono(
int x,
int y,
int w,
int h,
121 const uint8_t *bits,
int stride_bytes) {
122 for (
int yy = 0; yy < h; ++yy) {
123 const uint8_t *row = bits + yy * stride_bytes;
125 for (
int b = 0; b < stride_bytes && xx < w; ++b) {
127 for (
int bit = 7; bit >= 0 && xx < w; --bit, ++xx) {
128 bool on = ((v >> bit) & 1u) != 0;
129 ui_px(x + xx, y + yy, on);
uint8_t * drv_display_get_buffer(void)
Retourne un pointeur sur le framebuffer interne.
Definition drv_display.c:86
Interface du driver OLED SPI SSD1309 (128×64) pour Brick.
#define OLED_HEIGHT
Hauteur en pixels de l’écran OLED.
Definition drv_display.h:35
#define OLED_WIDTH
Largeur en pixels de l’écran OLED.
Definition drv_display.h:32