更换语言:
   Contact us
  • Follow CooCox
  •         
  • CooCox Market
  •         
  • Tech Support
  •     
Home  › COX EXTI Peripheral Interface

COX EXTI Peripheral Interface

Version: 1.00 - 13. June 2010

Contents

Overview

EXTI (External Interrupt) can be used to detect input line event and generate an interrupt.

Interface Definition

EXTI Interface Definition : COX EXTI Interface is a structure variable of COX_EXTI_PI type, it contains a list of pointers to the functions that implement the standard functions specified by COX.


EXTI Interface
typedef struct {
  void       (*Handler) (EXTI_Handler  handler);      
  COX_Status (*Init)    (uint16_t pin);
  COX_Status (*Event)   (uint16_t pin, uint8_t event);  
} COX_EXTI_PI_Def;
typedef const COX_EXTI_PI_Def COX_EXTI_PI;
Member
void       (*Handler) (EXTI_Handler  handler);
/* Setup EXTI Interrupt Service Routine Call-Back Function */ COX_Status (*Init) (uint16_t pin);
/* Initialize the EXTI line */ COX_Status (*Event) (uint16_t pin, uint8_t event);
/* Select Trigger Event mode */

EXTI Interrupt Handler Prototype Definition : When EXTI interrupt ocurrs, the EXTI interrupt handler will be executed.

void (*EXTI_Handler) (uint16_t pin)
Description EXTI Interrupt Handler Prototype
Parameter pin : Specifies the interrupt line
Return Code None

Global Define

Name Description
COX_EXTI_NONE No interrupt
COX_EXTI_EDGE_RISING Rising edge interrupt
COX_EXTI_EDGE_FALLING Falling edge interrupt
COX_EXTI_EDGE_RISING_FALLING Both edge interrupt (Rising and Falling)
COX_EXTI_LEVEL_HIGH
Hign Level interrupt
COX_EXTI_LEVEL_LOW
Low Level interrupt

Standard Function

Name Description
Handler Setup EXTI interrupt handler
Init Initialize an EXTI line
Event Set which event can generate an interrupt

void Handler (EXTI_Handler handler)
Description Setup EXTI interrupt handler
Parameter exti_isr : Pointer to EXTI interrupt handler, if it is NULL, all EXTI interrupts will be disabled.
Return Code None
COX_Status Init (uint16_t pin)
Description Send a block of data
Parameter pin : Specify the EXTI line
Return Code
  • COX_SUCCESS : Success
  • COX_ERROR : Paraments error
COX_Status Event (uint16_t pin, uint8_t event)
Description Set which event can generate an interrupt
Parameter pin : Specify the EXTI line
event : Specify active event, it should be :
  • COX_EXTI_NONE : None, disable the EXTI line interrupt
  • COX_EXTI_EDGE_RISING : Rising edge
  • COX_EXTI_EDGE_FALLING : Falling edge
  • COX_EXTI_EDGE_RISING_FALLING : Both edge (Rising and Falling)
  • COX_EXTI_LEVEL_HIGH : Hign Level
  • COX_EXTI_LEVEL_LOW : Low Level
Return Code
  • COX_SUCCESS : Success
  • COX_ERROR : Paraments error

Available Interface

Vendor Chip Interface Description
NXP LPC17xx Series pi_exti EXTI Interface based on GPIO

 

© 2009 -2011 CooCox - Terms of Use         Business Model         Market             About us