oled 1.0
OLED Graphics Control Library
Loading...
Searching...
No Matches
PORT_macros.h File Reference

Macro definitions for port operations. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SET_PIN(NUMBER, ARGUMENT)
 Concatenates pin identifier components into a full pin name.
#define SET_PORT(NAME, ARGUMENT)
 Concatenates port identifier components into a full port name.

Detailed Description

Macro definitions for port operations.

This header file contains essential macros for handling port and pin names.

Note
These macros serve to improve code clarity and maintain protocol compliance by providing meaningful names for standard port operation indicators.
Author
g.raf
Date
2025-09-14
Version
1.0 Release
Note
This file is part of a larger project and subject to the license specified in the repository. For updates and the complete revision history, see the GitHub repository.
See also
https://github.com/0x007e/avr-common "AVR ATmega GitHub Repository"

Macro Definition Documentation

◆ SET_PIN

#define SET_PIN ( NUMBER,
ARGUMENT )
Value:
PIN ## NUMBER ## ARGUMENT

Concatenates pin identifier components into a full pin name.

This macro concatenates the token PIN, the given pin NUMBER, and the specified ARGUMENT to form a complete pin identifier.

For example, SET_PIN(3, _CTRL) expands to PIN3_CTRL.

This is useful for handling pin-related registers or bitfields in a flexible and generic way within embedded code.

Note
The macro uses the token-pasting operator (##), so arguments must be valid tokens suitable for concatenation.

◆ SET_PORT

#define SET_PORT ( NAME,
ARGUMENT )
Value:
PORT ## NAME ## ARGUMENT

Concatenates port identifier components into a full port name.

This macro concatenates the token PORT, the given port NAME, and the specified ARGUMENT to form a complete port identifier.

For example, SET_PORT(A, .DIR) expands to PORTA.DIR.

This is useful for handling port-related registers or bitfields in a flexible and generic way within embedded code.

Note
The macro uses the token-pasting operator (##), so arguments must be valid tokens suitable for concatenation.