summaryrefslogtreecommitdiff
path: root/firmware/export/mc13783.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-05-21 08:42:11 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-05-21 08:42:11 +0000
commita9c20f5789c13b486d217024a020f9d6163e2d51 (patch)
tree5da52ca9cc7a28ba21ced042cb739e6160d5f87b /firmware/export/mc13783.h
parent5f796087b009fee1ae60904b0355cc7febe3330f (diff)
Gigabeat S:
1) Rework event handling and static registration mechanism. No target- specific code in mc13783 driver. GPIO event driver interfaces more cleanly. 2) Somewhat related - enable thread priority for bootloader which is desireable here (ffs is used for GPIO event enabling anyway and that goes along with priority). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17593 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/mc13783.h')
-rw-r--r--firmware/export/mc13783.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/firmware/export/mc13783.h b/firmware/export/mc13783.h
index 6ed1cb46be..1f6fee8c44 100644
--- a/firmware/export/mc13783.h
+++ b/firmware/export/mc13783.h
@@ -1270,6 +1270,9 @@ enum mc13783_regs_enum
#define MC13783_TC3PERIODr(x) (((x) & MC13783_TC3PERIOD) >> 21)
#define MC13783_TC3TRIODE (0x1 << 23)
+/* For event enum values which are target-defined */
+#include "mc13783-target.h"
+
void mc13783_init(void);
void mc13783_close(void);
uint32_t mc13783_set(unsigned address, uint32_t bits);
@@ -1281,6 +1284,28 @@ int mc13783_write_regset(const unsigned char *regs, const uint32_t *data, int co
uint32_t mc13783_read(unsigned address);
int mc13783_read_multiple(unsigned start, uint32_t *buffer, int count);
int mc13783_read_regset(const unsigned char *regs, uint32_t *buffer, int count);
-void mc13783_alarm_start(void);
+
+/* Statically-registered event enable/disable */
+enum mc13783_event_sets
+{
+ MC13783_EVENT_SET0 = 0,
+ MC13783_EVENT_SET1 = 1,
+};
+
+struct mc13783_event
+{
+ enum mc13783_event_sets set : 8;
+ uint32_t mask : 24;
+ void (*callback)(void);
+};
+
+struct mc13783_event_list
+{
+ unsigned count;
+ const struct mc13783_event *events;
+};
+
+bool mc13783_enable_event(enum mc13783_event_ids event);
+void mc13783_disable_event(enum mc13783_event_ids event);
#endif /* _MC13783_H_ */