Index: doc/api/Makefile.am =================================================================== RCS file: /home/cvs/avr-libc/avr-libc/doc/api/Makefile.am,v retrieving revision 1.11 diff -u -r1.11 Makefile.am --- doc/api/Makefile.am 5 Aug 2002 21:47:34 -0000 1.11 +++ doc/api/Makefile.am 7 Aug 2002 21:54:43 -0000 @@ -37,6 +37,7 @@ EXTRA_DIST = dox.css dox_html_header dox_html_footer \ main_page.dox \ inline_asm.dox \ + interrupts.dox \ faq.dox SUFFIXES = .pdf Index: include/avr/interrupt.h =================================================================== RCS file: /home/cvs/avr-libc/avr-libc/include/avr/interrupt.h,v retrieving revision 1.1 diff -u -r1.1 interrupt.h --- include/avr/interrupt.h 5 Jul 2002 20:38:44 -0000 1.1 +++ include/avr/interrupt.h 7 Aug 2002 21:54:43 -0000 @@ -28,13 +28,61 @@ #include +/** \name Global manipulation of the interrupt flag + + The global interrupt flag is maintained in the I bit of the + status register (SREG). */ + +/address@hidden/ + +/** \def sei() + \ingroup avr_interrupts + + \code#include \endcode + + Enables interrupts by clearing the global interrupt + mask. This function actually compiles into a single line of + assembly, so there is no function call overhead. */ + #define sei() __asm__ __volatile__ ("sei" ::) + +/** \def cli() + \ingroup avr_interrupts + + \code#include \endcode + + Disables all interrupts by clearing the global interrupt + mask. This function actually compiles into a single line of + assembly, so there is no function call overhead. */ + #define cli() __asm__ __volatile__ ("cli" ::) +/address@hidden/ + +/** \name Allowing specific system-wide interrupts + + In addition to globally enabling interrupts, each device's + particular interrupt needs to be enabled separately if + interrupts for this device are desired. While some devices + maintain their interrupt enable bit inside the device's + register set, external and timer interrupts have system-wide + configuration registers. */ + +/address@hidden/ + #ifdef __cplusplus extern "C" { #endif +/** \ingroup avr_interrupts + + \code#include \endcode + + This function gives access to the \c gimsk register (or \c eimsk register + if using an AVR Mega device). Although this function is essentially the + same as using the outb() function, it does adapt slightly to the type of + device being used. */ + extern inline void enable_external_int (unsigned char ints) { #ifdef EIMSK @@ -46,6 +94,27 @@ #endif } +/** \ingroup avr_interrupts + + \code#include \endcode + + This function modifies the \c timsk register using the outb() function. + The value you pass via \c ints is device specific. + + Example: + + Enable timer 1 overflow interrupts. + + \code + timer_enable_int(BV(TOIE1)); + \endcode + + Disable all timer interrupts. + + \code + timer_enable_int(0); + \endcode */ + extern inline void timer_enable_int (unsigned char ints) { #ifdef TIMSK @@ -56,5 +125,7 @@ #ifdef __cplusplus } #endif + +/address@hidden/ #endif Index: include/avr/io.h =================================================================== RCS file: /home/cvs/avr-libc/avr-libc/include/avr/io.h,v retrieving revision 1.1 diff -u -r1.1 io.h --- include/avr/io.h 5 Jul 2002 20:38:44 -0000 1.1 +++ include/avr/io.h 7 Aug 2002 21:54:43 -0000 @@ -23,6 +23,49 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/** \defgroup avr_io AVR device-specific IO definitions + \code #include \endcode + + This header file includes the apropriate IO definitions for the + device that has been specified by the -mmcu= compiler + command-line switch. + + Included are definitions of the IO register set and their + respective bit values as specified in the Atmel documentation. + Note that Atmel is not very consistent in its naming conventions, + so even identical functions sometimes get different names on + different devices. + + Also included are the specific names useable for interrupt + function definitions as documented + \ref avr_signames "here". + + Finally, the following macros are defined: + +
    +
  • + \b RAMEND + + A constant describing the last on-chip RAM location. + +
  • + \b XRAMEND + + A constant describing the last possible location in RAM. + This is equal to RAMEND for devices that do not allow for + external RAM. + +
  • + \b E2END + + A constant describing the address of the last EEPROM cell. + +
  • + \b FLASHEND + + A constant describing the last byte address in flash ROM. +
*/ + #ifndef _AVR_IO_H_ #define _AVR_IO_H_ Index: include/avr/signal.h =================================================================== RCS file: /home/cvs/avr-libc/avr-libc/include/avr/signal.h,v retrieving revision 1.2 diff -u -r1.2 signal.h --- include/avr/signal.h 26 Jul 2002 05:49:44 -0000 1.2 +++ include/avr/signal.h 7 Aug 2002 21:54:43 -0000 @@ -26,14 +26,16 @@ #ifndef _AVR_SIGNAL_H_ #define _AVR_SIGNAL_H_ -/** \defgroup avr_signals Signals and Interrupts - \code #include \endcode - - FIXME: discuss the SIGNAL() and INTERRUPT() macros. Rich Neswold's - document has a good discussion of this. */ +/** \name Macros for writing interrupt handler functions */ +/address@hidden/ /** \def SIGNAL(signame) - \ingroup avr_signals */ + \ingroup avr_interrupts + + \code#include \endcode + + Introduces an interrupt handler function that runs with + global interrupts initially disabled. */ #ifdef __cplusplus #define SIGNAL(signame) \ @@ -47,7 +49,12 @@ #endif /** \def INTERRUPT(signame) - \ingroup avr_signals */ + \ingroup avr_interrupts + + \code#include \endcode + + Introduces an interrupt handler function that runs with + global interrupts initially enabled. */ #ifdef __cplusplus #define INTERRUPT(signame) \ @@ -59,5 +66,7 @@ void signame (void) __attribute__ ((interrupt)); \ void signame (void) #endif + +/address@hidden/ #endif /* _AVR_SIGNAL_H_ */