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.
Dependencies: aconno_I2C Lis2dh12 WatchdogTimer
SI7060.h@25:7adeb1a53360, 2018-12-23 (annotated)
- Committer:
- pathfindr
- Date:
- Sun Dec 23 20:24:34 2018 +0000
- Revision:
- 25:7adeb1a53360
- Parent:
- 11:60eb0ff945f2
- Child:
- 34:4493c9f6d707
gfg
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pathfindr | 11:60eb0ff945f2 | 1 | #ifndef SI7060_H |
| pathfindr | 11:60eb0ff945f2 | 2 | #define SI7060_H |
| pathfindr | 11:60eb0ff945f2 | 3 | |
| pathfindr | 11:60eb0ff945f2 | 4 | #include "main.h" |
| pathfindr | 11:60eb0ff945f2 | 5 | |
| pathfindr | 11:60eb0ff945f2 | 6 | namespace mbed { |
| pathfindr | 11:60eb0ff945f2 | 7 | |
| pathfindr | 11:60eb0ff945f2 | 8 | #define I2C_ADDRESS_SI7060_00 0x30 |
| pathfindr | 11:60eb0ff945f2 | 9 | #define I2C_ADDRESS_SI7060_01 0x31 |
| pathfindr | 11:60eb0ff945f2 | 10 | #define I2C_ADDRESS_SI7060_02 0x32 |
| pathfindr | 11:60eb0ff945f2 | 11 | #define I2C_ADDRESS_SI7060_03 0x33 |
| pathfindr | 11:60eb0ff945f2 | 12 | #define CMD_SI7060_ID 0xC0 |
| pathfindr | 11:60eb0ff945f2 | 13 | #define CMD_SI7060_Dspsigm 0xC1 |
| pathfindr | 11:60eb0ff945f2 | 14 | #define CMD_SI7060_Dspsigl 0xC2 |
| pathfindr | 11:60eb0ff945f2 | 15 | #define CMD_SI7060_meas 0xC4 |
| pathfindr | 11:60eb0ff945f2 | 16 | #define CMD_SI7060_sw_op 0xC6 |
| pathfindr | 11:60eb0ff945f2 | 17 | #define CMD_SI7060_sw_hyst 0xC7 |
| pathfindr | 11:60eb0ff945f2 | 18 | |
| pathfindr | 11:60eb0ff945f2 | 19 | class SI7060 |
| pathfindr | 11:60eb0ff945f2 | 20 | { |
| pathfindr | 11:60eb0ff945f2 | 21 | public: |
| pathfindr | 11:60eb0ff945f2 | 22 | SI7060(PinName sda, PinName scl); |
| pathfindr | 11:60eb0ff945f2 | 23 | ~SI7060(); |
| pathfindr | 11:60eb0ff945f2 | 24 | |
| pathfindr | 11:60eb0ff945f2 | 25 | //funcs |
| pathfindr | 11:60eb0ff945f2 | 26 | char readValue(uint8_t registerAdd); |
| pathfindr | 11:60eb0ff945f2 | 27 | void writeValue(uint8_t registerAdd, uint8_t value); |
| pathfindr | 25:7adeb1a53360 | 28 | void prepare(void); |
| pathfindr | 25:7adeb1a53360 | 29 | void sleep(void); |
| pathfindr | 11:60eb0ff945f2 | 30 | float getTemperature(void); |
| pathfindr | 11:60eb0ff945f2 | 31 | |
| pathfindr | 11:60eb0ff945f2 | 32 | private: |
| pathfindr | 11:60eb0ff945f2 | 33 | |
| pathfindr | 11:60eb0ff945f2 | 34 | protected: |
| pathfindr | 11:60eb0ff945f2 | 35 | I2C _i2c; |
| pathfindr | 11:60eb0ff945f2 | 36 | }; |
| pathfindr | 11:60eb0ff945f2 | 37 | |
| pathfindr | 11:60eb0ff945f2 | 38 | } //Namespace |
| pathfindr | 11:60eb0ff945f2 | 39 | #endif |