]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M7_SAMV71_Xplained/libchip_samv7/include/pio_it.h
Update version number ready for V8.2.1 release.
[freertos] / FreeRTOS / Demo / CORTEX_M7_SAMV71_Xplained / libchip_samv7 / include / pio_it.h
1 /* ----------------------------------------------------------------------------\r
2  *         SAM Software Package License\r
3  * ----------------------------------------------------------------------------\r
4  * Copyright (c) 2011, Atmel Corporation\r
5  *\r
6  * All rights reserved.\r
7  *\r
8  * Redistribution and use in source and binary forms, with or without\r
9  * modification, are permitted provided that the following conditions are met:\r
10  *\r
11  * - Redistributions of source code must retain the above copyright notice,\r
12  * this list of conditions and the disclaimer below.\r
13  *\r
14  * Atmel's name may not be used to endorse or promote products derived from\r
15  * this software without specific prior written permission.\r
16  *\r
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR\r
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,\r
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\r
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
27  * ----------------------------------------------------------------------------\r
28  */\r
29 \r
30 /**\r
31  *  \file\r
32  *\r
33  *  \par Purpose\r
34  *\r
35  *  Configuration and handling of interrupts on PIO status changes. The API\r
36  *  provided here have several advantages over the traditional PIO interrupt\r
37  *  configuration approach:\r
38  *     - It is highly portable\r
39  *     - It automatically demultiplexes interrupts when multiples pins have been\r
40  *       configured on a single PIO controller\r
41  *     - It allows a group of pins to share the same interrupt\r
42  *\r
43  *  However, it also has several minor drawbacks that may prevent from using it\r
44  *  in particular applications:\r
45  *     - It enables the clocks of all PIO controllers\r
46  *     - PIO controllers all share the same interrupt handler, which does the\r
47  *       demultiplexing and can be slower than direct configuration\r
48  *     - It reserves space for a fixed number of interrupts, which can be\r
49  *       increased by modifying the appropriate constant in pio_it.c.\r
50  *\r
51  *  \par Usage\r
52  *\r
53  *  -# Initialize the PIO interrupt mechanism using PIO_InitializeInterrupts()\r
54  *     with the desired priority (0 ... 7).\r
55  *  -# Configure a status change interrupt on one or more pin(s) with\r
56  *     PIO_ConfigureIt().\r
57  *  -# Enable & disable interrupts on pins using PIO_EnableIt() and\r
58  *     PIO_DisableIt().\r
59  */\r
60 \r
61 #ifndef _PIO_IT_\r
62 #define _PIO_IT_\r
63 \r
64 /*\r
65  *         Headers\r
66  */\r
67 \r
68 #include "pio.h"\r
69 \r
70 #ifdef __cplusplus\r
71  extern "C" {\r
72 #endif\r
73 \r
74 /*\r
75  *         Global functions\r
76  */\r
77 \r
78 extern void PIO_InitializeInterrupts( uint32_t dwPriority ) ;\r
79 \r
80 extern void PIO_ConfigureIt( const Pin *pPin, void (*handler)( const Pin* ) ) ;\r
81 \r
82 extern void PIO_EnableIt( const Pin *pPin ) ;\r
83 \r
84 extern void PIO_DisableIt( const Pin *pPin ) ;\r
85 \r
86 extern void PIO_IT_InterruptHandler( void ) ;\r
87 \r
88 extern void PioInterruptHandler( uint32_t id, Pio *pPio ) ;\r
89 \r
90 extern void PIO_CaptureHandler( void ) ;\r
91 \r
92 #ifdef __cplusplus\r
93 }\r
94 #endif\r
95 \r
96 #endif /* #ifndef _PIO_IT_ */\r
97 \r