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 :
0b11000000Read auxiliary pins0b1101wxyzWrite auxiliary pins0b11100000Read auxiliary pins mode0b11110000Set auxiliary pins mode
Command details
Read auxiliary pins (0b11000000)
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
Write auxiliary pins (0b1101wxyz)
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.
Read auxiliary pins mode (0b11100000)
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
Set auxiliary pins mode (0b11110000)
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.