mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
Split BitBangI2C library into I2C and RTC
This commit is contained in:
parent
81624f6d5e
commit
5819690b42
@ -24,6 +24,7 @@
|
|||||||
#include <FreetronicsLCD.h>
|
#include <FreetronicsLCD.h>
|
||||||
#include <Form.h>
|
#include <Form.h>
|
||||||
#include <Field.h>
|
#include <Field.h>
|
||||||
|
#include <BitBangI2C.h>
|
||||||
#include <DS1307RTC.h>
|
#include <DS1307RTC.h>
|
||||||
#include <Melody.h>
|
#include <Melody.h>
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ WARN_LOGFILE =
|
|||||||
# directories like "/usr/src/myproject". Separate the files or directories
|
# directories like "/usr/src/myproject". Separate the files or directories
|
||||||
# with spaces.
|
# with spaces.
|
||||||
|
|
||||||
INPUT = ../libraries/FreetronicsLCD ../libraries/BlinkLED ../libraries/BitBangI2C ../libraries/Melody .
|
INPUT = ../libraries/FreetronicsLCD ../libraries/BlinkLED ../libraries/I2C ../libraries/RTC ../libraries/Melody .
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||||
|
@ -34,7 +34,6 @@ LCD shield.
|
|||||||
\li Form and Field classes to build simple property sheet UI's on LCD displays.
|
\li Form and Field classes to build simple property sheet UI's on LCD displays.
|
||||||
\li \ref lcd_hello_world "Hello World" example for the Freetronics LCD shield.
|
\li \ref lcd_hello_world "Hello World" example for the Freetronics LCD shield.
|
||||||
\li \ref lcd_form "Form" example for LCD displays.
|
\li \ref lcd_form "Form" example for LCD displays.
|
||||||
\li \ref alarm_clock "Wind-Up Alarm Clock".
|
|
||||||
|
|
||||||
\section main_BlinkLED BlinkLED Utility Library
|
\section main_BlinkLED BlinkLED Utility Library
|
||||||
|
|
||||||
@ -48,4 +47,27 @@ the Cylon eye effect from Battlestar Galactica.
|
|||||||
\li \ref blink_startrek "StarTrek" example for lighting a starship
|
\li \ref blink_startrek "StarTrek" example for lighting a starship
|
||||||
Enterprise model kit.
|
Enterprise model kit.
|
||||||
|
|
||||||
|
\section main_I2C I2C Utility Library
|
||||||
|
|
||||||
|
\li I2CMaster abstract class that provides an improved API for implementing an
|
||||||
|
I2C master. The following two classes inherit from I2CMaster:
|
||||||
|
\li BitBangI2C class that implements the master side of the I2C protocol
|
||||||
|
using "bit-banging" on any arbitrary pair of pins for DATA and CLOCK.
|
||||||
|
This class supports both 7-bit and 10-bit I2C addresses.
|
||||||
|
\li WireI2C class that uses the Arduino Wire library to implement the
|
||||||
|
master side of the I2C protocol. This class only supports 7-bit addresses
|
||||||
|
and runs on predefined DATA and CLOCK pins (A4 and A5 on most boards,
|
||||||
|
D20 and D21 for Arduino Mega).
|
||||||
|
|
||||||
|
\section main_RTC Realtime Clock Library
|
||||||
|
|
||||||
|
\li RTC class that acts as a base for all realtime clock implementations,
|
||||||
|
including support for configuring alarms and storing clock settings.
|
||||||
|
The default implementation simulates the time and date based on the value of
|
||||||
|
<tt>millis()</tt>.
|
||||||
|
\li DS1307RTC class that talks to the DS1307 realtime clock chip via I2C.
|
||||||
|
\li \ref alarm_clock "Wind-Up Alarm Clock" example that uses the DS1307
|
||||||
|
realtime clock and the FreetronicsLCD library to implement an alarm clock
|
||||||
|
where the internal battery is charged by hand-cranking a dynamo.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
8
libraries/I2C/keywords.txt
Normal file
8
libraries/I2C/keywords.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
BitBangI2C KEYWORD1
|
||||||
|
|
||||||
|
start KEYWORD2
|
||||||
|
stop KEYWORD2
|
||||||
|
startRead KEYWORD2
|
||||||
|
startWrite KEYWORD2
|
||||||
|
read KEYWORD2
|
||||||
|
write KEYWORD2
|
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "DS1307RTC.h"
|
#include "DS1307RTC.h"
|
||||||
|
#include "../I2C/BitBangI2C.h"
|
||||||
#include <WProgram.h>
|
#include <WProgram.h>
|
||||||
|
|
||||||
/**
|
/**
|
@ -24,7 +24,8 @@
|
|||||||
#define DS1307RTC_h
|
#define DS1307RTC_h
|
||||||
|
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "BitBangI2C.h"
|
|
||||||
|
class BitBangI2C;
|
||||||
|
|
||||||
class DS1307RTC : public RTC {
|
class DS1307RTC : public RTC {
|
||||||
public:
|
public:
|
@ -1,14 +1,6 @@
|
|||||||
BitBangI2C KEYWORD1
|
|
||||||
DS1307RTC KEYWORD1
|
DS1307RTC KEYWORD1
|
||||||
RTC KEYWORD1
|
RTC KEYWORD1
|
||||||
|
|
||||||
start KEYWORD2
|
|
||||||
stop KEYWORD2
|
|
||||||
startRead KEYWORD2
|
|
||||||
startWrite KEYWORD2
|
|
||||||
read KEYWORD2
|
|
||||||
write KEYWORD2
|
|
||||||
|
|
||||||
isRealTime KEYWORD2
|
isRealTime KEYWORD2
|
||||||
hasUpdates KEYWORD2
|
hasUpdates KEYWORD2
|
||||||
readTime KEYWORD2
|
readTime KEYWORD2
|
Loading…
x
Reference in New Issue
Block a user