EasyManua.ls Logo

EMBRON Hatteland E Series - Page 118

Default Icon
136 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 - mail@hatteland-display.com - 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(iBaseAddrSMBUS + bOffsetHostStatus, 0xFE);
//2. Wait for 2 sec
Sleep(1000);
//3. Read Host Status
bValue = (unsigned char)gfpInp32(iBaseAddrSMBUS + bOffsetHostStatus);
Sleep(1000);
bValue = (unsigned char)gfpInp32(iBaseAddrSMBUS + bOffsetHostStatus);
if(bValue != 0x40)
{
//Error
}
//4. Set Device address
gfpOut32(iBaseAddrSMBUS + bOffsetSlaveDeviceAddress, bSlaveDeviceAddr);
//5. Set Slave register address
gfpOut32(iBaseAddrSMBUS + bOffsetSlaveRegisterAddress, bSlaveRegisterAddr);
//6. Set Slave register data
gfpOut32(iBaseAddrSMBUS + bOffsetSlaveRegisterData, bSlaveRegisterData);
//7. Set Execute bit
gfpOut32(iBaseAddrSMBUS + bOffsetExecute, 0x48);
//8. Wait 1 sec
Sleep(1000);
//9. Read Execute bit
bValue = (unsigned char)gfpInp32(iBaseAddrSMBUS + 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)
{
bRTCFormatValue += ((bTimeValue/10) << 4);
bRTCFormatValue += bTimeValue%10;
}
else
{
if(bTimeValue < 1 || bTimeValue > 7)
{
bRTCFormatValue = 0x00;
}
else
{

Table of Contents

Related product manuals