summaryrefslogtreecommitdiff
path: root/firmware/export
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
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')
-rw-r--r--firmware/export/config-gigabeat-s.h1
-rw-r--r--firmware/export/config.h9
-rw-r--r--firmware/export/mc13783.h27
3 files changed, 35 insertions, 2 deletions
diff --git a/firmware/export/config-gigabeat-s.h b/firmware/export/config-gigabeat-s.h
index a0c05dad45..cafb202ebe 100644
--- a/firmware/export/config-gigabeat-s.h
+++ b/firmware/export/config-gigabeat-s.h
@@ -97,6 +97,7 @@
/* Define the bitmask of modules used */
#define SPI_MODULE_MASK (USE_CSPI2_MODULE)
#define I2C_MODULE_MASK (USE_I2C1_MODULE)
+#define GPIO_EVENT_MASK (USE_GPIO1_EVENTS)
/* Define this if target has an additional number of threads specific to it */
#define TARGET_EXTRA_THREADS 1
diff --git a/firmware/export/config.h b/firmware/export/config.h
index c200355872..c7e204c5df 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -341,7 +341,14 @@
#endif
#if (CONFIG_CODEC == SWCODEC)
-#ifndef BOOTLOADER
+#ifdef BOOTLOADER
+
+#if CONFIG_CPU == IMX31L
+/* Priority in bootloader is wanted */
+#define HAVE_PRIORITY_SCHEDULING
+#endif
+
+#else /* !BOOTLOADER */
#define HAVE_EXTENDED_MESSAGING_AND_NAME
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_ */