Lourdès Abou-tayeh / CCS811

Dependents:   Capteur2

Revision:
1:d0abe05bc21e
Parent:
0:2c1dce3543ae
--- a/CCS811.h	Mon Sep 06 09:17:14 2021 +0000
+++ b/CCS811.h	Mon Sep 06 11:32:22 2021 +0000
@@ -1,32 +1,11 @@
+//*****************Capteur CCS811 - qualité de l'air ***************************//
+
 #ifndef CCS811_H
 #define CCS811_H
 
 //CCS811 register define
-#define CCS811_I2C_ADDR                 0xB6    //This is already left shifted 0x5B, if using other address, should be 0xB4 which is 0x5A left shifted.
-#define CCS811_REG_STATUS               0x00    //Status.
-#define CCS811_REG_MEAS_MODE            0x01    //Mesurement mode and conditions register.
-#define CCS811_REG_ALG_RESULT_DATA      0x02    //Algorithm result. 2 bytes co2 ppm next 2 bytes ppb VOC level.
-#define CCS811_REG_RAW_DATA             0x03    //Raw ADC data.
-#define CCS811_REG_ENV_DATA             0x05    //Temperature and humidity data can be write to enavle compensation.
-#define CCS811_REG_NTC                  0x06    //Provides the voltage across the reference registor and the voltage across the NTC resistor.
-#define CCS811_REG_THRESHOLDS           0x10    //Thresholds for operation when interrupts are only generated when eCO2 ppm crosses a threshold.
-#define CCS811_REG_BASELINE             0x11    //The encoded current baseline value can be read.A previously saved encoded baseline can be written.
-#define CCS811_REG_HW_ID                0x20    //Hardware ID. The value is 0x81.
-#define CCS811_REG_HW_VERSION           0x21    //Hardware version. The value is 0x1X.
-#define CCS811_REG_BOOT_VERSION         0x23    //Firmware boot version. The First 2 bytes contain the firmware version number for the boot code.
-#define CCS811_REG_APP_VERSION          0x24    //Firmware application version. The first 2 bytes contain the firmware version number for the application code.
-#define CCS811_REG_ERROR_ID             0xE0    //Error ID. When the status register reports and error its source is lcated in this register.
-#define CCS811_REG_APP_START            0xF4    //Application start. Used to transition the CCS811 state from boot to application mode, a write with no data is required. Before performing a write to APP_START the Status register should be accessed to check if there is a valid application present.
-#define CCS811_REG_SW_RESET             0xFF    //If the correct 4 byres (0x11, 0xE5, 0x72, 0x8A)are written to this register in a single sequence the device will reset and return to BOOT bode.
- 
-//mode setting
-#define CCS811_MEASUREMENT_MODE0        0x00    //Idle(Measurements are disabled in this mode).
-#define CCS811_MEASUREMENT_MODE1        0x10    //Constant power mode, IAQ measurement every second.
-#define CCS811_MEASUREMENT_MODE2        0x20    //Pulse heating mode IAQ measurement every 10 seconds.
-
-//CCS811 register define
-#define CCS811_I2C_ADDR                 0xB6    //This is already left shifted 0x5B, if using other address, should be 0xB4 which is 0x5A left shifted.
-#define CCS811_REG_STATUS               0x00    //Status.
+#define CCS811_I2C_ADDR                 0xB6    //Décalage adresse I2C de CCS811 (adresse 0x5B)
+#define CCS811_REG_STATUS               0x00    //Status
 #define CCS811_REG_MEAS_MODE            0x01    //Mesurement mode and conditions register.
 #define CCS811_REG_ALG_RESULT_DATA      0x02    //Algorithm result. 2 bytes co2 ppm next 2 bytes ppb VOC level.
 #define CCS811_REG_RAW_DATA             0x03    //Raw ADC data.
@@ -68,7 +47,6 @@
         bool readerror();
     protected:
         I2C _i2c;
-    private:
 };