ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
adi_xint.h
1 /*
2  *****************************************************************************
3  @file: adi_xint.h
4  @brief: External interrupt driver definitions and API
5  -----------------------------------------------------------------------------
6 
7 Copyright (c) 2016-2017 Analog Devices, Inc.
8 
9 All rights reserved.
10 
11 Redistribution and use in source and binary forms, with or without modification,
12 are permitted provided that the following conditions are met:
13  - Redistributions of source code must retain the above copyright notice,
14  this list of conditions and the following disclaimer.
15  - Redistributions in binary form must reproduce the above copyright notice,
16  this list of conditions and the following disclaimer in the documentation
17  and/or other materials provided with the distribution.
18  - Modified versions of the software must be conspicuously marked as such.
19  - This software is licensed solely and exclusively for use with processors
20  manufactured by or for Analog Devices, Inc.
21  - This software may not be combined or merged with other code in any manner
22  that would cause the software to become subject to terms and conditions
23  which differ from those listed here.
24  - Neither the name of Analog Devices, Inc. nor the names of its
25  contributors may be used to endorse or promote products derived
26  from this software without specific prior written permission.
27  - The use of this software may or may not infringe the patent rights of one
28  or more patent holders. This license does not release you from the
29  requirement that you obtain separate licenses from these patent holders
30  to use this software.
31 
32 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY
33 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
34 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
35 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
36 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES
37 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL
38 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
39 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 
44 *****************************************************************************/
45 #ifndef ADI_XINT_H
46 #define ADI_XINT_H
47 
52 #ifdef __ICCARM__
53 #pragma diag_default=Pm008
54 #endif /* __ICCARM__ */
55 
56 #include <adi_callback.h>
57 #include <adi_processor.h>
58 
59 #if !defined(__ADUCM302x__) && !defined(__ADUCM4x50__)
60 #error "Unknown processor family"
61 #endif
62 
63 
64 /* C++ linkage */
65 #ifdef __cplusplus
66 extern "C" {
67 #endif /* __cplusplus */
68 
72 #define ADI_XINT_MEMORY_SIZE (48u)
73 
75 typedef enum
76 {
85 
86 
88 typedef enum {
95 
97 typedef enum {
106 
107 
108 /* External Interrupt API functions */
109 ADI_XINT_RESULT adi_xint_Init (void* const pMemory, uint32_t const MemorySize);
110 ADI_XINT_RESULT adi_xint_UnInit (void);
111 ADI_XINT_RESULT adi_xint_EnableIRQ (const ADI_XINT_EVENT eEvent, const ADI_XINT_IRQ_MODE eMode);
112 ADI_XINT_RESULT adi_xint_DisableIRQ (const ADI_XINT_EVENT eEvent);
113 ADI_XINT_RESULT adi_xint_RegisterCallback (const ADI_XINT_EVENT eEvent, ADI_CALLBACK const pfCallback, void *const pCBParam );
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
121 #endif /* ADI_XINT_H */
ADI_XINT_EVENT
Definition: adi_xint.h:97
ADI_XINT_RESULT adi_xint_Init(void *const pMemory, uint32_t const MemorySize)
Initializes the External Interrupt Driver.
Definition: adi_xint.c:107
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.
Definition: adi_xint.c:333
ADI_XINT_RESULT adi_xint_UnInit(void)
Un-initialize the external interrupt driver.
Definition: adi_xint.c:149
ADI_XINT_RESULT
Definition: adi_xint.h:75
ADI_XINT_RESULT adi_xint_DisableIRQ(const ADI_XINT_EVENT eEvent)
Disable an External Interrupt.
Definition: adi_xint.c:261
ADI_XINT_RESULT adi_xint_EnableIRQ(const ADI_XINT_EVENT eEvent, const ADI_XINT_IRQ_MODE eMode)
Enable an External Interrupt.
Definition: adi_xint.c:191
ADI_XINT_IRQ_MODE
Definition: adi_xint.h:88