Skip to content

IO Module

Marco edited this page Jul 7, 2016 · 1 revision

io__sfr(_port, _pin)

Creates a temporary variable which is to be passed to all io__* functions.

This variable includes all necessary registers (DDR, PORT, PIN) to control the _pin on port _port.

io__bus(_num, LSB ... MSB)

Creates a temporary bus variable which can be passed to all io__* functions as well.

_num is the width of the bus. Take care since since only a value between 1 and 8 (maximum) is possible at the time.

The most left bit is treated as the LSB whereas the most right is treated as the MSB

uint8_t io__read(io)

Reads from the given I/O.

void io__write(io, uint8_t value)

Writes to the given I/O.

void io__setDirection(io, mode)

Configures io to be either an input or output.

Use the IO__INPUT respectively IO__OUTPUT constants for setting the mode.