simple CCS811 driver
Dependencies: AMS_ENS210_temp_humid_sensor
Dependents: TBSense2_Sensor_Demo
Fork of AMS_CCS811_gas_sensor by
Diff: AMS_CCS811.h
- Revision:
- 4:a6b8881eae87
- Parent:
- 2:e394671ef5f6
- Child:
- 5:41e97348e9e7
--- a/AMS_CCS811.h Thu Jan 19 13:25:08 2017 +0000 +++ b/AMS_CCS811.h Thu Jan 19 14:27:44 2017 +0000 @@ -81,6 +81,51 @@ * @return Intalisation success */ bool init(); + + /** Set the I2C interface + * + * @param i2c The I2C interface to use for communication + * + * @return Write success + */ + void i2c_interface(I2C * i2c); + + /** Set the ENS210 I2C interface + * + * @param i2c The I2C interface for an attached AMS_ENS210 + * + * @return Write success + */ + void ens210_i2c_interface(I2C * i2c); + + /** Set whether the attached AMS_ENS210 is enabled. + * If an I2C interface is not set for the ENS210, calling this method will have no effect. + * + * @param enabled True for enabled, false for disabled + * + * @return enabled True for enabled, false for disabled + */ + bool enable_ens210(bool enable); + + /** Get whether the attached AMS_ENS210 is enabled. + * + * @return enabled True for enabled, false for disabled + * + */ + bool ens210_is_enabled(); + + /** Set the AMS_ENS210 poll interval + * + * @param poll_ms Poll interval in ms + * + */ + void ens210_poll_interval(int poll_ms); + + /** Get the AMS_ENS210 poll interval + * + * @return The poll interval in ms + */ + int ens210_poll_interval(); /** Set the operation mode \n * Note: \n When a sensor operating mode is changed to a new mode with\n @@ -256,8 +301,11 @@ int slave_addr; void update_slave_addr(); - bool _ens210_enable; + bool _ens210_enabled; int _ens210_poll_split; + void update_ens210_timer(); + Ticker _ens210_poll_t; + void ens210_isr(); OP_MODES _mode;