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

This group contains macros and defines to initialize port pins for output and safely set output states. More...

Macros

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

Detailed Description

This group contains macros and defines to initialize port pins for output and safely set output states.

Macro Definition Documentation

§ IO_PORT_DRAIN_DISABLE

#define IO_PORT_DRAIN_DISABLE   0

Bit mask to disable drain mode for all selected pins.

§ IO_PORT_DRAIN_ENABLE

#define IO_PORT_DRAIN_ENABLE   0xff

Bit mask to enable drain mode for all selected pins.

§ IO_PORT_OUT_INIT

#define IO_PORT_OUT_INIT (   port,
  pins,
  strength,
  drain,
  on,
  set 
)
Value:
{ \
port##_DIR |= pins; \
SFR_PAGE(_pp3, noSST); \
port##_OD &= (drain) | ~(pins); \
port##_OD |= (drain) & (pins); \
port##_DS &= (strength) | ~(pins); \
port##_DS |= (strength) & (pins); \
SFR_PAGE(_pp0, noSST); \
port##_DATA &= ((set) ^ ~(on)) | ~(pins); \
port##_DATA |= ((set) ^ ~(on)) & (pins); \
}

Initializes a set of port pins as outputs.

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
strengthA bit mask of pins with strong drive strength
drainA bit mask of pins that only drive GND
onA bit mask of pins that defines the states which represent on
See also
IO_PORT_ON_GND
IO_PORT_ON_HIGH
Parameters
setInitial logical values for the defined outputs

§ IO_PORT_OUT_SET

#define IO_PORT_OUT_SET (   port,
  pins,
  on,
  set 
)
Value:
{\
port##_DATA &= ((set) ^ ~(on)) | ~(pins); \
port##_DATA |= ((set) ^ ~(on)) & (pins); \
}

Set a set of output port pins.

Warning
Expects port page 0 and RMAP 0, take care in ISRs
Parameters
portThe parallel port to set
pinsA bit mask of the pins to select
onA bit mask of pins that defines the states which represent on
See also
IO_PORT_ON_GND
IO_PORT_ON_HIGH
Parameters
setSet logical values for the defined outputs

§ IO_PORT_STRENGTH_STRONG

#define IO_PORT_STRENGTH_STRONG   0xff

Bit mask to set strong drive strength for all selected pins.

§ IO_PORT_STRENGTH_WEAK

#define IO_PORT_STRENGTH_WEAK   0

Bit mask to set weak drive strength for all selected pins.