Files

187 lines
19 KiB
HTML

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>clock.h</title><link rel="stylesheet" type="text/css" href="../styles/main.css" /><script type="text/javascript" src="../styles/main.js"></script><script type="text/javascript">NDLoader.LoadJS("Content", "../styles/");</script></head>
<!-- Generated by Natural Docs, version 2.2 -->
<!-- saved from url=(0016)http://localhost -->
<body onload="NDLoader.OnLoad('Content');" class="NDPage NDContentPage">
<a name="Core"></a><a name="Topic1375"></a><div class="CTopic TGroup LC first">
<div class="CTitle">Core</div>
</div>
<a name="RTC_SetMode"></a><a name="Topic1376"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_SetMode</div>
<div id="NDPrototype1376" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> RTC_SetMode(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">mode</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set clock mode</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">mode<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>The clock mode flags</p></td></tr></table></div>
</div>
<a name="RTC_Read"></a><a name="Topic1377"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_Read</div>
<div id="NDPrototype1377" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> u8 RTC_Read(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">reg</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Read a RTC register value</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">reg<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>RTC register number</p></td></tr></table><div class="CHeading">Return</div><p>Register value (4 bits)</p></div>
</div>
<a name="RTC_Write"></a><a name="Topic1378"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_Write</div>
<div id="NDPrototype1378" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> RTC_Write(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">reg,</td></tr><tr><td class="PType first">u8&nbsp;</td><td class="PName last">value</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Write a RTC register value</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">reg<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>RTC register number</p></td></tr><tr><td class="CDLEntry">value<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>The value to write in the register</p></td></tr></table></div>
</div>
<a name="RTC_WriteRaw"></a><a name="Topic1379"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_WriteRaw</div>
<div id="NDPrototype1379" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> RTC_WriteRaw(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">reg,</td></tr><tr><td class="PType first">u8*&nbsp;</td><td class="PName last">data,</td></tr><tr><td class="PType first">u8&nbsp;</td><td class="PName last">num</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Write data in CMOS in the current block Use RTC_SetMode to change current block</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">reg<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Register index to start copy</p></td></tr><tr><td class="CDLEntry">data<div class="CDLParameterType">u8*</div></td><td class="CDLDefinition"><p>Data to copy</p></td></tr><tr><td class="CDLEntry">num<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Number of bytes to copy (from 1 to 6)</p></td></tr></table></div>
</div>
<a name="RTC_ReadRaw"></a><a name="Topic1380"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_ReadRaw</div>
<div id="NDPrototype1380" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> RTC_ReadRaw(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">reg,</td></tr><tr><td class="PType first">u8*&nbsp;</td><td class="PName last">data,</td></tr><tr><td class="PType first">u8&nbsp;</td><td class="PName last">num</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Read data from CMOS in the current block Use RTC_SetMode to change current block</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">reg<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Register index to start reading</p></td></tr><tr><td class="CDLEntry">data<div class="CDLParameterType">u8*</div></td><td class="CDLDefinition"><p>Data to read</p></td></tr><tr><td class="CDLEntry">num<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Number of bytes to read (from 1 to 6)</p></td></tr></table></div>
</div>
<a name="Date/Time"></a><a name="Topic1381"></a><div class="CTopic TGroup LC">
<div class="CTitle">Date/Time</div>
</div>
<a name="RTC_Initialize"></a><a name="Topic1382"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_Initialize</div>
<div id="NDPrototype1382" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> RTC_Initialize()</div></div>
<div class="CBody"><p>Initialize the clock module</p></div>
</div>
<a name="RTC_Set24H"></a><a name="Topic1383"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_Set24H</div>
<div id="NDPrototype1383" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> RTC_Set24H(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first"><span class="SHKeyword">bool</span>&nbsp;</td><td class="PName last">enable</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set 12/24 hours mode Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">enable<div class="CDLParameterType"><span class="SHKeyword">bool</span></div></td><td class="CDLDefinition"><p>TRUE for 24h mode and FALSE for 12h mode</p></td></tr></table></div>
</div>
<a name="RTC_GetSecond"></a><a name="Topic1384"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetSecond</div>
<div id="NDPrototype1384" class="NDPrototype"><div class="PSection PPlainSection">u8 RTC_GetSecond()</div></div>
<div class="CBody"><p>Get current clock second counter (0-59) Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Current clock second</p></div>
</div>
<a name="RTC_GetMinute"></a><a name="Topic1385"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetMinute</div>
<div id="NDPrototype1385" class="NDPrototype"><div class="PSection PPlainSection">u8 RTC_GetMinute()</div></div>
<div class="CBody"><p>Get current clock minute counter (0-59) Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Current clock minute</p></div>
</div>
<a name="RTC_GetHour"></a><a name="Topic1386"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetHour</div>
<div id="NDPrototype1386" class="NDPrototype"><div class="PSection PPlainSection">u8 RTC_GetHour()</div></div>
<div class="CBody"><p>Get current clock hour counter (0-23) Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Current clock hour</p></div>
</div>
<a name="RTC_IsPM"></a><a name="Topic1387"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_IsPM</div>
<div id="NDPrototype1387" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> RTC_IsPM()</div></div>
<div class="CBody"><p>Check if current hour is PM or AM Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>FALSE if current hour is AM</p></div>
</div>
<a name="RTC_GetDayOfWeek"></a><a name="Topic1388"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetDayOfWeek</div>
<div id="NDPrototype1388" class="NDPrototype"><div class="PSection PPlainSection">u8 RTC_GetDayOfWeek()</div></div>
<div class="CBody"><p>Get current clock day-of-week counter (0-6) Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Current clock day-of-week</p></div>
</div>
<a name="RTC_GetDay"></a><a name="Topic1389"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetDay</div>
<div id="NDPrototype1389" class="NDPrototype"><div class="PSection PPlainSection">u8 RTC_GetDay()</div></div>
<div class="CBody"><p>Get current clock day counter (1-31) Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Current clock day</p></div>
</div>
<a name="RTC_GetMonth"></a><a name="Topic1390"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetMonth</div>
<div id="NDPrototype1390" class="NDPrototype"><div class="PSection PPlainSection">u8 RTC_GetMonth()</div></div>
<div class="CBody"><p>Get current clock month counter (1-12) Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Current clock month</p></div>
</div>
<a name="RTC_GetYear"></a><a name="Topic1391"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetYear</div>
<div id="NDPrototype1391" class="NDPrototype"><div class="PSection PPlainSection">u8 RTC_GetYear()</div></div>
<div class="CBody"><p>Get current clock year counter (0-99) Need RTC_USE_CLOCK define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Current clock year</p></div>
</div>
<a name="Extra"></a><a name="Topic1392"></a><div class="CTopic TGroup LC">
<div class="CTitle">Extra</div>
</div>
<a name="RTC_GetDayOfWeekString"></a><a name="Topic1393"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetDayOfWeekString</div>
<div id="NDPrototype1393" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">const</span> c8* RTC_GetDayOfWeekString()</div></div>
<div class="CBody"><p>Get current clock day of week string Need RTC_USE_CLOCK and RTC_USE_CLOCK_EXTRA define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Zero-terminated string with day of week</p></div>
</div>
<a name="RTC_GetMonthString"></a><a name="Topic1394"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetMonthString</div>
<div id="NDPrototype1394" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">const</span> c8* RTC_GetMonthString()</div></div>
<div class="CBody"><p>Get current clock month counter string Need RTC_USE_CLOCK and RTC_USE_CLOCK_EXTRA define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>Zero-terminated string with month</p></div>
</div>
<a name="RTC_GetYear4"></a><a name="Topic1395"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetYear4</div>
<div id="NDPrototype1395" class="NDPrototype"><div class="PSection PPlainSection">u16 RTC_GetYear4()</div></div>
<div class="CBody"><p>Get current clock 4-digits year counter (1980-2079) Need RTC_USE_CLOCK and RTC_USE_CLOCK_EXTRA define to be set in MSXgl configuration</p><div class="CHeading">Return</div><p>4-digits year counter</p></div>
</div>
<a name="System_Setting"></a><a name="Topic1396"></a><div class="CTopic TGroup LC">
<div class="CTitle">System Setting</div>
</div>
<a name="RTC_IsSettingOK"></a><a name="Topic1397"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_IsSettingOK</div>
<div id="NDPrototype1397" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> <span class="SHKeyword">bool</span> RTC_IsSettingOK()</div></div>
<div class="CBody"><p>Check if setting data is valid</p><div class="CHeading">Return</div><p>FALSE if setting is invalid (system information is not used or initialized)</p></div>
</div>
<a name="RTC_SetAreaCode"></a><a name="Topic1398"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_SetAreaCode</div>
<div id="NDPrototype1398" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> RTC_SetAreaCode(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8&nbsp;</td><td class="PName last">code</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set area code</p><div class="CHeading">Parameers</div><table class="CDefinitionList"><tr><td class="CDLEntry">code</td><td class="CDLDefinition"><p>New area code to set</p></td></tr></table></div>
</div>
<a name="RTC_GetAreaCode"></a><a name="Topic1399"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetAreaCode</div>
<div id="NDPrototype1399" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 RTC_GetAreaCode()</div></div>
<div class="CBody"><p>Get area code</p><div class="CHeading">Return</div><p>Current area code</p></div>
</div>
<a name="Custom_Data"></a><a name="Topic1400"></a><div class="CTopic TGroup LC">
<div class="CTitle">Custom Data</div>
</div>
<a name="RTC_GetDataType"></a><a name="Topic1401"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_GetDataType</div>
<div id="NDPrototype1401" class="NDPrototype"><div class="PSection PPlainSection"><span class="SHKeyword">inline</span> u8 RTC_GetDataType()</div></div>
<div class="CBody"><p>Get current data type</p><div class="CHeading">Return</div><p>Current data type (see RTC_DATA_ defines)</p></div>
</div>
<a name="RTC_SaveData"></a><a name="Topic1402"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_SaveData</div>
<div id="NDPrototype1402" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> RTC_SaveData(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8*&nbsp;</td><td class="PName last">data</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Save 6 bytes data to CMOS's block 3 Need RTC_USE_SAVEDATA define to be set in MSXgl configuration</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">data<div class="CDLParameterType">u8*</div></td><td class="CDLDefinition"><p>6 bytes buffer to be saved</p></td></tr></table></div>
</div>
<a name="RTC_LoadData"></a><a name="Topic1403"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_LoadData</div>
<div id="NDPrototype1403" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">bool</span> RTC_LoadData(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8*&nbsp;</td><td class="PName last">data</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Load 6 bytes data from CMOS's block 3 Need RTC_USE_SAVEDATA define to be set in MSXgl configuration</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">data<div class="CDLParameterType">u8*</div></td><td class="CDLDefinition"><p>6 bytes buffer to load data</p></td></tr></table><div class="CHeading">Return</div><p>FALSE if data loading failed</p></div>
</div>
<a name="RTC_SaveDataSigned"></a><a name="Topic1404"></a><div class="CTopic TFunction LC">
<div class="CTitle">RTC_SaveDataSigned</div>
<div id="NDPrototype1404" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">void</span> RTC_SaveDataSigned(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8*&nbsp;</td><td class="PName last">data</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Save 6 bytes data to CMOS's block 3 Need RTC_USE_SAVESIGNED define to be set in MSXgl configuration and AppSignature BuildTool option to TRUE</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">data<div class="CDLParameterType">u8*</div></td><td class="CDLDefinition"><p>6 bytes buffer to be saved</p></td></tr></table></div>
</div>
<a name="RTC_LoadDataSigned"></a><a name="Topic1405"></a><div class="CTopic TFunction LC last">
<div class="CTitle">RTC_LoadDataSigned</div>
<div id="NDPrototype1405" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">bool</span> RTC_LoadDataSigned(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PType first">u8*&nbsp;</td><td class="PName last">data</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Load 6 bytes data from CMOS's block 3 Need RTC_USE_SAVESIGNED define to be set in MSXgl configuration and AppSignature BuildTool option to TRUE</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">data<div class="CDLParameterType">u8*</div></td><td class="CDLDefinition"><p>6 bytes buffer to load data</p></td></tr></table></div>
</div>
</body></html>