“RTC DS1307 DS3231库”的版本间的差异
来自YFRobotwiki
| (未显示2个用户的16个中间版本) | |||
| 第3行: | 第3行: | ||
{| border="0" cellpadding="10" width="100%" | {| border="0" cellpadding="10" width="100%" | ||
|- | |- | ||
| − | |width=" | + | |width="90%" valign="top" align="left"| |
RTC_DS1307_DS3231库 -- arduino实时时钟库(已支持ESP8266) | RTC_DS1307_DS3231库 -- arduino实时时钟库(已支持ESP8266) | ||
| + | |||
GITHUB 工程地址:[https://github.com/Makuna/Rtc RTC by Makuna] | GITHUB 工程地址:[https://github.com/Makuna/Rtc RTC by Makuna] | ||
| + | |||
| + | 本地下载地址:[http://www.yfrobot.com.cn/forum.php?mod=attachment&aid=MTY5MXxlNDFkYmYwMXwxNjA4NzA0MTkxfDJ8MTE5NDY%3D RTC DS3231] | ||
| + | |||
支持设备 | 支持设备 | ||
| − | '''DS1307''' | + | '''[[RTC 1307|DS1307]]''' |
Full support including squarewave output pin and memory access -- 全部功能支持,包括方波输出和内存访问 | Full support including squarewave output pin and memory access -- 全部功能支持,包括方波输出和内存访问 | ||
| − | '''DS3231''' | + | '''[[RTC 3231|DS3231]]''' |
Full support including squarewave output pin and alarms. -- 全部功能支持,包括方波输出和闹钟 | Full support including squarewave output pin and alarms. -- 全部功能支持,包括方波输出和闹钟 | ||
| 第34行: | 第38行: | ||
|width="10%" valign="top" align="left"| | |width="10%" valign="top" align="left"| | ||
<!-- 空白 --> | <!-- 空白 --> | ||
| + | |} | ||
| − | |width=" | + | {| border="0" cellpadding="10" width="100%" |
| − | + | |- | |
| + | |width="50%" valign="top" align="left"| | ||
<font color="orange" size="+2">'''DS1307'''</font><br> | <font color="orange" size="+2">'''DS1307'''</font><br> | ||
| 第42行: | 第48行: | ||
'''DS1307 函数。''' | '''DS1307 函数。''' | ||
| − | :- <font color="forestgreen">Begin</font> | + | :- <font color="forestgreen">Begin()</font> -- 初始化 |
| + | ::参数:无 | ||
| + | ::返回:无 | ||
| − | : | + | :-<font color="forestgreen">GetIsRunning()</font> -- 判断RTC芯片是否正常工作 |
| − | + | ::参数 :无 | |
| − | ::参数 | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
::返回:bool | ::返回:bool | ||
| − | :- | + | :-<font color="forestgreen">SetIsRunning()</font> -- 设置RTC芯片正常工作 |
| + | ::参数:bool | ||
| + | ::返回:无 | ||
| − | :-[[ | + | :-<font color="forestgreen">SetDateTime()</font> -- 设置RTC芯片日期时间 |
| + | ::参数:RtcDateTime ([[ 宏:__DATE__,__TIME__,__FILE__,__LINE__]] ) | ||
| + | ::返回:无 | ||
| − | :-[[ | + | :-<font color="forestgreen">GetDateTime()</font> -- 获取RTC芯片日期时间 |
| + | ::参数:RtcDateTime ([[ 宏:__DATE__,__TIME__,__FILE__,__LINE__]] ) | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">SetMemory()</font> -- 写入RTC内存 |
| + | ::参数:memoryAddress 地址, value 值 | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">GetMemory()</font> -- 读取RTC内存 |
| + | ::参数:memoryAddress 地址 | ||
| + | ::返回:value 值 | ||
| − | :- | + | :-<font color="forestgreen">SetSquareWavePin()</font> -- 设置方波输出 |
| + | ::参数:方波频率 | ||
| + | <pre> | ||
| + | enum DS1307SquareWaveOut | ||
| + | { | ||
| + | DS1307SquareWaveOut_1Hz = 0b00010000, | ||
| + | DS1307SquareWaveOut_4kHz = 0b00010001, | ||
| + | DS1307SquareWaveOut_8kHz = 0b00010010, | ||
| + | DS1307SquareWaveOut_32kHz = 0b00010011, | ||
| + | DS1307SquareWaveOut_High = 0b10000000, | ||
| + | DS1307SquareWaveOut_Low = 0b00000000, | ||
| + | }; | ||
| + | </pre> | ||
| + | ::返回:无 | ||
| − | + | |width="50%" valign="top" align="left"| | |
| − | |||
<font color="orange" size="+2">'''DS3231'''</font><br> | <font color="orange" size="+2">'''DS3231'''</font><br> | ||
'''DS3231 函数''' | '''DS3231 函数''' | ||
| − | :- <font color="forestgreen">Begin</font> | + | :- <font color="forestgreen">Begin()</font> -- 初始化 |
| + | ::参数:无 | ||
| + | ::返回:无 | ||
| − | + | :-<font color="forestgreen">IsDateTimeValid()</font> -- 检查日期时间是否有效 | |
| − | + | ::参数:无 | |
| − | :- | + | ::返回:bool |
:-[[RtcDS3231.GetIsRunning()| GetIsRunning()]] | :-[[RtcDS3231.GetIsRunning()| GetIsRunning()]] | ||
| 第83行: | 第109行: | ||
:-[[RtcDS3231.SetIsRunning()| SetIsRunning()]] | :-[[RtcDS3231.SetIsRunning()| SetIsRunning()]] | ||
| − | :- | + | :-<font color="forestgreen">SetDateTime()</font> -- 设置日期时间 |
| + | ::参数:const RtcDateTime& dt | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">GetDateTime()</font> -- 获取日期时间 |
| + | ::参数:无 | ||
| + | ::返回:RtcDateTime | ||
| − | :- | + | :-<font color="forestgreen">GetTemperature()</font> -- 获取温度 |
| + | ::参数:无 | ||
| + | ::返回:RtcTemperature | ||
| − | :- | + | :-<font color="forestgreen">Enable32kHzPin()</font> -- 使能32KHZ引脚 |
| + | ::参数:bool enable | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">SetSquareWavePin()</font> -- 设置方波输出引脚 |
| + | ::参数:DS3231SquareWavePinMode pinMode | ||
| + | <pre> | ||
| + | enum DS3231SquareWavePinMode{ | ||
| + | DS3231SquareWavePin_ModeNone, | ||
| + | DS3231SquareWavePin_ModeBatteryBackup, | ||
| + | DS3231SquareWavePin_ModeClock, | ||
| + | DS3231SquareWavePin_ModeAlarmOne, | ||
| + | DS3231SquareWavePin_ModeAlarmTwo, | ||
| + | DS3231SquareWavePin_ModeAlarmBoth | ||
| + | } | ||
| + | </pre> | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">SetSquareWavePinClockFrequency()</font> -- 设置方波输出引脚时钟频率 |
| + | ::参数:DS3231SquareWaveClock freq | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">SetAlarmOne()</font> -- 设置闹钟1 |
| + | ::参数:const DS3231AlarmOne& alarm | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">SetAlarmTwo()</font> -- 设置闹钟2 |
| + | ::参数:const DS3231AlarmTwo& alarm | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">GetAlarmOne()</font> -- 获取闹钟1 |
| + | ::参数:无 | ||
| + | ::返回:DS3231AlarmOne | ||
| − | :- | + | :-<font color="forestgreen">GetAlarmTwo()</font> -- 获取闹钟2 |
| + | ::参数:无 | ||
| + | ::返回:DS3231AlarmTwo | ||
| − | :- | + | :-<font color="forestgreen">LatchAlarmsTriggeredFlags()</font> -- 警报后必须调用,否则将不会再次触发 |
| + | ::参数:无 | ||
| + | ::返回:DS3231AlarmFlag | ||
| − | :- | + | :-<font color="forestgreen">ForceTemperatureCompensationUpdate()</font> -- 手动温度补偿更新 |
| + | ::参数:bool block | ||
| + | ::返回:无 | ||
| − | :- | + | :-<font color="forestgreen">GetAgingOffset()</font> -- 获取老化补偿 |
| + | ::参数:无 | ||
| + | ::返回:int8_t | ||
| − | :- | + | :-<font color="forestgreen">SetAgingOffset()</font> -- 设置老化补偿 |
| − | + | ::参数:int8_t | |
| − | : | + | ::返回:无 |
| − | + | ||
| − | : | + | |
| 第119行: | 第179行: | ||
<!-- 空白 --> | <!-- 空白 --> | ||
|} | |} | ||
| + | |||
| + | |||
| + | |||
| + | TIP: [[宏:__DATE__,__TIME__,__FILE__,__LINE__]] | ||
---- | ---- | ||
| + | [[RTC 1307|返回DS1307]] | ||
| + | |||
| + | [[RTC 3231|返回DS3231]] | ||
[[Arduino库|返回Arduino库菜单]] | [[Arduino库|返回Arduino库菜单]] | ||
2020年12月24日 (四) 08:37的最后版本
|
RTC_DS1307_DS3231库 -- arduino实时时钟库(已支持ESP8266) GITHUB 工程地址:RTC by Makuna 本地下载地址:RTC DS3231
Full support including squarewave output pin and memory access -- 全部功能支持,包括方波输出和内存访问 Full support including squarewave output pin and alarms. -- 全部功能支持,包括方波输出和闹钟
|
|
DS1307 DS1307 函数。
enum DS1307SquareWaveOut
{
DS1307SquareWaveOut_1Hz = 0b00010000,
DS1307SquareWaveOut_4kHz = 0b00010001,
DS1307SquareWaveOut_8kHz = 0b00010010,
DS1307SquareWaveOut_32kHz = 0b00010011,
DS1307SquareWaveOut_High = 0b10000000,
DS1307SquareWaveOut_Low = 0b00000000,
};
|
DS3231 DS3231 函数
enum DS3231SquareWavePinMode{
DS3231SquareWavePin_ModeNone,
DS3231SquareWavePin_ModeBatteryBackup,
DS3231SquareWavePin_ModeClock,
DS3231SquareWavePin_ModeAlarmOne,
DS3231SquareWavePin_ModeAlarmTwo,
DS3231SquareWavePin_ModeAlarmBoth
}
|
TIP: 宏:__DATE__,__TIME__,__FILE__,__LINE__
更多建议和问题欢迎反馈至 YFRobot论坛