Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: sps30.h
- Revision:
- 4:7558ddc3c7d6
- Parent:
- 3:adeb61dd9ceb
- Child:
- 6:83ed80f27fff
diff -r adeb61dd9ceb -r 7558ddc3c7d6 sps30.h
--- a/sps30.h Tue Mar 05 07:04:37 2019 +0000
+++ b/sps30.h Wed Mar 06 02:22:52 2019 +0000
@@ -22,6 +22,8 @@
#define SPS30_CMMD_READ_SERIALNBR 0xD033
#define SPS30_CMMD_READ_ARTICLECODE 0xD025
+
+#define SPS30_STRT_MEAS_WRITE_DATA 0x0300
#define SPS30_POLYNOMIAL 0x31 // P(x) = x^8 + x^5 + x^4 + 1 = 100110p01
#define SPS30_CRC_INIT 0xff
@@ -41,7 +43,6 @@
SPSnoERROR, //all ok
SPSisReady, //ready ststus register
SPSnoAckERROR, //no I2C ACK error
- SPStimeoutERROR, //I2C timeout error
SPScrcERROR, //CRC error, any
};
@@ -73,7 +74,7 @@
*
* @return none
*/
- sps30(PinName sda, PinName scl, int i2cFrequency);
+ sps30(PinName sda, PinName scl, int i2c_frequency);
/** Destructor
*
@@ -89,7 +90,7 @@
*
* @return enum SPSerror
*/
- uint8_t startMeasurement();
+ uint8_t StartMeasurement();
/** Stop Auto-Measurement
*
@@ -97,7 +98,7 @@
*
* @return enum SPSerror
*/
- uint8_t stopMeasurement();
+ uint8_t StopMeasurement();
/** Get Ready Status register
*
@@ -106,7 +107,7 @@
*
* @return enum SPSerror
*/
- uint8_t getReadyStatus();
+ uint8_t GetReadyStatus();
/** Get all particulate matter parameters
*
@@ -115,7 +116,7 @@
*
* @return enum SPSerror
*/
- uint8_t readMeasurement();
+ uint8_t ReadMeasurement();
/** Calculate the SPS30 CRC value
*
@@ -123,7 +124,7 @@
*
* @return 8 bit CRC value
*/
- uint8_t calcCrc2b(uint16_t seed);
+ uint8_t CalcCrc2b(uint16_t seed);
/** Compare received CRC value with calculated CRC value
*
@@ -132,7 +133,7 @@
*
* @return enum SPSerror
*/
- uint8_t checkCrc2b(uint16_t seed, uint8_t crcIn);
+ uint8_t CheckCrc2b(uint16_t seed, uint8_t crc_in);
/** Get Article Code
*
@@ -141,7 +142,7 @@
*
* @return enum SPSerror
*/
- uint8_t getArticleCode();
+ uint8_t GetArticleCode();
/** Get Serial Number
*
@@ -150,7 +151,7 @@
*
* @return enum SPSerror
*/
- uint8_t getSerialNumber();
+ uint8_t GetSerialNumber();
/** Read Auto Cleaning Interval on the SPS30
*
@@ -158,7 +159,7 @@
*
* @return enum SPSerror
*/
- uint8_t readAutoCleanInterval();
+ uint8_t ReadAutoCleanInterval();
/** Set Auto Cleaning Interval on the SPS30
*
@@ -167,7 +168,7 @@
*
* @return enum SPSerror
*/
- uint8_t setAutoCleanInterval(uint32_t set_interval = 604800);
+ uint8_t SetAutoCleanInterval(uint32_t set_interval = 604800);
/** Perform manual Fan Cleaning
@@ -176,7 +177,7 @@
*
* @return enum SPSerror
*/
- uint8_t startFanClean();
+ uint8_t StartFanClean();
/** Perform a soft reset
@@ -185,10 +186,10 @@
*
* @return enum SPSerror
*/
- uint8_t softReset();
+ uint8_t SoftReset();
private:
- char i2cBuff[60];
+ char i2cbuff[60];
uint16_t clean_interval_m; /**< High order 16 bit word of Auto Clean Interval */
uint16_t clean_interval_l; /**< High order 16 bit word of Auto Clean Interval */