potentiometer.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #ifndef POTENTIOMETER_H
  2. #define POTENTIOMETER_H
  3. #include "pci.h"
  4. #define TPL0202_CMD_BITP 12
  5. #define TPL0202_CMD_BITM (0x3 << TPL0202_CMD_BITP)
  6. #define TPL0202_CMD_WR_WIPER_REG_ENUM 0x0
  7. #define TPL0202_CMD_WR_NV_REG_ENUM 0x1
  8. #define TPL0202_CMD_COPY_WIPER_TO_NV_ENUM 0x2
  9. #define TPL0202_CMD_COPY_NV_TO_WIPER_ENUM 0x3
  10. #define TPL0202_ADR_BITP 8
  11. #define TPL0202_ADR_BITM (0x3<<TPL0202_ADR_BITP)
  12. #define TPL0202_ADR_A_ENUM 0x1
  13. #define TPL0202_ADR_B_ENUM 0x2
  14. #define TPL0202_ADR_AB_ENUM 0x3
  15. #define TPL0202_DATA_BITP 0
  16. #define TPL0202_DATA_BITM (0xFF<<TPL0202_DATA_BITP)
  17. extern uint32_t pot_array [2];
  18. void potentiometer_set(reg_addr_pci* pci_bar_1, uint8_t pot_val_ch_a, uint8_t pot_val_ch_b);
  19. void potentiometer_set_qspi(uint8_t pot_offset, uint8_t pot_slope);
  20. void potentiometer_set_offset(reg_addr_pci* pci_bar_1, uint8_t pot_offset);
  21. void potentiometer_set_slope(reg_addr_pci* pci_bar_1, uint8_t pot_slope);
  22. #endif //POTENTIOMETER_H