|
hsk-libs-dev
270
High Speed Karlsruhe XC878 library collection
|
HSK I/O headers. More...
Go to the source code of this file.
Macros | |
| #define | IO_PORT_IN_INIT(port, pins) |
| Initializes a set of port pins as inputs. More... | |
| #define | IO_PORT_ON_GND 0 |
| Bit mask to set the logical 1 to GND level for all selected pins. More... | |
| #define | IO_PORT_ON_HIGH 0xff |
| Bit mask to set the logical 1 to high level for all selected pins. More... | |
| #define | IO_PORT_GET(port, pins, on) |
| Evaluates to a bit mask of logical pin states of a port. More... | |
| #define | IO_PORT_STRENGTH_WEAK 0 |
| Bit mask to set weak drive strength for all selected pins. More... | |
| #define | IO_PORT_STRENGTH_STRONG 0xff |
| Bit mask to set strong drive strength for all selected pins. More... | |
| #define | IO_PORT_DRAIN_DISABLE 0 |
| Bit mask to disable drain mode for all selected pins. More... | |
| #define | IO_PORT_DRAIN_ENABLE 0xff |
| Bit mask to enable drain mode for all selected pins. More... | |
| #define | IO_PORT_OUT_INIT(port, pins, strength, drain, on, set) |
| Initializes a set of port pins as outputs. More... | |
| #define | IO_PORT_OUT_SET(port, pins, on, set) |
| Set a set of output port pins. More... | |
| #define | IO_PORT_PULL_DISABLE 0 |
| Bit mask to disable pull up/down for all selected pins. More... | |
| #define | IO_PORT_PULL_ENABLE 0xff |
| Bit mask to enable pull up/down for all selected pins. More... | |
| #define | IO_PORT_PULL_DOWN 0 |
| Bit mask to select pull down for all selected pins. More... | |
| #define | IO_PORT_PULL_UP 0xff |
| Bit mask to select pull up for all selected pins. More... | |
| #define | IO_PORT_PULL_INIT(port, pins, pull, dir) |
| Sets the pull-up/-down properties of port pins. More... | |
| #define | IO_VAR_SET(var, bits, on, set) |
| Set a set of variable bits. More... | |
| #define | IO_VAR_GET(var, bits, on) |
| Evaluates to a bit mask of logical states of a variable. More... | |
HSK I/O headers.
This file contains macro definitions to use and initialize I/O ports and variables bitwise.
All the macros take a port and a mask to select the affected pins. All operations are masked with the selected pins so it is safe to define 0xff (every bit 1) to activate a certain property.
Set and get macros take a bit field to define the value that represents the on or true state, so the logic code can always use a 1 for true/on.
The macros are grouped as:
The device boots with all parallel ports configured as inputs. The following table lists the pins that come up with activated internal pull up:
| Port\Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| P0 | 1 | 1 | x | x | x | 1 | x | x |
| P1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| P3 | x | 1 | x | x | x | x | x | x |
| P4 | x | x | x | x | x | 1 | x | x |
| P5 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
1.8.12