class pah8011 for mbed
pixart_pah8011.h
- Committer:
- bell_huang
- Date:
- 2017-10-27
- Revision:
- 4:cbc49829af39
- Parent:
- 1:4e43ab5ba1e2
- Child:
- 5:37451de228e4
File content as of revision 4:cbc49829af39:
#ifndef __pixart_pah8011_h__ #define __pixart_pah8011_h__ #include <mbed.h> #include <cstdint> namespace pixart { class pah8011 { public: struct task_result { // ppg int32_t *data; uint32_t num_per_ch; uint32_t ch_num; // touch bool is_touched; }; public: pah8011(); ~pah8011(); bool init(I2C &i2c, Serial *serial = NULL, uint8_t slave_id = 0x15); // operations bool enable_ppg(); bool disable_ppg(); bool enable_touch(); bool disable_touch(); // tasking bool task(); bool get_result(task_result &result); private: pah8011(const pah8011&); // = delete; pah8011& operator=(const pah8011&); // = delete; bool select_mode(); private: bool m_is_ppg_enabled; bool m_is_touch_enabled; }; } #endif // header guard