ReactOS  0.4.15-dev-3303-g1ade494
hwinfo.c File Reference
#include "precomp.h"
Include dependency graph for hwinfo.c:

Go to the source code of this file.

Macros

#define BCD_INT(bcd)   (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))
 

Functions

ULONG NTAPI LlbHwGetBoardType (VOID)
 
ULONG NTAPI LlbHwGetPClk (VOID)
 
ULONG NTAPI LlbHwGetTmr0Base (VOID)
 
ULONG NTAPI LlbHwGetSerialUart (VOID)
 
ULONG LlbHwRtcRead (VOID)
 

Variables

TIMEINFO LlbTime
 

Macro Definition Documentation

◆ BCD_INT

#define BCD_INT (   bcd)    (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))

Definition at line 13 of file hwinfo.c.

Function Documentation

◆ LlbHwGetBoardType()

ULONG NTAPI LlbHwGetBoardType ( VOID  )

Definition at line 17 of file hwinfo.c.

18 {
19  return MACH_TYPE_OMAP_ZOOM2;
20 }
#define MACH_TYPE_OMAP_ZOOM2
Definition: machtype.h:30

◆ LlbHwGetPClk()

ULONG NTAPI LlbHwGetPClk ( VOID  )

Definition at line 24 of file hwinfo.c.

25 {
26  return 48000000;
27 }

◆ LlbHwGetSerialUart()

ULONG NTAPI LlbHwGetSerialUart ( VOID  )

Definition at line 38 of file hwinfo.c.

39 {
40  return 0;
41 }

◆ LlbHwGetTmr0Base()

ULONG NTAPI LlbHwGetTmr0Base ( VOID  )

Definition at line 31 of file hwinfo.c.

32 {
33  return 0x48318000;
34 }

◆ LlbHwRtcRead()

ULONG LlbHwRtcRead ( VOID  )

Definition at line 44 of file hwinfo.c.

45 {
46  /* Issue the GET_TIME request on the RTC control register */
47  LlbHwOmap3TwlWrite1(0x4B, 0x29, 0x41);
48 
49  /* Read the BCD registers and convert them */
52  LlbTime.Hour = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1E));
53  LlbTime.Day = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1F));
54  LlbTime.Month = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x20));
55  LlbTime.Year = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x21));
56  LlbTime.Year += (LlbTime.Year > 80) ? 1900 : 2000;
57  return 0;
58 }
TIMEINFO LlbTime
Definition: hwinfo.c:11
#define BCD_INT(bcd)
Definition: hwinfo.c:13
USHORT Second
Definition: fw.h:16
USHORT Month
Definition: fw.h:12
USHORT Minute
Definition: fw.h:15
VOID NTAPI LlbHwOmap3TwlWrite1(IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Value)
Definition: hwtwl40x.c:61
USHORT Year
Definition: fw.h:11
USHORT Hour
Definition: fw.h:14
USHORT Day
Definition: fw.h:13
UCHAR NTAPI LlbHwOmap3TwlRead1(IN UCHAR ChipAddress, IN UCHAR RegisterAddress)
Definition: hwtwl40x.c:15

Variable Documentation

◆ LlbTime

TIMEINFO LlbTime

Definition at line 11 of file hwinfo.c.

Referenced by LlbHwRtcRead().