HWA
Bare metal programming with style
|
This class implements a group of consecutive I/O pins inside the same _gpa GPIO port. It handles not-connected pins and triggers an error if such a pin is addressed (but no error is triggered if you access the registers directly).
It supports HW_ADDRESS(), HW_BITS(), and HW_POSITION().
IOs are relatives of their port:
(porta,1)
: pin PA1(portb,4,2)
: pins PB5 PB4 PB3 PB2and have their port as relative:
((portb,1),port)
: portbSingle IO pins can be designated as relatives of the virtual pin
object:
(pin,int0)
: pin named int0(pin,1)
: pin number 1 (depends on the package of the device)Analog input pins have a did
register that disables the digital input stage:
(portb,1,0,did)
: DID logical register for PB0
hw( configure, IO, ... ) and hwa( configure, IO, ... ) configure an IO:
hw( read, IO, ... ) returns the state of the IO:
hw( write, IO, value ) and hwa( write, IO, value ) set the state of an IO:
hw( set, IO ) and hwa( set, IO ) set all the bits of the IO to 1:
hw( clear, IO ) and hwa( clear, IO ) clear all the bits of the IO:
hw( toggle, IO ) and hwa( toggle, IO ) toggle all the bits of the IO: