![]() |
ChibiOS/RT Architecture - Reference Manual - Guides |
I/O Ports Abstraction Layer macros, types and structures. More...
#include "pal_lld.h"Go to the source code of this file.
Data Structures | |
| struct | IOBus |
| I/O bus descriptor. More... | |
Defines | |
| #define | PAL_MODE_MASK 0xF |
| Bits in a mode word dedicated as mode selector. | |
| #define | PAL_MODE_RESET 0 |
| After reset state. | |
| #define | PAL_MODE_UNCONNECTED 1 |
| Safe state for unconnected pads. | |
| #define | PAL_MODE_INPUT 2 |
| Regular input high-Z pad. | |
| #define | PAL_MODE_INPUT_PULLUP 3 |
| Input pad with weak pull up resistor. | |
| #define | PAL_MODE_INPUT_PULLDOWN 4 |
| Input pad with weak pull down resistor. | |
| #define | PAL_MODE_INPUT_ANALOG 5 |
| Analog input mode. | |
| #define | PAL_MODE_OUTPUT_PUSHPULL 6 |
| Push-pull output pad. | |
| #define | PAL_MODE_OUTPUT_OPENDRAIN 7 |
| Open-drain output pad. | |
| #define | PAL_LOW 0 |
| Logical low state. | |
| #define | PAL_HIGH 1 |
| Logical high state. | |
| #define | PAL_PORT_BIT(n) ((ioportmask_t)(1 << (n))) |
| Port bit helper macro. | |
| #define | PAL_GROUP_MASK(width) ((ioportmask_t)(1 << (width)) - 1) |
| Bits group mask helper. | |
| #define | _IOBUS_DATA(name, port, width, offset) {port, PAL_GROUP_MASK(width), offset} |
| Data part of a static I/O bus initializer. | |
| #define | IOBUS_DECL(name, port, width, offset) IOBus name = _IOBUS_DATA(name, port, width, offset) |
| Static I/O bus initializer. | |
| #define | palInit(config) pal_lld_init(config) |
| PAL subsystem initialization. | |
| #define | palReadPort(port) ((void)(port), 0) |
| Reads the physical I/O port states. | |
| #define | palReadLatch(port) ((void)(port), 0) |
| Reads the output latch. | |
| #define | palWritePort(port, bits) ((void)(port), (void)(bits)) |
| Writes a bits mask on a I/O port. | |
| #define | palSetPort(port, bits) |
| Sets a bits mask on a I/O port. | |
| #define | palClearPort(port, bits) |
| Clears a bits mask on a I/O port. | |
| #define | palTogglePort(port, bits) |
| Toggles a bits mask on a I/O port. | |
| #define | palReadGroup(port, mask, offset) ((palReadPort(port) >> (offset)) & (mask)) |
| Reads a group of bits. | |
| #define | palWriteGroup(port, mask, offset, bits) |
| Writes a group of bits. | |
| #define | palSetGroupMode(port, mask, mode) |
| Pads group mode setup. | |
| #define | palReadPad(port, pad) ((palReadPort(port) >> (pad)) & 1) |
| Reads an input pad logical state. | |
| #define | palWritePad(port, pad, bit) |
| Writes a logical state on an output pad. | |
| #define | palSetPad(port, pad) palSetPort(port, PAL_PORT_BIT(pad)) |
Sets a pad logical state to PAL_HIGH. | |
| #define | palClearPad(port, pad) palClearPort(port, PAL_PORT_BIT(pad)) |
Clears a pad logical state to PAL_LOW. | |
| #define | palTogglePad(port, pad) palTogglePort(port, PAL_PORT_BIT(pad)) |
| Toggles a pad logical state. | |
| #define | palSetPadMode(port, pad, mode) palSetGroupMode(port, PAL_PORT_BIT(pad), mode) |
| Pad mode setup. | |
Functions | |
| ioportmask_t | palReadBus (IOBus *bus) |
| Read from an I/O bus. | |
| void | palWriteBus (IOBus *bus, ioportmask_t bits) |
| Write to an I/O bus. | |
| void | palSetBusMode (IOBus *bus, uint_fast8_t mode) |
| Programs a bus with the specified mode. | |
I/O Ports Abstraction Layer macros, types and structures.
Definition in file pal.h.
1.7.1