Mercurial > ecos-v3_0-branch
comparison packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c @ 117:bd1a71e3e476 ecos-sw-2000-08-25
Merge from eCos master repository on 2000-08-25-19:22:58-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 19:17:22 +0000 |
| parents | 6ed91473a1cd |
| children | 77cec8369160 |
comparison
equal
deleted
inserted
replaced
| 116:a0f9581a3a09 | 117:bd1a71e3e476 |
|---|---|
| 44 #include <pkgconf/io_pcmcia.h> | 44 #include <pkgconf/io_pcmcia.h> |
| 45 | 45 |
| 46 #include <cyg/hal/hal_io.h> // IO macros | 46 #include <cyg/hal/hal_io.h> // IO macros |
| 47 #include <cyg/hal/hal_arch.h> // Register state info | 47 #include <cyg/hal/hal_arch.h> // Register state info |
| 48 #include <cyg/hal/hal_intr.h> // HAL interrupt macros | 48 #include <cyg/hal/hal_intr.h> // HAL interrupt macros |
| 49 #include <cyg/hal/drv_api.h> | |
| 49 | 50 |
| 50 #ifdef CYGPKG_KERNEL | 51 #ifdef CYGPKG_KERNEL |
| 51 #include <pkgconf/kernel.h> // Configuration header | 52 #include <pkgconf/kernel.h> // Configuration header |
| 52 #include <cyg/kernel/kapi.h> | 53 #include <cyg/kernel/kapi.h> |
| 53 #else | 54 #else |
| 121 unsigned long new_state = *SA11X0_GPIO_PIN_LEVEL; | 122 unsigned long new_state = *SA11X0_GPIO_PIN_LEVEL; |
| 122 if (!int_init) { | 123 if (!int_init) { |
| 123 int_init = 1; | 124 int_init = 1; |
| 124 #ifdef CYGPKG_KERNEL | 125 #ifdef CYGPKG_KERNEL |
| 125 // Set up interrupts | 126 // Set up interrupts |
| 126 cyg_interrupt_create(SA1110_CF_DETECT, | 127 cyg_drv_interrupt_create(SA1110_CF_DETECT, |
| 127 99, // Priority - what goes here? | 128 99, // Priority - what goes here? |
| 128 (cyg_addrword_t) slot, // Data item passed to interrupt handler | 129 (cyg_addrword_t) slot, // Data item passed to interrupt handler |
| 129 (cyg_ISR_t *)cf_detect_isr, | 130 (cyg_ISR_t *)cf_detect_isr, |
| 130 (cyg_DSR_t *)cf_detect_dsr, | 131 (cyg_DSR_t *)cf_detect_dsr, |
| 131 &cf_detect_interrupt_handle, | 132 &cf_detect_interrupt_handle, |
| 132 &cf_detect_interrupt); | 133 &cf_detect_interrupt); |
| 133 cyg_interrupt_attach(cf_detect_interrupt_handle); | 134 cyg_drv_interrupt_attach(cf_detect_interrupt_handle); |
| 134 cyg_interrupt_configure(SA1110_CF_DETECT, true, true); // Detect either edge | 135 cyg_drv_interrupt_configure(SA1110_CF_DETECT, true, true); // Detect either edge |
| 135 cyg_interrupt_acknowledge(SA1110_CF_DETECT); | 136 cyg_drv_interrupt_acknowledge(SA1110_CF_DETECT); |
| 136 cyg_interrupt_unmask(SA1110_CF_DETECT); | 137 cyg_drv_interrupt_unmask(SA1110_CF_DETECT); |
| 137 cyg_interrupt_create(SA1110_CF_IRQ, | 138 cyg_drv_interrupt_create(SA1110_CF_IRQ, |
| 138 99, // Priority - what goes here? | 139 99, // Priority - what goes here? |
| 139 (cyg_addrword_t) slot, // Data item passed to interrupt handler | 140 (cyg_addrword_t) slot, // Data item passed to interrupt handler |
| 140 (cyg_ISR_t *)cf_irq_isr, | 141 (cyg_ISR_t *)cf_irq_isr, |
| 141 (cyg_DSR_t *)cf_irq_dsr, | 142 (cyg_DSR_t *)cf_irq_dsr, |
| 142 &cf_irq_interrupt_handle, | 143 &cf_irq_interrupt_handle, |
| 143 &cf_irq_interrupt); | 144 &cf_irq_interrupt); |
| 144 cyg_interrupt_attach(cf_irq_interrupt_handle); | 145 cyg_drv_interrupt_attach(cf_irq_interrupt_handle); |
| 145 cyg_interrupt_configure(SA1110_CF_IRQ, false, false); // Falling edge | 146 cyg_drv_interrupt_acknowledge(SA1110_CF_IRQ); |
| 146 cyg_interrupt_acknowledge(SA1110_CF_IRQ); | 147 cyg_drv_interrupt_unmask(SA1110_CF_IRQ); |
| 147 cyg_interrupt_unmask(SA1110_CF_IRQ); | 148 #endif |
| 148 #endif | 149 cyg_drv_interrupt_configure(SA1110_CF_IRQ, false, false); // Falling edge |
| 149 } | 150 } |
| 150 slot->attr = (unsigned char *)0x38000000; | 151 slot->attr = (unsigned char *)0x38000000; |
| 151 slot->attr_length = 0x200; | 152 slot->attr_length = 0x200; |
| 152 slot->io = (unsigned char *)0x30000000; | 153 slot->io = (unsigned char *)0x30000000; |
| 153 slot->io_length = 0x04000000; | 154 slot->io_length = 0x04000000; |
| 234 do_delay(10); | 235 do_delay(10); |
| 235 } | 236 } |
| 236 } | 237 } |
| 237 } | 238 } |
| 238 } | 239 } |
| 240 | |
| 241 // | |
| 242 // Acknowledge interrupt (used in non-kernel environments) | |
| 243 // | |
| 244 void | |
| 245 cf_hwr_clear_interrupt(struct cf_slot *slot) | |
| 246 { | |
| 247 // Clear interrupt [edge indication] | |
| 248 cyg_drv_interrupt_acknowledge(SA1110_CF_IRQ); | |
| 249 } |
