aboutsummaryrefslogtreecommitdiff
path: root/src/bmlist.h
diff options
context:
space:
mode:
authorDien-Nhung Nguyen <kein@kienlab.com>2024-08-27 20:08:24 +0700
committerGitHub <noreply@github.com>2024-08-27 15:08:24 +0200
commitc95faf32a6a98975828717d596ff51dedeecdf56 (patch)
tree8fe52862e0c34bfe82509adf0c98a8e57056d4c7 /src/bmlist.h
parentf5874d607315ff88b27414299089b8528b5bb07c (diff)
Add animations (#15)
* animation: add xbm animations * refactor: correct framebuffer terminology * animation: add animations and effect * animation: timing with TMOS scheduler
Diffstat (limited to 'src/bmlist.h')
-rw-r--r--src/bmlist.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/bmlist.h b/src/bmlist.h
new file mode 100644
index 0000000..1a7cf1a
--- /dev/null
+++ b/src/bmlist.h
@@ -0,0 +1,41 @@
+#ifndef __BMLIST_H__
+#define __BMLIST_H__
+
+#include <stdint.h>
+#include <stdlib.h>
+
+typedef struct bm_st {
+ uint16_t *buf;
+ uint16_t width;
+ uint8_t modes;
+ int is_flash;
+ int is_marquee;
+ // TODO: feat: Brightness for each bm
+ int brightness;
+ // TODO: feat: Timeout for each bm to switch to next bm
+ uint32_t timeout; // zero mean no timeout
+ uint32_t anim_step; // Animation step, zero means restart animation
+
+ struct bm_st *next;
+ struct bm_st *prev;
+} bm_t;
+
+bm_t *bm_new(uint16_t width);
+static inline void bm_free(bm_t *bm)
+{
+ free(bm->buf);
+ free(bm);
+}
+
+bm_t *bmlist_insert(bm_t *at, bm_t *new);
+bm_t *bmlist_append(bm_t *new);
+bm_t *bmlist_drop(bm_t *bm);
+
+bm_t *bmlist_gonext();
+bm_t *bmlist_goprev() ;
+bm_t *bmlist_gohead();
+bm_t *bmlist_current();
+
+void bmlist_init(uint16_t first_bm_width);
+
+#endif /* __BMLIST_H__ */