/*******************************************************************************
* Project:      Amped'RF Bluetooth
* File name:    GKI_exti.h
* Description:  Header for external interrupt abstraction layer
*
* Copyright (c) 2013 Amped'RF Inc., AR Technology  All rights reserved.
*******************************************************************************/
#ifndef _GKI_EXTI_H_
#define _GKI_EXTI_H_

#define GKI_EXTI_Line0       ((u32)0x00001)  /* External interrupt line 0 */
#define GKI_EXTI_Line1       ((u32)0x00002)  /* External interrupt line 1 */
#define GKI_EXTI_Line2       ((u32)0x00004)  /* External interrupt line 2 */
#define GKI_EXTI_Line3       ((u32)0x00008)  /* External interrupt line 3 */
#define GKI_EXTI_Line4       ((u32)0x00010)  /* External interrupt line 4 */
#define GKI_EXTI_Line5       ((u32)0x00020)  /* External interrupt line 5 */
#define GKI_EXTI_Line6       ((u32)0x00040)  /* External interrupt line 6 */
#define GKI_EXTI_Line7       ((u32)0x00080)  /* External interrupt line 7 */
#define GKI_EXTI_Line8       ((u32)0x00100)  /* External interrupt line 8 */
#define GKI_EXTI_Line9       ((u32)0x00200)  /* External interrupt line 9 */
#define GKI_EXTI_Line10      ((u32)0x00400)  /* External interrupt line 10 */
#define GKI_EXTI_Line11      ((u32)0x00800)  /* External interrupt line 11 */
#define GKI_EXTI_Line12      ((u32)0x01000)  /* External interrupt line 12 */
#define GKI_EXTI_Line13      ((u32)0x02000)  /* External interrupt line 13 */
#define GKI_EXTI_Line14      ((u32)0x04000)  /* External interrupt line 14 */
#define GKI_EXTI_Line15      ((u32)0x08000)  /* External interrupt line 15 */
#define GKI_EXTI_Line16      ((u32)0x10000)  /* External interrupt line 16
                                                Connected to the PVD Output */
#define GKI_EXTI_Line17      ((u32)0x20000)  /* External interrupt line 17
                                                Connected to the RTC Alarm event */
#define GKI_EXTI_Line18      ((u32)0x40000)  /* External interrupt line 18
                                                Connected to the USB Wakeup from
                                                suspend event */

#define GKI_EXTI0_IRQChannel             ((u8)0x06)  /* EXTI Line0 Interrupt */
#define GKI_EXTI1_IRQChannel             ((u8)0x07)  /* EXTI Line1 Interrupt */
#define GKI_EXTI2_IRQChannel             ((u8)0x08)  /* EXTI Line2 Interrupt */
#define GKI_EXTI3_IRQChannel             ((u8)0x09)  /* EXTI Line3 Interrupt */
#define GKI_EXTI4_IRQChannel             ((u8)0x0A)  /* EXTI Line4 Interrupt */


#define Type_event 	(0)
#define Type_exti 	(1)

// Prototypes
void GKI_GpioWakeupSet(u16 io, u8 trigger, uint8 type);
void GKI_exti_GenerateSWInterrupt(u32);
void GKI_exti_GpioEventEnable(u16 io, uint8 trigger);
void GKI_exti_Cmd(FunctionalState state);


#endif // _GKI_EXTI_H_
