rtccreadalrmtime.c
来自「Mplab C30编译器」· C语言 代码 · 共 41 行
C
41 行
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include "Rtcc.h"
#ifdef _TMR_RTCC_V1
/*********************************************************************
Function: void RtccReadAlrmTime(rtccTime* pTm)
PreCondition: pTm a valid pointer
Input: pTm - pointer to a rtccTime union to store the alarm time
Output: None
Side Effects: None
Overview: The function updates the user supplied union/structure with
the current alarm time of the RTCC device.
********************************************************************/
void RtccReadAlrmTime(rtccTime* pTm)
{
rtccTimeDate rTD;
mRtccClearAlrmPtr();
mRtccSetAlrmPtr(RTCCPTR_MASK_HRSWEEK);
rTD.w[2]=ALRMVAL;
rTD.w[3]=ALRMVAL; // read the user value
pTm->f.hour=rTD.f.hour;
pTm->f.min=rTD.f.min;
pTm->f.sec=rTD.f.sec; // update user's data
}
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?