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.
KuADT7410.h@0:7e1b9c699bac, 2014-07-20 (annotated)
- Committer:
- kunichiko
- Date:
- Sun Jul 20 14:25:01 2014 +0000
- Revision:
- 0:7e1b9c699bac
Initial version.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kunichiko | 0:7e1b9c699bac | 1 | #ifndef KU_ADT7410_H |
kunichiko | 0:7e1b9c699bac | 2 | #define KU_ADT7410_H |
kunichiko | 0:7e1b9c699bac | 3 | |
kunichiko | 0:7e1b9c699bac | 4 | #include "mbed.h" |
kunichiko | 0:7e1b9c699bac | 5 | |
kunichiko | 0:7e1b9c699bac | 6 | /** |
kunichiko | 0:7e1b9c699bac | 7 | * A library for ADT7410 I2C connecting temperature sensor module. |
kunichiko | 0:7e1b9c699bac | 8 | */ |
kunichiko | 0:7e1b9c699bac | 9 | class KuADT7410 { |
kunichiko | 0:7e1b9c699bac | 10 | private: |
kunichiko | 0:7e1b9c699bac | 11 | I2C &i2c; |
kunichiko | 0:7e1b9c699bac | 12 | int i2c_address; |
kunichiko | 0:7e1b9c699bac | 13 | |
kunichiko | 0:7e1b9c699bac | 14 | public: |
kunichiko | 0:7e1b9c699bac | 15 | |
kunichiko | 0:7e1b9c699bac | 16 | /** |
kunichiko | 0:7e1b9c699bac | 17 | * Constractor of ADT7410 driver. |
kunichiko | 0:7e1b9c699bac | 18 | * @param i2c I2C object |
kunichiko | 0:7e1b9c699bac | 19 | * @param i2c_address Target's I2C address (LSB is used for R/W flag). |
kunichiko | 0:7e1b9c699bac | 20 | */ |
kunichiko | 0:7e1b9c699bac | 21 | explicit KuADT7410(I2C &i2c, int i2c_address = 0x48 << 1); |
kunichiko | 0:7e1b9c699bac | 22 | |
kunichiko | 0:7e1b9c699bac | 23 | /** |
kunichiko | 0:7e1b9c699bac | 24 | * Destractor |
kunichiko | 0:7e1b9c699bac | 25 | */ |
kunichiko | 0:7e1b9c699bac | 26 | ~KuADT7410(); |
kunichiko | 0:7e1b9c699bac | 27 | |
kunichiko | 0:7e1b9c699bac | 28 | /** |
kunichiko | 0:7e1b9c699bac | 29 | * Reset target device. |
kunichiko | 0:7e1b9c699bac | 30 | */ |
kunichiko | 0:7e1b9c699bac | 31 | void reset(); |
kunichiko | 0:7e1b9c699bac | 32 | |
kunichiko | 0:7e1b9c699bac | 33 | /** |
kunichiko | 0:7e1b9c699bac | 34 | * Get temperature |
kunichiko | 0:7e1b9c699bac | 35 | */ |
kunichiko | 0:7e1b9c699bac | 36 | float get_temp(); |
kunichiko | 0:7e1b9c699bac | 37 | |
kunichiko | 0:7e1b9c699bac | 38 | /** |
kunichiko | 0:7e1b9c699bac | 39 | * Get status |
kunichiko | 0:7e1b9c699bac | 40 | */ |
kunichiko | 0:7e1b9c699bac | 41 | unsigned char get_status(); |
kunichiko | 0:7e1b9c699bac | 42 | }; |
kunichiko | 0:7e1b9c699bac | 43 | |
kunichiko | 0:7e1b9c699bac | 44 | #endif |