Auxiliary pins - hydrabus/hydrafw GitHub Wiki
HydraFW binary Auxiliary pins guide
This guide is updated towards firmware release HydraFW v0.10 and later
In all supported modes, the following binary commands allow to interact with 4 auxiliary pins that can be used as input or output.
The pins are PC4
, PC5
, PC6
and PC7
Commands
Once the PIN mode has been selected, the following commands are available :
0b11000000
Read auxiliary pins0b1101wxyz
Write auxiliary pins0b11100000
Read auxiliary pins mode0b11110000
Set auxiliary pins mode
Command details
0b11000000
)
Read auxiliary pins (This command returns one byte containing the value of the four auxiliary pins in the last 4 bits.
Format :
MSB 1 2 3 4 5 6 7 8 LSB
|------|------|------|------|------|------|------|------|
- - - - PC7 PC6 PC5 PC4
0b1101wxyz
)
Write auxiliary pins (This command sets the auxiliary pins to the value set in each bit :
- w : PC7
- x : PC6
- y : PC5
- z : PC4
This command returns 0x01
if successful, 0x00
in case of error.
0b11100000
)
Read auxiliary pins mode (This command returns one byte containing the current auxiliary pin configuration. Format :
MSB 1 2 3 4 5 6 7 8 LSB
|------|------|------|------|------|------|------|------|
Pullup Pullup Pullup Pullup IN/OUT IN/OUT IN/OUT IN/OUT
PC7 PC6 PC5 PC4 PC7 PC6 PC5 PC4
Pullup : 0=disable 1=enable
IN/OUT : 0=output 1=input
0b11110000
)
Set auxiliary pins mode (This command must be followed by 1 byte, representing the status for each pin. Format :
MSB 1 2 3 4 5 6 7 8 LSB
|------|------|------|------|------|------|------|------|
Pullup Pullup Pullup Pullup IN/OUT IN/OUT IN/OUT IN/OUT
PC7 PC6 PC5 PC4 PC7 PC6 PC5 PC4
Pullup : 0=disable 1=enable
IN/OUT : 0=output 1=input
This command returns 0x01
if successful, 0x00
in case of error.