1 /* ----------------------------------------------------------------------------
\r
2 * ATMEL Microcontroller Software Support
\r
3 * ----------------------------------------------------------------------------
\r
4 * Copyright (c) 2008, Atmel Corporation
\r
6 * All rights reserved.
\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
11 * - Redistributions of source code must retain the above copyright notice,
\r
12 * this list of conditions and the disclaimer below.
\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
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
30 //------------------------------------------------------------------------------
\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
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
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
64 //------------------------------------------------------------------------------
\r
66 //------------------------------------------------------------------------------
\r
70 //------------------------------------------------------------------------------
\r
72 //------------------------------------------------------------------------------
\r
74 extern void PIO_InitializeInterrupts(unsigned int priority);
\r
76 extern void PIO_ConfigureIt(const Pin *pPin, void (*handler)(const Pin *));
\r
78 extern void PIO_EnableIt(const Pin *pPin);
\r
80 extern void PIO_DisableIt(const Pin *pPin);
\r
82 extern void PIO_IT_InterruptHandler(void);
\r
84 #endif //#ifndef PIO_IT_H
\r