You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
4.9 KiB
Groff
140 lines
4.9 KiB
Groff
4 years ago
|
.TH "<compat/deprecated.h>: Deprecated items" 3 "24 Jun 2019" "Version 2.0.0" "avr-libc" \" -*- nroff -*-
|
||
|
.ad l
|
||
|
.nh
|
||
|
.SH NAME
|
||
|
<compat/deprecated.h>: Deprecated items \-
|
||
|
.SS "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.
|
||
|
.PP
|
||
|
Example:
|
||
|
.PP
|
||
|
.PP
|
||
|
.nf
|
||
|
// Enable timer 1 overflow interrupts.
|
||
|
timer_enable_int(_BV(TOIE1));
|
||
|
|
||
|
// Do some work...
|
||
|
|
||
|
// Disable all timer interrupts.
|
||
|
timer_enable_int(0);
|
||
|
.fi
|
||
|
.PP
|
||
|
.PP
|
||
|
\fBNote:\fP
|
||
|
.RS 4
|
||
|
Be careful when you use these functions. If you already have a different interrupt enabled, you could inadvertantly disable it by enabling another intterupt.
|
||
|
.RE
|
||
|
.PP
|
||
|
|
||
|
.in +1c
|
||
|
.ti -1c
|
||
|
.RI "static __inline__ void \fBtimer_enable_int\fP (unsigned char ints)"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fBenable_external_int\fP(mask) (__EICR = mask)"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fBINTERRUPT\fP(signame)"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fB__INTR_ATTRS\fP used"
|
||
|
.br
|
||
|
.in -1c
|
||
|
.SS "Obsolete IO macros"
|
||
|
Back in a time when AVR-GCC and avr-libc could not handle IO port access in the direct assignment form as they are handled now, all IO port access had to be done through specific macros that eventually resulted in inline assembly instructions performing the desired action.
|
||
|
.PP
|
||
|
These macros became obsolete, as reading and writing IO ports can be done by simply using the IO port name in an expression, and all bit manipulation (including those on IO ports) can be done using generic C bit manipulation operators.
|
||
|
.PP
|
||
|
The macros in this group simulate the historical behaviour. While they are supposed to be applied to IO ports, the emulation actually uses standard C methods, so they could be applied to arbitrary memory locations as well.
|
||
|
.in +1c
|
||
|
.ti -1c
|
||
|
.RI "#define \fBinp\fP(port) (port)"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fBoutp\fP(val, port) (port) = (val)"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fBinb\fP(port) (port)"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fBoutb\fP(port, val) (port) = (val)"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fBsbi\fP(port, bit) (port) |= (1 << (bit))"
|
||
|
.br
|
||
|
.ti -1c
|
||
|
.RI "#define \fBcbi\fP(port, bit) (port) &= ~(1 << (bit))"
|
||
|
.br
|
||
|
.in -1c
|
||
|
.SH "Detailed Description"
|
||
|
.PP
|
||
|
This header file contains several items that used to be available in previous versions of this library, but have eventually been deprecated over time.
|
||
|
.PP
|
||
|
.PP
|
||
|
.nf
|
||
|
#include <compat/deprecated.h>
|
||
|
.fi
|
||
|
.PP
|
||
|
.PP
|
||
|
These items are supplied within that header file for backward compatibility reasons only, so old source code that has been written for previous library versions could easily be maintained until its end-of-life. Use of any of these items in new code is strongly discouraged.
|
||
|
.SH "Define Documentation"
|
||
|
.PP
|
||
|
.SS "#define cbi(port, bit) (port) &= ~(1 << (bit))"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
Clear \fCbit\fP in IO port \fCport\fP.
|
||
|
.SS "#define enable_external_int(mask) (__EICR = mask)"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
This macro gives access to the \fCGIMSK\fP register (or \fCEIMSK\fP register if using an AVR Mega device or \fCGICR\fP register for others). Although this macro is essentially the same as assigning to the register, it does adapt slightly to the type of device being used. This macro is unavailable if none of the registers listed above are defined.
|
||
|
.SS "#define inb(port) (port)"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
Read a value from an IO port \fCport\fP.
|
||
|
.SS "#define inp(port) (port)"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
Read a value from an IO port \fCport\fP.
|
||
|
.SS "#define INTERRUPT(signame)"\fBValue:\fP
|
||
|
.PP
|
||
|
.nf
|
||
|
void signame (void) __attribute__ ((interrupt,__INTR_ATTRS)); \
|
||
|
void signame (void)
|
||
|
.fi
|
||
|
\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
Introduces an interrupt handler function that runs with global interrupts initially enabled. This allows interrupt handlers to be interrupted.
|
||
|
.PP
|
||
|
As this macro has been used by too many unsuspecting people in the past, it has been deprecated, and will be removed in a future version of the library. Users who want to legitimately re-enable interrupts in their interrupt handlers as quickly as possible are encouraged to explicitly declare their handlers as described \fBabove\fP.
|
||
|
.SS "#define outb(port, val) (port) = (val)"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
Write \fCval\fP to IO port \fCport\fP.
|
||
|
.SS "#define outp(val, port) (port) = (val)"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
Write \fCval\fP to IO port \fCport\fP.
|
||
|
.SS "#define sbi(port, bit) (port) |= (1 << (bit))"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
Set \fCbit\fP in IO port \fCport\fP.
|
||
|
.SH "Function Documentation"
|
||
|
.PP
|
||
|
.SS "static __inline__ void timer_enable_int (unsigned char ints)\fC [static]\fP"\fBDeprecated\fP
|
||
|
.RS 4
|
||
|
.RE
|
||
|
.PP
|
||
|
This function modifies the \fCtimsk\fP register. The value you pass via \fCints\fP is device specific.
|
||
|
.SH "Author"
|
||
|
.PP
|
||
|
Generated automatically by Doxygen for avr-libc from the source code.
|