hsk-libs-dev  270
High Speed Karlsruhe XC878 library collection
Macros
Input Port Access

This group contains defines and macros to initialize port pins as inputs and read them. More...

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...
 

Detailed Description

This group contains defines and macros to initialize port pins as inputs and read them.

Macro Definition Documentation

§ IO_PORT_GET

#define IO_PORT_GET (   port,
  pins,
  on 
)
Value:
( \
(port##_DATA ^ ~(on)) & (pins) \
)

Evaluates to a bit mask of logical pin states of a port.

Note
Can also be used for Output Port Access
Warning
Expects port page 0 and RMAP 0, take care in ISRs
Parameters
portThe parallel port to access
pinsA bit mask of the pins to select
onA bit mask of pins that defines the states which represent on

§ IO_PORT_IN_INIT

#define IO_PORT_IN_INIT (   port,
  pins 
)
Value:
{ \
port##_DIR &= ~(pins); \
}

Initializes a set of port pins as inputs.

Warning
Expects port page 0 and RMAP 0, take care in ISRs
Parameters
portThe parallel port to configure
pinsA bit mask of the pins to select

§ IO_PORT_ON_GND

#define IO_PORT_ON_GND   0

Bit mask to set the logical 1 to GND level for all selected pins.

Note
Can also be used for Output Port Access

§ IO_PORT_ON_HIGH

#define IO_PORT_ON_HIGH   0xff

Bit mask to set the logical 1 to high level for all selected pins.

Note
Can also be used for Output Port Access