Franz Pucher / PCF8563
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PCF8563.h Source File

PCF8563.h

00001 /***********************************
00002 name:   PCF8563.h      Version: 0.3
00003 author: PE HTL BULME
00004 email:  pe@bulme.at
00005 description:
00006     Definition portion of the class rtc
00007 
00008 
00009 ***********************************/
00010 
00011 #include "mbed.h"
00012 #include "const.h"
00013 
00014 #if !defined (PCF8563_H)
00015 #define PCF8563_H
00016 
00017 /** PCF8563 Class
00018  */
00019  
00020  /** 
00021 name:   rtc.h      Version: 0.1
00022 author: PE HTL BULME
00023 email:  pe@bulme.at
00024 description:
00025     Definition portion of the class rtc
00026 
00027 
00028 ***********************************/
00029 class PCF8563
00030 {
00031 protected:
00032     //PinName _sda, _scl;     
00033     I2C i2c;                    /**< I2C definition */
00034     char week_val;
00035 
00036     /**
00037     protected methodes for internal purposes only
00038     */
00039     void error();               /**< Error: stops and all LEDs are blinking*/
00040 
00041 public:
00042     /** Create a RTC object connected to the specified pin
00043     * @param pin sda/scl pin to connect to
00044     */
00045     PCF8563();                          /**< default constructor; sda(p28), sdc(p27) */
00046     PCF8563(PinName sda, PinName scl);  /**< parameterized constructor with sda-pin, sdc-pin)*/
00047     ~PCF8563();
00048     char read(char address);    /**< read value from I2C bus; ToDo --> Error()*/ 
00049     void write(char address, char value);   /**< write value to I2C bus; ToDo --> Error()*/ 
00050     void init();                /**< initialize the RTC to a given date and time; ToDo --> Error()*/ 
00051     void alarm();
00052 };
00053 
00054 #endif