vbus_sensor.h 568 B

123456789101112131415161718192021
  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. float voltage_filted;
  10. int avg_count;
  11. }vbus_t;
  12. void vbus_sensor_init(void);
  13. void vbus_sample_voltage(void);
  14. float vbus_get_voltage(void);
  15. #endif /* _VBUS_SENSOR_H__ */