deprecated_items(3avr)
omg hii bestie π this is deprecated_items(3avr), the AVR-LibC manual page for the deprecated stuff in <compat/deprecated.h>. it's giving old code museum but we're gonna slay through it. β¨
β¨ NAME β¨
deprecated_items - <compat/deprecated.h>: Deprecated items
πΈ SYNOPSIS πΈ
β¨ Allowing specific system-wide interrupts β¨
okay so here's the tea, bestie: besides globally enabling interrupts, each device's particular interrupt still needs to be enabled separately if you want interrupts for that device. some devices keep their interrupt enable bit inside the device's own register set, but external and timer interrupts have system-wide configuration registers. π€
Example:
// Enable timer 1 overflow interrupts.
timer_enable_int(_BV(TOIE1));
// Do some work...
// Disable all timer interrupts.
timer_enable_int(0);
Note β be careful when you use these functions, bestie π if you already have a different interrupt enabled, you could accidentally disable it by enabling another interrupt. no cap.
static void timer_enable_int (unsigned char ints)
#define enable_external_int(mask)
#define INTERRUPT(signame)
#define __INTR_ATTRS __used__
π Obsolete IO macros π
back in the day when AVR-GCC and AVR-LibC couldn't handle IO port access in the direct assignment form like they do now, all IO port access had to go through specific macros that eventually turned into inline assembly instructions doing the desired action. π
these macros became obsolete because reading and writing IO ports can be done by simply using the IO port name in an expression, and all bit manipulation (including on IO ports) can be done using generic C bit manipulation operators. β¨
the macros in this group simulate the historical behaviour. while they're 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. π
#define inp(port)
#define outp(val, port)
#define inb(port)
#define outb(port, val)
#define sbi(port, bit)
#define cbi(port, bit)
π Detailed Description π
this header file contains several items that used to be available in previous versions of this library, but have eventually been deprecated over time. π«Ά
#include <compat/deprecated.h>
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. periodt. π«
π Macro Definition Documentation π
π
#define cbi( port, bit)
Value:
(port) &= ~(1 << (bit))
Deprecated
Clear bit in IO port port.
π
#define enable_external_int( mask)
Value:
(__EICR = mask)
Deprecated
This macro gives access to the GIMSK register (or EIMSK register if using an AVR Mega device or GICR 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.
π
#define inb( port)
Value:
(port)
Deprecated
Read a value from an IO port port.
π
#define inp( port)
Value:
(port)
Deprecated
Read a value from an IO port port.
π
#define INTERRUPT( signame)
Value:
void signame (void) __attribute__ ((__interrupt__,__INTR_ATTRS)); \
void signame (void)
Deprecated
Introduces an interrupt handler function that runs with global interrupts initially enabled. This allows interrupt handlers to be interrupted.
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 above.
π
#define outb( port, val)
Value:
(port) = (val)
Deprecated
Write val to IO port port.
π
#define outp( val, port)
Value:
(port) = (val)
Deprecated
Write val to IO port port.
π
#define sbi( port, bit)
Value:
(port) |= (1 << (bit))
Deprecated
Set bit in IO port port.
π Function Documentation π
πΈ void timer_enable_int (unsigned char ints) [inline], [static]
Deprecated
This function modifies the timsk register. The value you pass via ints is device specific.
π Author π
Generated automatically by Doxygen for AVR-LibC from the source code.
okay bestie that's the whole deprecated_items(3avr) page π it's from AVR-LibC, Version 2.2.1. no date on the footer, just that version glow. stay deprecated-free, mwah π
β¨
π¦ where this page comes from
- ubuntu resolute: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- ubuntu stonking: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms