Open FFBoard
Open source force feedback firmware
voltagesense.h
Go to the documentation of this file.
1/*
2 * voltagesense.h
3 *
4 * Created on: Feb 1, 2020
5 * Author: Yannick
6 */
7
8#ifndef VOLTAGESENSE_H_
9#define VOLTAGESENSE_H_
10#include "target_constants.h"
11
12int32_t getIntV();
13int32_t getExtV();
14void brakeCheck();
15
16/*
17 * Multiplier to convert ADC counts to a sensed voltage on the vInt and vExt pins.
18 */
19void setVSenseMult(float vSenseMultiplier);
20
21/*
22 * vMax: maximum voltage where the brake pin goes always high
23 * vdiffAct: difference between vInt and vExt to activate brake pin
24 * vdiffDeact: difference when to deactivate brake pin again (must be lower than vdiffAct)
25 * Set vMax = 0 to completely deactivate the brake resistor function. DANGEROUS
26 *
27 */
28void setupBrakePin(uint32_t vdiffAct,int32_t vdiffDeact,int32_t vMax);
29
34float adcValToVoltage(uint32_t adcval);
35
40int32_t getChipTemp();
41
42#endif /* VOLTAGESENSE_H_ */
void brakeCheck()
int32_t getChipTemp()
int32_t getIntV()
void setupBrakePin(uint32_t vdiffAct, int32_t vdiffDeact, int32_t vMax)
float adcValToVoltage(uint32_t adcval)
int32_t getExtV()
void setVSenseMult(float vSenseMultiplier)