ADuCM4x50 Device Drivers API Reference Manual
Release 4.0.0.0
|
External Interrupt (XINT) Driver. More...
Macros | |
#define | ADI_XINT_MEMORY_SIZE (48u) |
Enumerations | |
enum | ADI_XINT_RESULT { ADI_XINT_SUCCESS = 0, ADI_XINT_FAILURE, ADI_XINT_ALREADY_INITIALIZED, ADI_XINT_NOT_INITIALIZED, ADI_XINT_NULL_PARAMETER, ADI_XINT_INVALID_MEMORY_SIZE, ADI_XINT_INVALID_INTERRUPT } |
enum | ADI_XINT_IRQ_MODE { ADI_XINT_IRQ_RISING_EDGE = 0x0, ADI_XINT_IRQ_FALLING_EDGE = 0x1, ADI_XINT_IRQ_EITHER_EDGE = 0x2, ADI_XINT_IRQ_HIGH_LEVEL = 0x3, ADI_XINT_IRQ_LOW_LEVEL = 0x4 } |
enum | ADI_XINT_EVENT { ADI_XINT_EVENT_INT0 = 0x0, ADI_XINT_EVENT_INT1 = 0x1, ADI_XINT_EVENT_INT2 = 0x2, ADI_XINT_EVENT_INT3 = 0x3, ADI_XINT_EVENT_RESERVED = 0x4, ADI_XINT_EVENT_UART_RX = 0x5, ADI_XINT_EVENT_MAX = 0x6 } |
Functions | |
ADI_XINT_RESULT | adi_xint_Init (void *const pMemory, uint32_t const MemorySize) |
Initializes the External Interrupt Driver. More... | |
ADI_XINT_RESULT | adi_xint_UnInit (void) |
Un-initialize the external interrupt driver. More... | |
ADI_XINT_RESULT | adi_xint_EnableIRQ (const ADI_XINT_EVENT eEvent, const ADI_XINT_IRQ_MODE eMode) |
Enable an External Interrupt. More... | |
ADI_XINT_RESULT | adi_xint_DisableIRQ (const ADI_XINT_EVENT eEvent) |
Disable an External Interrupt. More... | |
ADI_XINT_RESULT | adi_xint_RegisterCallback (const ADI_XINT_EVENT eEvent, ADI_CALLBACK const pfCallback, void *const pCBParam) |
Register or unregister an application callback function for external pin interrupts. More... | |
External Interrupt (XINT) Driver.
#define ADI_XINT_MEMORY_SIZE (48u) |
Amount of memory(in bytes) required by the External Interrupt device driver for its operation. This memory is completely owned by the driver till the end of the operation.
Definition at line 40 of file adi_xint.h.
enum ADI_XINT_RESULT |
External Interrupt Driver API function return codes
Definition at line 43 of file adi_xint.h.
enum ADI_XINT_IRQ_MODE |
External interrupt trigger condition enumerations
Definition at line 56 of file adi_xint.h.
enum ADI_XINT_EVENT |
External interrupts.
Definition at line 65 of file adi_xint.h.
ADI_XINT_RESULT adi_xint_Init | ( | void *const | pMemory, |
uint32_t const | MemorySize | ||
) |
Initializes the External Interrupt Driver.
This function does the external interrupt driver initialization. This function should be called before calling any of the XINT driver APIs.
[in] | pMemory | Pointer to the memory to be used by the driver. Size of the memory should be at equal to ADI_XINT_MEMORY_SIZE bytes. |
[in] | MemorySize | Size of the memory passed in pMemory parameter. |
Definition at line 74 of file adi_xint.c.
ADI_XINT_RESULT adi_xint_UnInit | ( | void | ) |
Un-initialize the external interrupt driver.
Terminates the XINT functions, leaving everything unchanged.
Definition at line 116 of file adi_xint.c.
ADI_XINT_RESULT adi_xint_EnableIRQ | ( | const ADI_XINT_EVENT | eEvent, |
const ADI_XINT_IRQ_MODE | eMode | ||
) |
Enable an External Interrupt.
Enables and sets the triggering mode for the given external interrupt. Applications may register a callback using the adi_xint_RegisterCallback API to get a notification when the interrupt occurs.
To get the external interrupt working application has to enable the input (using the GPIO driver API adi_gpio_InputEnable) for the corresponding GPIO pin. Please refer the GPIO chapter pin-muxing section of the Hardware Reference Manual to see the GPIO pin that is mapped to the required external interrupt.
[in] | eEvent | Event which needs to be enabled. |
[in] | eMode | Interrupt trigger mode for the external interrupt. |
Definition at line 158 of file adi_xint.c.
ADI_XINT_RESULT adi_xint_DisableIRQ | ( | const ADI_XINT_EVENT | eEvent | ) |
Disable an External Interrupt.
Disables an external interrupt
[in] | eEvent | External Interrupt event that should be disabled. |
Definition at line 228 of file adi_xint.c.
ADI_XINT_RESULT adi_xint_RegisterCallback | ( | const ADI_XINT_EVENT | eEvent, |
ADI_CALLBACK const | pfCallback, | ||
void *const | pCBParam | ||
) |
Register or unregister an application callback function for external pin interrupts.
Applications may register a callback function that will be called when an external interrupt occurs. In addition to registering the interrupt, the application should call the adi_xint_EnableIRQ API to enable the external pin interrupt.
The driver dispatches calls to registered callback functions when the properly configured pin(s) latches an external interrupt input on the XINT pin(s). The callback is dispatched with the following parameters, respectively:
[in] | eEvent | The interrupt for which the callback is being registered. |
[in] | pfCallback | Pointer to the callback function. This can be passed as NULL to unregister the callback. |
[in] | pCBParam | Callback parameter which will be passed back to the application when the callback is called.. |
Definition at line 300 of file adi_xint.c.