vbus_sensor.h 545 B

1234567891011121314151617181920
  1. #ifndef _VBUS_SENSOR_H__
  2. #define _VBUS_SENSOR_H__
  3. #define VBUS_PARTITIONING_FACTOR 0.0522f /*!< It expresses how
  4. much the Vbus is attenuated
  5. before being converted into
  6. digital value */
  7. typedef struct {
  8. float voltage_avg;
  9. int avg_count;
  10. }vbus_t;
  11. void vbus_sensor_init(void);
  12. void vbus_sample_voltage(void);
  13. float vbus_get_voltage(void);
  14. #endif /* _VBUS_SENSOR_H__ */