hsk_libs-dev  163:b63ae088cc97
High Speed Karlsruhe XC878 library collection
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
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   -1
 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

#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
#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
#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
#define IO_PORT_ON_HIGH   -1

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

Note
Can also be used for Output Port Access