Download 78K0 Design - Renesas Electronics

Transcript
CubeSuite Ver.1.40
APPENDIX C API FUNCTIONS
7
6
5
4
3
0
BCD code (hour: digit 1)
BCD code (hour: digit 10)
00: Fixed
- Alarmww (Weekday)
Below are shown the meanings of each bit of the structure member Alarmww.
7
6
5
4
3
2
1
0
1: Sunday
1: Monday
1: Tuesday
1: Wednesday
1: Thursday
1: Friday
1: Saturday
0: Fixed
[Return value]
None.
[Example 1]
The example below shows the alarm conditions being set to "Monday/Tuesday/Wednesday at 17:30".
[CG_main.c]
#include
"CG_rtc.h"
void main ( void ) {
struct
RTCAlarmValue
alarmval;
......
RTC_AlarmEnable ();
/* Start alarm interrupt function */
RTC_CounterEnable ();
/* Start count */
......
RTC_SetHourSystem ( HOUR24 );
/* Set clock type */
alarmval.Alarmww = 0xe;
alarmval.Alarmwh = 0x17;
alarmval.Alarmwm = 0x30;
RTC_AlarmSet ( alarmval );
/* Set conditions */
......
}
R20UT0006EJ0100 Rev.1.00
Sep 01, 2010
Page 261 of 300