potentiometers.h 881 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * potentiometers.h
  3. *
  4. * Created: 04.07.2019 19:30:37
  5. * Author: Radioman
  6. */
  7. #ifndef POTENTIOMETERS_H_
  8. #define POTENTIOMETERS_H_
  9. #define ON 1
  10. #define OFF 0
  11. typedef enum { POT_SHIFT1, POT_GAIN1, POT_SHIFT2, POT_GAIN2, POT_DRIVE1, POT_DRIVE2 } potnum_t;
  12. typedef struct {
  13. uint8_t ch;
  14. float gain;
  15. float shift;
  16. float drive;
  17. } opamp_str;
  18. void POT_SendData(uint8_t data, potnum_t potnum);
  19. uint8_t SetOpampGain(uint8_t ch, float gain);
  20. uint8_t SetOpampShift(uint8_t ch, float shift);
  21. uint8_t SetDriveVoltage(uint8_t ch, float voltage);
  22. void SetInputRange(uint8_t ch, float vlow, float vhigh);
  23. void SetGainData(uint8_t ch, uint8_t data);
  24. void SetShiftData(uint8_t ch, uint8_t data);
  25. void SetDriveData(uint8_t ch, uint8_t data);
  26. void SwitchDrive(uint8_t ch, uint8_t onoff);
  27. void RestoreGainShift(uint8_t ch);
  28. #endif /* POTENTIOMETERS_H_ */