Module pin - Procs for low-level digital manipulation of pins on any ATmega

Procs for low-level digital manipulation of pins on any ATmega. PROCs in this module take registers for direction (DDRn), pin (PINn) and port (PORTn) to manipulate digital pins on ATmega processors.

Index

Declarations

pin.module:37Process pin.write

INLINE PROC pin.write (VAL INT r.port, bit, state)

Sets the state of a pin to either HIGH or LOW.

Typically, no user is going to directly call this PROC. The process of locating r.port is taken care of in the Architecture-specific chipmap.module.

Parameters:

VAL INT r.port The port (PORTB, PORTC, etc.) on the ATmega
VAL INT bit The bit in the port (0 - 7)
VAL INT state Either HIGH or LOW

pin.module:55Process pin.read

INLINE PROC pin.read (VAL INT r.pin, bit, RESULT INT state)

Reads the state of a PIN register. Either HIGH or LOW.

Typically, no user is going to directly call this PROC. The process of locating r.pin is taken care of in the Architecture-specific chipmap.module.

Parameters:

VAL INT r.pin A pin register (PINA, PINB)
VAL INT bit The bit in the port
RESULT INT state The state of the bit (HIGH or LOW)

pin.module:72Process pin.mode

INLINE PROC pin.mode (VAL INT r.ddr, bit, mode)

Sets the direction of the pin (INPUT or OUTPUT)

Typically, no user is going to directly call this PROC. The process of locating r.ddr is taken care of in the Architecture-specific chipmap.module.

Parameters:

VAL INT r.ddr The data direction register (DDRA, etc.)
VAL INT bit The bit in the register
VAL INT mode Either INPUT or OUTPUT