forked from pybricks/pybricks-micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.h
More file actions
64 lines (48 loc) · 1.38 KB
/
Copy pathdisplay.h
File metadata and controls
64 lines (48 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// SPDX-License-Identifier: MIT
// Copyright (c) 2025 The Pybricks Authors
/**
* @addtogroup DisplayDriver Driver: Display
* @{
*/
#ifndef _PBDRV_DISPLAY_H_
#define _PBDRV_DISPLAY_H_
#include <pbdrv/config.h>
#include <pbio/image.h>
#if PBDRV_CONFIG_DISPLAY
/**
* Get an image container representing the display.
* @return Image container, or NULL if no display.
*/
pbio_image_t *pbdrv_display_get_image(void);
/**
* Get the maximum value of a pixel.
* @return Maximum value, corresponding to black on a LCD screen.
*/
uint8_t pbdrv_display_get_max_value(void);
/**
* Get the pixel value corresponding to a color given in HSV space.
* @param [in] h Hue, 0 to 359 degrees.
* @param [in] s Saturation, 0 to 100 percent.
* @param [in] v Value, 0 to 100 percent.
* @return Pixel value.
*/
uint8_t pbdrv_display_get_value_from_hsv(uint16_t h, uint8_t s, uint8_t v);
/**
* Update the display to show current content of image container.
*/
void pbdrv_display_update(void);
#else // PBDRV_CONFIG_DISPLAY
static inline pbio_image_t *pbdrv_display_get_image(void) {
return NULL;
}
static inline uint8_t pbdrv_display_get_max_value(void) {
return 0;
}
static inline uint8_t pbdrv_display_get_value_from_hsv(uint16_t h, uint8_t s, uint8_t v) {
return 0;
}
static inline void pbdrv_display_update(void) {
}
#endif // PBDRV_CONFIG_DISPLAY
#endif // _PBDRV_DISPLAY_H_
/** @} */