diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
commit | a9c20f5789c13b486d217024a020f9d6163e2d51 (patch) | |
tree | 5da52ca9cc7a28ba21ced042cb739e6160d5f87b /firmware/export/mc13783.h | |
parent | 5f796087b009fee1ae60904b0355cc7febe3330f (diff) | |
download | rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.tar.gz rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.zip |
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.h | 27 |
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 | |||
1270 | #define MC13783_TC3PERIODr(x) (((x) & MC13783_TC3PERIOD) >> 21) | 1270 | #define MC13783_TC3PERIODr(x) (((x) & MC13783_TC3PERIOD) >> 21) |
1271 | #define MC13783_TC3TRIODE (0x1 << 23) | 1271 | #define MC13783_TC3TRIODE (0x1 << 23) |
1272 | 1272 | ||
1273 | /* For event enum values which are target-defined */ | ||
1274 | #include "mc13783-target.h" | ||
1275 | |||
1273 | void mc13783_init(void); | 1276 | void mc13783_init(void); |
1274 | void mc13783_close(void); | 1277 | void mc13783_close(void); |
1275 | uint32_t mc13783_set(unsigned address, uint32_t bits); | 1278 | 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 | |||
1281 | uint32_t mc13783_read(unsigned address); | 1284 | uint32_t mc13783_read(unsigned address); |
1282 | int mc13783_read_multiple(unsigned start, uint32_t *buffer, int count); | 1285 | int mc13783_read_multiple(unsigned start, uint32_t *buffer, int count); |
1283 | int mc13783_read_regset(const unsigned char *regs, uint32_t *buffer, int count); | 1286 | int mc13783_read_regset(const unsigned char *regs, uint32_t *buffer, int count); |
1284 | void mc13783_alarm_start(void); | 1287 | |
1288 | /* Statically-registered event enable/disable */ | ||
1289 | enum mc13783_event_sets | ||
1290 | { | ||
1291 | MC13783_EVENT_SET0 = 0, | ||
1292 | MC13783_EVENT_SET1 = 1, | ||
1293 | }; | ||
1294 | |||
1295 | struct mc13783_event | ||
1296 | { | ||
1297 | enum mc13783_event_sets set : 8; | ||
1298 | uint32_t mask : 24; | ||
1299 | void (*callback)(void); | ||
1300 | }; | ||
1301 | |||
1302 | struct mc13783_event_list | ||
1303 | { | ||
1304 | unsigned count; | ||
1305 | const struct mc13783_event *events; | ||
1306 | }; | ||
1307 | |||
1308 | bool mc13783_enable_event(enum mc13783_event_ids event); | ||
1309 | void mc13783_disable_event(enum mc13783_event_ids event); | ||
1285 | 1310 | ||
1286 | #endif /* _MC13783_H_ */ | 1311 | #endif /* _MC13783_H_ */ |