mbed libraries for KL25Z
gpio_irq_api.h@7:73c5efe92a6c, 2012-10-23 (annotated)
- Committer:
- emilmont
- Date:
- Tue Oct 23 09:20:18 2012 +0000
- Revision:
- 7:73c5efe92a6c
- Child:
- 8:c14af7958ef5
Make the C++ library completely TARGET independent.; Implement "gpio_irq_api" and "port_api" to KL25Z.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 7:73c5efe92a6c | 1 | /* mbed Microcontroller Library - gpio_irq_api |
emilmont | 7:73c5efe92a6c | 2 | * Copyright (c) 2009-2011 ARM Limited. All rights reserved. |
emilmont | 7:73c5efe92a6c | 3 | */ |
emilmont | 7:73c5efe92a6c | 4 | #ifndef MBED_GPIO_IRQ_API_H |
emilmont | 7:73c5efe92a6c | 5 | #define MBED_GPIO_IRQ_API_H |
emilmont | 7:73c5efe92a6c | 6 | |
emilmont | 7:73c5efe92a6c | 7 | #include "device.h" |
emilmont | 7:73c5efe92a6c | 8 | |
emilmont | 7:73c5efe92a6c | 9 | #if DEVICE_INTERRUPTIN |
emilmont | 7:73c5efe92a6c | 10 | |
emilmont | 7:73c5efe92a6c | 11 | #include "PinNames.h" |
emilmont | 7:73c5efe92a6c | 12 | #include "PortNames.h" |
emilmont | 7:73c5efe92a6c | 13 | |
emilmont | 7:73c5efe92a6c | 14 | #ifdef __cplusplus |
emilmont | 7:73c5efe92a6c | 15 | extern "C" { |
emilmont | 7:73c5efe92a6c | 16 | #endif |
emilmont | 7:73c5efe92a6c | 17 | |
emilmont | 7:73c5efe92a6c | 18 | typedef enum { |
emilmont | 7:73c5efe92a6c | 19 | IRQ_NONE, |
emilmont | 7:73c5efe92a6c | 20 | IRQ_RISE, |
emilmont | 7:73c5efe92a6c | 21 | IRQ_FALL |
emilmont | 7:73c5efe92a6c | 22 | } gpio_irq_event; |
emilmont | 7:73c5efe92a6c | 23 | |
emilmont | 7:73c5efe92a6c | 24 | typedef struct { |
emilmont | 7:73c5efe92a6c | 25 | #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_KL25Z) |
emilmont | 7:73c5efe92a6c | 26 | uint32_t port; |
emilmont | 7:73c5efe92a6c | 27 | uint32_t pin; |
emilmont | 7:73c5efe92a6c | 28 | #endif |
emilmont | 7:73c5efe92a6c | 29 | uint32_t ch; |
emilmont | 7:73c5efe92a6c | 30 | } gpio_irq_object; |
emilmont | 7:73c5efe92a6c | 31 | |
emilmont | 7:73c5efe92a6c | 32 | typedef void (*gpio_irq_handler)(uint32_t id, gpio_irq_event event); |
emilmont | 7:73c5efe92a6c | 33 | |
emilmont | 7:73c5efe92a6c | 34 | int gpio_irq_init(gpio_irq_object *obj, PinName pin, gpio_irq_handler handler, uint32_t id); |
emilmont | 7:73c5efe92a6c | 35 | void gpio_irq_free(gpio_irq_object *obj); |
emilmont | 7:73c5efe92a6c | 36 | void gpio_irq_set (gpio_irq_object *obj, gpio_irq_event event, uint32_t enable); |
emilmont | 7:73c5efe92a6c | 37 | |
emilmont | 7:73c5efe92a6c | 38 | #ifdef __cplusplus |
emilmont | 7:73c5efe92a6c | 39 | } |
emilmont | 7:73c5efe92a6c | 40 | #endif |
emilmont | 7:73c5efe92a6c | 41 | |
emilmont | 7:73c5efe92a6c | 42 | #endif |
emilmont | 7:73c5efe92a6c | 43 | |
emilmont | 7:73c5efe92a6c | 44 | #endif |