📄 freescale
字号:
/** ###################################################################
** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : TimeDate.H
** Project : rtc
** Processor : MC9S08JM60CLHE
** Component : TimeDate
** Version : Component 02.106, Driver 01.20, CPU db: 3.00.046
** Compiler : CodeWarrior HCS08 C Compiler
** Date/Time : 2010-1-14, 14:08
** Abstract :
** This bean "TimeDate" implements real time and date.
** The bean requires a periodic interrupt generator: timer
** compare or reload register or timer-overflow interrupt
** (of free running counter). User can select precision of
** selected timer.
** The bean supports also alarm with event OnAlarm.
** Settings :
** Timer name : RTC (8-bit)
**
** Counter : RTCCNT [$006D]
** Mode register : RTCSC [$006C]
** Run register : RTCSC [$006C]
** Prescaler : RTCSC [$006C]
** Compare register : RTCMOD [$006E]
**
** Interrupt name : Vrtc
** Interrupt enable reg. : RTCSC [$006C]
** Priority :
** User handling procedure : TimeDate_OnAlarm
** This event is called whenever the current time is equal
** to alarm time
**
** High speed mode
** Prescaler : divide-by-1
** Clock : 244 Hz
** Resolution of timer
** Xtal ticks : 31232
** microseconds : 999424
** milliseconds : 999
** seconds : 1
** seconds (real) : 0.999424
** Hz : 1
**
** Initialization:
** Timer : Enabled
**
** Time : 0:0:0
** Date : 1/1/2010
** Contents :
** SetTime - byte TimeDate_SetTime(byte Hour, byte Min, byte Sec, byte Sec100);
** GetTime - byte TimeDate_GetTime(TIMEREC *Time);
** SetDate - byte TimeDate_SetDate(word Year, byte Month, byte Day);
** GetDate - byte TimeDate_GetDate(DATEREC *Date);
** GetDay - byte TimeDate_GetDay(byte *Day);
** SetAlarm - byte TimeDate_SetAlarm(byte Hour, byte Min, byte Sec, byte Sec100);
**
** Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**
** http : www.freescale.com
** mail : support@freescale.com
** ###################################################################*/
#ifndef __TimeDate
#define __TimeDate
/* MODULE TimeDate. */
/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
/* Include inherited beans */
#include "Cpu.h"
#include <limits.h>
#ifndef __BWUserType_TIMEREC
#define __BWUserType_TIMEREC
typedef struct { /* It contains actual number of hours, minutes, seconds and hundreths of seconds. */
byte Hour; /* hours (0 - 23) */
byte Min; /* minutes (0 - 59) */
byte Sec; /* seconds (0 - 59) */
byte Sec100; /* hundredths of seconds (0 - 99) */
} TIMEREC;
#endif
#ifndef __BWUserType_DATEREC
#define __BWUserType_DATEREC
typedef struct { /* It contains actual year, month, and day description. */
word Year; /* years (1998 - 2099) */
byte Month; /* months (1 - 12) */
byte Day; /* days (1 - 31) */
} DATEREC;
#endif
byte TimeDate_SetTime(byte Hour,byte Min,byte Sec,byte Sec100);
/*
** ===================================================================
** Method : TimeDate_SetTime (component TimeDate)
**
** Description :
** This method sets a new actual time.
** Parameters :
** NAME - DESCRIPTION
** Hour - Hours (0 - 23)
** Min - Minutes (0 - 59)
** Sec - Seconds (0 - 59)
** Sec100 - Hundredths of seconds (0 - 99)
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ERR_RANGE - Parameter out of range
** ===================================================================
*/
byte TimeDate_GetTime(TIMEREC *Time);
/*
** ===================================================================
** Method : TimeDate_GetTime (component TimeDate)
**
** Description :
** Return current time.
** Parameters :
** NAME - DESCRIPTION
** * Time - Pointer to the structure TIMEREC. It
** contains actual number of hours, minutes,
** seconds and hundreths of seconds.
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================
*/
byte TimeDate_SetDate(word Year,byte Month,byte Day);
/*
** ===================================================================
** Method : TimeDate_SetDate (component TimeDate)
**
** Description :
** This method sets a new actual date. See limitations at the
** page <General Info>.
** Parameters :
** NAME - DESCRIPTION
** Year - Years (16-bit unsigned integer)
** Month - Months (8-bit unsigned integer)
** Day - Days (8-bit unsigned integer)
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ERR_RANGE - Parameter out of range
** ===================================================================
*/
byte TimeDate_GetDate(DATEREC *Date);
/*
** ===================================================================
** Method : TimeDate_GetDate (component TimeDate)
**
** Description :
** Return current date.
** Parameters :
** NAME - DESCRIPTION
** * Date - Pointer to the structure DATEREC. It
** contains actual year, month, and day
** description.
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================
*/
byte TimeDate_GetDay(byte *Day);
/*
** ===================================================================
** Method : TimeDate_GetDay (component TimeDate)
**
** Description :
** This method returns current day of the week.
** Parameters :
** NAME - DESCRIPTION
** * Day - Pointer to returned day - 8-bit unsigned
** number (Range 0..6, where 0 =Sunday, 1
** =Monday, 2 =Tuesday, ...).
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================
*/
byte TimeDate_SetAlarm(byte Hour,byte Min,byte Sec,byte Sec100);
/*
** ===================================================================
** Method : TimeDate_SetAlarm (component TimeDate)
**
** Description :
** This method sets a new time of alarm. (only time, not date -
** alarm event <OnAlarm> is called every 24 hours). Setting any
** parameter out of its range disables alarm.
** Parameters :
** NAME - DESCRIPTION
** Hour - Hours (0 - 23)
** Min - Minutes (0 - 59)
** Sec - Seconds (0 - 59)
** Sec100 - Hundreths of seconds (0 - 99)
** Returns :
** --- - Error code, possible codes:
** - ERR_OK - OK
** - ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================
*/
void TimeDate_InitTD(void);
/*
** ===================================================================
** Method : TimeDate_InitTD (component TimeDate)
**
** Description :
** Initializes the associated peripheral(s) and the beans
** internal variables. The method is called automatically as a
** part of the application initialization code.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
__interrupt void TimeDate_Interrupt(void);
/*
** ===================================================================
** Method : TimeDate_Interrupt (component TimeDate)
**
** Description :
** The method services the interrupt of the selected peripheral(s)
** and eventually invokes the beans event(s).
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void TimeDate_HWEnDi(void);
/*
** ===================================================================
** Method : TimeDate_HWEnDi (component TimeDate)
**
** Description :
** Enables or disables the peripheral(s) associated with the bean.
** The method is called automatically as a part of the Enable and
** Disable methods and several internal methods.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
/* END TimeDate. */
#endif /* ifndef __TimeDate */
/*
** ###################################################################
**
** This file was created by Processor Expert 3.07 [04.34]
** for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -