Dependents: Bulme-Timer Mbed-21-Clock-to-7Segment WS_7_Seg_mit_LM1635 WS_7_Seg_mit_LM1635 ... more
Fork of PCF8563 by
PCF8563.h
- Committer:
- fpucher
- Date:
- 2016-03-11
- Revision:
- 1:43c0cae8d6b0
- Child:
- 2:39c99dbc6368
File content as of revision 1:43c0cae8d6b0:
/*********************************** name: rtc.h Version: 0.1 author: PE HTL BULME email: pe@bulme.at description: Definition portion of the class rtc ***********************************/ #include "mbed.h" #include "const.h" #if !defined (PCF8563_H) #define PCF8563_H /** PCF8563 Class */ /** name: rtc.h Version: 0.1 author: PE HTL BULME email: pe@bulme.at description: Definition portion of the class rtc ***********************************/ class PCF8563 { protected: //PinName _sda, _scl; I2C i2c; /**< I2C definition */ char week_val; /** protected methodes for internal purposes only */ void error(); /**< Error: stops and all LEDs are blinking*/ public: /** Create a RTC object connected to the specified pin * @param pin sda/scl pin to connect to */ PCF8563(); /**< default constructor; sda(p28), sdc(p27) */ PCF8563(PinName sda, PinName scl); /**< parameterized constructor with sda-pin, sdc-pin)*/ ~PCF8563(); char read(char address); /**< read value from I2C bus; ToDo --> Error()*/ void write(char address, char value); /**< write value to I2C bus; ToDo --> Error()*/ void init(); /**< initialize the RTC to a given date and time; ToDo --> Error()*/ void alarm(); }; #endif