|
HRI board firmware
v2.1
Microcontroller firmware of the board used during the HRI labs.
|
Driver for the digital-to-analog converter. More...
Functions | |
| void | dac_Init (void) |
| Setup a DAC with 2 channels. More... | |
| void | dac_SetVoltage1 (float32_t voltage) |
| Set the voltage of the channel 1 of the DAC. More... | |
| void | dac_SetVoltage2 (float32_t voltage) |
| Set the voltage of the channel 2 of the DAC. More... | |
| float32_t | dac_GetVoltage1 (void) |
| Get the current output voltage of the channel 1 of the DAC. More... | |
| float32_t | dac_GetVoltage2 (void) |
| Get the current output voltage of the channel 2 of the DAC. More... | |
Driver for the digital-to-analog converter.
The STM32 features a two channels DAC, which means it is able to drive two pins with an analog voltage. On the HRI board, this voltage is mulltiplied by an amplification stage, so the final output range is +-9V. The corresponding output pins are on the J1 connector: ANOUT1 (2) and ANOUT2 (4).
In the initialization code, call dac_Init() once. Then call dac_GetVoltageX() everytime the output voltage needs to be updated.
| float32_t dac_GetVoltage1 | ( | void | ) |
Get the current output voltage of the channel 1 of the DAC.
| The | current voltage of the channel 1 of the DAC [V]. |
| float32_t dac_GetVoltage2 | ( | void | ) |
Get the current output voltage of the channel 2 of the DAC.
| The | current voltage of the channel 2 of the DAC [V]. |
| void dac_Init | ( | void | ) |
Setup a DAC with 2 channels.
| void dac_SetVoltage1 | ( | float32_t | finalVoltage | ) |
Set the voltage of the channel 1 of the DAC.
| finalVoltage | the new voltage [V], between +-DAC_FINAL_RANGE (+-9V). |
| void dac_SetVoltage2 | ( | float32_t | finalVoltage | ) |
Set the voltage of the channel 2 of the DAC.
| finalVoltage | the new voltage [V], between +-DAC_FINAL_RANGE (+-9V). |
1.8.13