diff options
author | Christian Cunningham <cc@localhost> | 2022-03-24 22:55:13 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-03-24 22:55:13 -0700 |
commit | 75ca654c2a3a4cce24459a381311c259ce7ce8a3 (patch) | |
tree | 2549dd19a9bd1484f8ca48246d4bf4b40b937f42 /include | |
parent | c5b6f1611ea1f4685ef02f65fc0362f9c22c344f (diff) |
GPIO Interrupts
Diffstat (limited to 'include')
-rw-r--r-- | include/cpu/irq.h | 9 | ||||
-rw-r--r-- | include/symbols.h | 10 | ||||
-rw-r--r-- | include/usr/timed.h | 1 |
3 files changed, 18 insertions, 2 deletions
diff --git a/include/cpu/irq.h b/include/cpu/irq.h index 28e060b..e244cc9 100644 --- a/include/cpu/irq.h +++ b/include/cpu/irq.h @@ -6,7 +6,9 @@ #define SYS_TIMER_1_IRQ 2 #define SYS_TIMER_2_IRQ 3 #define SYS_TIMER_3_IRQ 4 -#define LOCAL_TIMER_IRQ 5 +#define GPIO_BANK_1_IRQ 5 +#define GPIO_BANK_2_IRQ 6 +#define LOCAL_TIMER_IRQ 7 #define MAX_IRQS LOCAL_TIMER_IRQ+1 struct IrqEntry { @@ -24,6 +26,11 @@ struct SysTimerInfo { void* arg; }; +struct GPIOInfo { + unsigned long pin; + unsigned long priority; +}; + static inline void enableirq(void) { asm volatile("cpsie i"); diff --git a/include/symbols.h b/include/symbols.h index b81b1a9..62f4a96 100644 --- a/include/symbols.h +++ b/include/symbols.h @@ -50,7 +50,7 @@ enum IRQ_BASIC_DISABLE = (IRQ_BASE + 0x224), // Peripherals Interrupts - //UART_IRQ = 57, + UART_0_IRQ = 57, GPIO_IRQ_0 = 49, GPIO_IRQ_1 = 50, GPIO_IRQ_2 = 51, @@ -117,6 +117,14 @@ enum #define GPLEV1 ((volatile unsigned int*)(MMIO_BASE+0x00200038)) #define GPEDS0 ((volatile unsigned int*)(MMIO_BASE+0x00200040)) #define GPEDS1 ((volatile unsigned int*)(MMIO_BASE+0x00200044)) +#define GPREN0 ((volatile unsigned int*)(MMIO_BASE+0x0020004C)) +#define GPREN1 ((volatile unsigned int*)(MMIO_BASE+0x00200050)) +#define GPFEN0 ((volatile unsigned int*)(MMIO_BASE+0x00200058)) +#define GPFEN1 ((volatile unsigned int*)(MMIO_BASE+0x0020005C)) +#define GPAREN0 ((volatile unsigned int*)(MMIO_BASE+0x0020007C)) +#define GPAREN1 ((volatile unsigned int*)(MMIO_BASE+0x00200080)) +#define GPAFEN0 ((volatile unsigned int*)(MMIO_BASE+0x00200088)) +#define GPAFEN1 ((volatile unsigned int*)(MMIO_BASE+0x0020008C)) #define GPHEN0 ((volatile unsigned int*)(MMIO_BASE+0x00200064)) #define GPHEN1 ((volatile unsigned int*)(MMIO_BASE+0x00200068)) // Controls actuation of pull up/down to ALL GPIO pins. diff --git a/include/usr/timed.h b/include/usr/timed.h index f3f941a..4cccc56 100644 --- a/include/usr/timed.h +++ b/include/usr/timed.h @@ -3,5 +3,6 @@ void loop(void); void loopt(void); +void consumer(void); #endif |