118
RTC Timer (Apollolake) - User Guide
Appendix
IND100077-195
DOC207017- rev 01 – 2018-09-24 - Created by: 6644
Page 10 of 12
Hatteland Display AS, Stokkastrandvegen 87B, N-5578 Nedre Vats, Norway
Tel: (+47) 4814 2200 - [email protected] - www.hatteland-display.com
User Guide RTC Timer - ApolloLake
All intellectual properties belongs to Hatteland Display AS
unsigned
char
bValue = 0;
//1. Clear host status
gfpOut32(iBaseAdd bOffsetHostStatus, 0xFE);
//2. Wait for 2 sec
Sleep(1000);
//3. Read Host Status
bValue = (
unsigned
char
)gfpInp32(iBaseAdd bOffsetHostStatus);
Sleep(1000);
bValue = (
unsigned
char
)gfpInp32(iBaseAdd bOffsetHostStatus);
if
(bValue != 0x40)
{
//Error
}
//4. Set Device address
gfpOut32(iBaseAdd bOffsetSlaveDeviceAddress,
bSlaveDeviceAddr
);
//5. Set Slave register address
gfpOut32(iBaseAdd bOffsetSlaveRegisterAddress,
bSlaveRegisterAddr
);
//6. Set Slave register data
gfpOut32(iBaseAdd bOffsetSlaveRegisterData,
bSlaveRegisterData
);
//7. Set Execute bit
gfpOut32(iBaseAdd bOffsetExecute, 0x48);
//8. Wait 1 sec
Sleep(1000);
//9. Read Execute bit
bValue = (
unsigned
char
)gfpInp32(iBaseAdd bOffsetExecute);
if
(bValue != 0x08)
{
//Error
}
}
//Convert decimal value to RTC register data format
unsigned
char
ConvertDectoRTCFormat(
unsigned
char
bTimeValue
,
bool
BWeekday
=
false
)
{
unsigned
char
bRTCFormatValue = 0x00;
if
(!
BWeekday
)
{
bRTCForma= ((
bTimeValue
/10) << 4);
bRTCForma=
bTimeValue
%10;
}
else
{
if
(
bTimeValue
< 1 ||
bTimeValue
> 7)
{
bRTCFormatValue = 0x00;
}
else
{
Summary of Contents for Hatteland E Series
Page 8: ...8 This page left intentionally blank...
Page 9: ...9 General...
Page 17: ...17 Installation...
Page 41: ...41 Operation...
Page 44: ...44 This page left intentionally blank...
Page 45: ...45 Specifications...
Page 61: ...61 Specifications Accessories...
Page 65: ...65 Technical Drawings...
Page 70: ...70 This page left intentionally blank...
Page 71: ...71 Technical Drawings Accessories...
Page 88: ...88 This page left intentionally blank...
Page 89: ...89 Appendixes...
Page 134: ...134 Appendix IND100077 24 User Notes...
Page 136: ...Hatteland Technology AS www hattelandtechnology com Enterprise no NO974533146...