IUT CACHAN
/
DS18B20
Test DS18B20 sur D8
DS18B20.h@1:7bf2fdef45c9, 2021-06-21 (annotated)
- Committer:
- iut_cachan01
- Date:
- Mon Jun 21 09:55:09 2021 +0000
- Revision:
- 1:7bf2fdef45c9
- Parent:
- 0:03ec282c2908
Test DS18B20 sur D8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
feabhas | 0:03ec282c2908 | 1 | #ifndef _DS18B20_ |
feabhas | 0:03ec282c2908 | 2 | #define _DS18B20_ |
feabhas | 0:03ec282c2908 | 3 | |
feabhas | 0:03ec282c2908 | 4 | #include <stdint.h> |
feabhas | 0:03ec282c2908 | 5 | #include "mbed.h" |
feabhas | 0:03ec282c2908 | 6 | |
feabhas | 0:03ec282c2908 | 7 | // Device Faimly ID and Setial number information |
feabhas | 0:03ec282c2908 | 8 | typedef union { |
feabhas | 0:03ec282c2908 | 9 | uint8_t rom[8]; |
feabhas | 0:03ec282c2908 | 10 | struct { |
feabhas | 0:03ec282c2908 | 11 | uint8_t familyCode; |
feabhas | 0:03ec282c2908 | 12 | uint8_t serialNo[6]; |
iut_cachan01 | 1:7bf2fdef45c9 | 13 | uint8_t crc; |
feabhas | 0:03ec282c2908 | 14 | } BYTES; |
feabhas | 0:03ec282c2908 | 15 | } ROM_Code_t; |
feabhas | 0:03ec282c2908 | 16 | |
feabhas | 0:03ec282c2908 | 17 | ROM_Code_t ReadROM() ; |
feabhas | 0:03ec282c2908 | 18 | |
feabhas | 0:03ec282c2908 | 19 | // temperature is store as 7.4 fixed point format (assuming 12 bit conversion) |
feabhas | 0:03ec282c2908 | 20 | void displayTemperature(Serial& s) ; |
feabhas | 0:03ec282c2908 | 21 | |
feabhas | 0:03ec282c2908 | 22 | #endif |