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