A1-trimpot-mcp4x.h 381 B

12345678910111213141516171819
  1. #ifndef TRIMPOT_MPC4X_H
  2. #define TRIMPOT_MPC4X_H
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. struct mcp4x {
  6. uint16_t (*get_wiper)(struct mcp4x *me, uint8_t id);
  7. bool (*set_wiper)(struct mcp4x *me, uint8_t id, uint16_t w);
  8. void (*exit)(struct mcp4x *me);
  9. uint8_t addr;
  10. int file;
  11. };
  12. /* constructor */
  13. extern struct mcp4x *mcp4x_init(uint8_t addr);
  14. #endif /* TRIMPOT_MPC4X_H */