The DS1339 serial real-time clock (RTC) is a lowpower
clock/date device with two programmable timeof-day
alarms and a programmable square-wave
output. Address and data are transferred serially
through an I2C bus. etc.
Driver
If you haven’t already done that, download BH drivers and demo code like this:
git clone https://github.com/bithollow/BH
cd /BH/driver
Move to folder BH/driver/, you will find the rtc driver: ds1339.h ds1339.cpp
Demo
rtc example
Move to folder BH/demo/rtc, compile and run the example
cd BH/demo/rtc
make
./rtc -h
the usage will show while executing above command.