Core
RTC_SetMode
inline void RTC_SetMode(
u8 mode
)

Set clock mode

Parameters
mode
u8

The clock mode flags

RTC_Read
inline u8 RTC_Read(
u8 reg
)

Read a RTC register value

Parameters
reg
u8

RTC register number

RTC_Write
inline void RTC_Write(
u8 reg,
u8 value
)

Write a RTC register value

Parameters
reg
u8

RTC register number

value
u8

The value to write in the register

RTC_WriteRaw
void RTC_WriteRaw(
u8 reg,
u8* data,
u8 num
)

Write data in CMOS in the current block Use RTC_SetMode to change current block

Parameters
reg
u8

Register index to start copy

data
u8*

Data to copy

num
u8

Number of bytes to copy (from 1 to 6)

RTC_ReadRaw
void RTC_ReadRaw(
u8 reg,
u8* data,
u8 num
)

Read data from CMOS in the current block Use RTC_SetMode to change current block

Parameters
reg
u8

Register index to start reading

data
u8*

Data to read

num
u8

Number of bytes to read (from 1 to 6)

Date/Time
RTC_Initialize
inline void RTC_Initialize()

Initialize the clock module

RTC_Set24H
inline void RTC_Set24H(
bool enable
)

Set 12/24 hours mode Need RTC_USE_CLOCK define to be set in MSXgl configuration

Parameters
enable
bool

TRUE for 24h mode and FALSE for 12h mode

RTC_GetSecond
u8 RTC_GetSecond()

Get current clock second counter (0-59) Need RTC_USE_CLOCK define to be set in MSXgl configuration

RTC_GetMinute
u8 RTC_GetMinute()

Get current clock minute counter (0-59) Need RTC_USE_CLOCK define to be set in MSXgl configuration

RTC_GetHour
u8 RTC_GetHour()

Get current clock hour counter (0-23) Need RTC_USE_CLOCK define to be set in MSXgl configuration

RTC_IsPM
inline bool RTC_IsPM()

Check if current hour is PM or AM Need RTC_USE_CLOCK define to be set in MSXgl configuration

RTC_GetDayOfWeek
u8 RTC_GetDayOfWeek()

Get current clock day-of-week counter (0-6) Need RTC_USE_CLOCK define to be set in MSXgl configuration

RTC_GetDay
u8 RTC_GetDay()

Get current clock day counter (1-31) Need RTC_USE_CLOCK define to be set in MSXgl configuration

RTC_GetMonth
u8 RTC_GetMonth()

Get current clock month counter (1-12) Need RTC_USE_CLOCK define to be set in MSXgl configuration

RTC_GetYear
u8 RTC_GetYear()

Get current clock year counter (0-99) Need RTC_USE_CLOCK define to be set in MSXgl configuration

Extra
RTC_GetDayOfWeekString
const c8* RTC_GetDayOfWeekString()

Get current clock day of week string Need RTC_USE_CLOCK and RTC_USE_CLOCK_EXTRA define to be set in MSXgl configuration

RTC_GetMonthString
const c8* RTC_GetMonthString()

Get current clock month counter string Need RTC_USE_CLOCK and RTC_USE_CLOCK_EXTRA define to be set in MSXgl configuration

RTC_GetYear4
u16 RTC_GetYear4()

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

System Setting
RTC_IsSettingOK
inline bool RTC_IsSettingOK()

Set area code

RTC_SetAreaCode
inline void RTC_SetAreaCode(
u8 code
)

Set area code

RTC_GetAreaCode
inline u8 RTC_GetAreaCode()

Get area code

Custom Data
RTC_GetDataType
inline u8 RTC_GetDataType()

Get area code

RTC_SaveData
void RTC_SaveData(
u8* data
)

Save 6 bytes data to CMOS's block 3 Need RTC_USE_SAVEDATA define to be set in MSXgl configuration

Parameters
data
u8*

6 bytes buffer to be saved

RTC_LoadData
bool RTC_LoadData(
u8* data
)

Load 6 bytes data from CMOS's block 3 Need RTC_USE_SAVEDATA define to be set in MSXgl configuration

Parameters
data
u8*

6 bytes buffer to load data

RTC_SaveDataSigned
void RTC_SaveDataSigned(
u8* data
)

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

Parameters
data
u8*

6 bytes buffer to be saved

RTC_LoadDataSigned
bool RTC_LoadDataSigned(
u8* data
)

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

Parameters
data
u8*

6 bytes buffer to load data