mbed libraries for KL25Z
Diff: gpio_irq_api.h
- Revision:
- 7:73c5efe92a6c
- Child:
- 8:c14af7958ef5
diff -r 0d4e7384bff6 -r 73c5efe92a6c gpio_irq_api.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpio_irq_api.h Tue Oct 23 09:20:18 2012 +0000 @@ -0,0 +1,44 @@ +/* mbed Microcontroller Library - gpio_irq_api + * Copyright (c) 2009-2011 ARM Limited. All rights reserved. + */ +#ifndef MBED_GPIO_IRQ_API_H +#define MBED_GPIO_IRQ_API_H + +#include "device.h" + +#if DEVICE_INTERRUPTIN + +#include "PinNames.h" +#include "PortNames.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + IRQ_NONE, + IRQ_RISE, + IRQ_FALL +} gpio_irq_event; + +typedef struct { +#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_KL25Z) + uint32_t port; + uint32_t pin; +#endif + uint32_t ch; +} gpio_irq_object; + +typedef void (*gpio_irq_handler)(uint32_t id, gpio_irq_event event); + +int gpio_irq_init(gpio_irq_object *obj, PinName pin, gpio_irq_handler handler, uint32_t id); +void gpio_irq_free(gpio_irq_object *obj); +void gpio_irq_set (gpio_irq_object *obj, gpio_irq_event event, uint32_t enable); + +#ifdef __cplusplus +} +#endif + +#endif + +#endif