diff options
Diffstat (limited to 'components/sign_logic/include')
| -rw-r--r-- | components/sign_logic/include/sign_logic.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/components/sign_logic/include/sign_logic.h b/components/sign_logic/include/sign_logic.h new file mode 100644 index 0000000..ca296cb --- /dev/null +++ b/components/sign_logic/include/sign_logic.h @@ -0,0 +1,30 @@ +#pragma once + +#include <stdbool.h> +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define SIGN_BRIGHTNESS_MIN 0u +#define SIGN_BRIGHTNESS_MAX 100u +#define SIGN_BRIGHTNESS_DEFAULT 75u + +typedef struct { + bool is_on_air; + uint8_t brightness; +} sign_state_t; + +typedef enum { + SIGN_OK = 0, + SIGN_ERR_NULL = 1, + SIGN_ERR_RANGE = 2, +} sign_result_t; + +sign_result_t sign_set_on_air(sign_state_t *state, bool on_air); +sign_result_t sign_set_brightness(sign_state_t *state, uint8_t brightness); + +#ifdef __cplusplus +} +#endif |
