Skip to content

HydraFW binary PIN mode guide

Baldanos edited this page Mar 14, 2016 · 8 revisions

#HydraFW binary PIN mode guide

This guide is updated towards development firmware

This mode allows to freely control the HydraBus pins PA0 to PA7.

##Commands Once the PIN mode has been selected, the following commands are available :

  • 0b00000000 Return to main mode. Returns BBIO1
  • 0b00000010 Read the pins status
  • 0b00000011 Set the pin mode
  • 0b00000100 Disables pulls on selected pins
  • 0b00000101 Set the pullup on selected pins
  • 0b00000110 Set the pulldown on selected pins
  • 0b00001000 Set the pin values

##Command details ###Read pins (0b00000010) Once the command has been issued, Hydrabus will send a status byte (0x01 if success, 0x00 otherwise) and the corresponding status of each pin. LSB is always pin PA0.

###Set pin mode (0b00000011) This command must be followed by 1 byte, representing the mode for each pin. (LSB is PA0). The mode is either 0 for output or 1 for input.

For instance, the command 0x00000011 0b00001111 sets the pins PA0 to PA3 in input mode, and pins PA4 to PA7 to output mode.

This command returns 0x01 if successful, 0x00 in case of error.

###Pullup commands All these commands allow to set the pullups on each pins individually. If multiple commands are issued on the same pin, only the last one will be used.

####Disable pulls(0b00000100) This command must be followed by 1 byte, representing the status for each pin. (LSB is PA0). Set the corresponding bit to 1 to disable the pulls on the pin.

This command returns 0x01 if successful, 0x00 in case of error.

####Set pullup(0b00000101) This command must be followed by 1 byte, representing the status for each pin. (LSB is PA0). Set the corresponding bit to 1 to enable the pullup on the pin.

This command returns 0x01 if successful, 0x00 in case of error.

####Set pulldown(0b00000110) This command must be followed by 1 byte, representing the status for each pin. (LSB is PA0). Set the corresponding bit to 1 to enable the pulldown on the pin.

This command returns 0x01 if successful, 0x00 in case of error.

###Set pin (0b00001000) This command must be followed by 1 byte, representing the mode for each pin. (LSB is PA0). The corresponding bit value will be written on the pin for each putput pin. Obviously, setting any value on an input port will have no effect.

This command returns 0x01 if successful, 0x00 in case of error.

How to Flash/Use HydraFW

How to Build/Flash/Use HydraFW

Developer Getting-Started with HydraBus and STM32CubeIDE

Hardware

Firmware (hydrafw) performances

Firmware (hydrafw) Application guides

Firmware (hydrafw) guides

How to Help

Clone this wiki locally