DS1820-EM
Fork of DS1820 by
DS1820G.h@1:78f2fa466c55, 2012-12-03 (annotated)
- Committer:
- liviur2
- Date:
- Mon Dec 03 22:58:27 2012 +0000
- Revision:
- 1:78f2fa466c55
Added DS1820
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
liviur2 | 1:78f2fa466c55 | 1 | /** |
liviur2 | 1:78f2fa466c55 | 2 | * DS1820-generic class |
liviur2 | 1:78f2fa466c55 | 3 | * |
liviur2 | 1:78f2fa466c55 | 4 | * Copyright (C) 2012 |
liviur2 | 1:78f2fa466c55 | 5 | * http://bulkideas.org |
liviur2 | 1:78f2fa466c55 | 6 | */ |
liviur2 | 1:78f2fa466c55 | 7 | |
liviur2 | 1:78f2fa466c55 | 8 | #include "mbed.h" |
liviur2 | 1:78f2fa466c55 | 9 | #include <stdint.h> |
liviur2 | 1:78f2fa466c55 | 10 | |
liviur2 | 1:78f2fa466c55 | 11 | #ifndef _DS1820G_H_ |
liviur2 | 1:78f2fa466c55 | 12 | #define _DS1820G_H_ |
liviur2 | 1:78f2fa466c55 | 13 | |
liviur2 | 1:78f2fa466c55 | 14 | class DS1820G |
liviur2 | 1:78f2fa466c55 | 15 | { |
liviur2 | 1:78f2fa466c55 | 16 | /** |
liviur2 | 1:78f2fa466c55 | 17 | */ |
liviur2 | 1:78f2fa466c55 | 18 | |
liviur2 | 1:78f2fa466c55 | 19 | public: |
liviur2 | 1:78f2fa466c55 | 20 | typedef union { |
liviur2 | 1:78f2fa466c55 | 21 | uint8_t rom[8]; |
liviur2 | 1:78f2fa466c55 | 22 | struct { |
liviur2 | 1:78f2fa466c55 | 23 | uint8_t familyCode; |
liviur2 | 1:78f2fa466c55 | 24 | uint8_t serialNo[6]; |
liviur2 | 1:78f2fa466c55 | 25 | uint8_t CRC; |
liviur2 | 1:78f2fa466c55 | 26 | } BYTES; |
liviur2 | 1:78f2fa466c55 | 27 | } ROM_Code_t; |
liviur2 | 1:78f2fa466c55 | 28 | |
liviur2 | 1:78f2fa466c55 | 29 | ROM_Code_t ReadROM(); |
liviur2 | 1:78f2fa466c55 | 30 | |
liviur2 | 1:78f2fa466c55 | 31 | |
liviur2 | 1:78f2fa466c55 | 32 | |
liviur2 | 1:78f2fa466c55 | 33 | private: |
liviur2 | 1:78f2fa466c55 | 34 | |
liviur2 | 1:78f2fa466c55 | 35 | |
liviur2 | 1:78f2fa466c55 | 36 | }; |
liviur2 | 1:78f2fa466c55 | 37 | |
liviur2 | 1:78f2fa466c55 | 38 | #endif |