Code to interface with the MCP7940 Real time clock. Supports getting and setting the time in 24 hour format
MCP7490.h@0:36c08b11e691, 2015-06-19 (annotated)
- Committer:
- MichaelW
- Date:
- Fri Jun 19 15:33:03 2015 +0000
- Revision:
- 0:36c08b11e691
InitialCommit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MichaelW | 0:36c08b11e691 | 1 | #ifndef __MCP7490_H__ |
MichaelW | 0:36c08b11e691 | 2 | #define __MCP7490_H__ |
MichaelW | 0:36c08b11e691 | 3 | |
MichaelW | 0:36c08b11e691 | 4 | #include "mbed.h" |
MichaelW | 0:36c08b11e691 | 5 | |
MichaelW | 0:36c08b11e691 | 6 | class MCP7490{ |
MichaelW | 0:36c08b11e691 | 7 | public: |
MichaelW | 0:36c08b11e691 | 8 | MCP7490(PinName sda, PinName scl); |
MichaelW | 0:36c08b11e691 | 9 | MCP7490(); |
MichaelW | 0:36c08b11e691 | 10 | |
MichaelW | 0:36c08b11e691 | 11 | int getTime(); |
MichaelW | 0:36c08b11e691 | 12 | |
MichaelW | 0:36c08b11e691 | 13 | int Day(); |
MichaelW | 0:36c08b11e691 | 14 | int Month(); |
MichaelW | 0:36c08b11e691 | 15 | int Year(); |
MichaelW | 0:36c08b11e691 | 16 | int Hour(); |
MichaelW | 0:36c08b11e691 | 17 | int Minutes(); |
MichaelW | 0:36c08b11e691 | 18 | int Seconds(); |
MichaelW | 0:36c08b11e691 | 19 | int MilliSeconds(); |
MichaelW | 0:36c08b11e691 | 20 | |
MichaelW | 0:36c08b11e691 | 21 | |
MichaelW | 0:36c08b11e691 | 22 | private: |
MichaelW | 0:36c08b11e691 | 23 | int _Day; |
MichaelW | 0:36c08b11e691 | 24 | int _Month; |
MichaelW | 0:36c08b11e691 | 25 | int _Year; |
MichaelW | 0:36c08b11e691 | 26 | int _Hour; |
MichaelW | 0:36c08b11e691 | 27 | int _Minutes; |
MichaelW | 0:36c08b11e691 | 28 | int _Seconds; |
MichaelW | 0:36c08b11e691 | 29 | int _MilliSeconds; |
MichaelW | 0:36c08b11e691 | 30 | |
MichaelW | 0:36c08b11e691 | 31 | |
MichaelW | 0:36c08b11e691 | 32 | }; |
MichaelW | 0:36c08b11e691 | 33 | |
MichaelW | 0:36c08b11e691 | 34 | |
MichaelW | 0:36c08b11e691 | 35 | #endif |