<--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->

battclock

Index


ReadBattClock() ReadBattClockMem() ResetBattClock() WriteBattClock()
WriteBattClockMem()      

ReadBattClock()

Synopsis

ULONG ReadBattClock();

Function

Return the value stored in the battery back up clock. This value
is the number of seconds that have elapsed since midnight on the
1st of January 1978 (00:00:00 1.1.1978).

If the value of the battery clock is invalid, then the clock will
be reset.

Result

The number of seconds since 1.1.1978 00:00:00

ReadBattClockMem()

Synopsis

ULONG ReadBattClockMem(
         ULONG offset,
         ULONG length );

Function

Read a field of up to 32 bits out of the battery backed up memory
of the real time clock. This is the storage battmem.resource is
built on; normal applications should use that resource instead.

Inputs

offset - bit offset of the field, counted from the first bit of
         the battery memory.
length - size of the field in bits. Values above 32 are clamped
         to 32.

Result

The field, right aligned. Zero if the clock has no battery memory,
or if offset lies beyond the end of it.

Notes

Not all clock chips have battery backed up memory. The MSM6242B
fitted to some machines has none, and this function returns 0
there.

ResetBattClock()

Synopsis

void ResetBattClock();

Function

Reset the system battery-backed-up clock. This will reset the clock
back to 0 seconds (or midnight, 1st Jan 1978).

Inputs

None.

Result

The clock will be reset.

Notes

This function may do nothing when the battery backed up clock either
doesn't exist, or may not be writable by the operating system.

WriteBattClock()

Synopsis

void WriteBattClock(
         ULONG time );

Function

Set the system's battery backed up clock to the time specified. The
value should be the number of seconds since 00:00:00 on 1.1.1978.

Inputs

time - The number of seconds elapsed since 00:00:00 1.1.1978

Result

The clock will be set.

Notes

This may not do anything on some systems where the battery backed
up clock either doesn't exist, or may not be writable.

WriteBattClockMem()

Synopsis

void WriteBattClockMem(
         ULONG data,
         ULONG offset,
         ULONG length );

Function

Write a field of up to 32 bits into the battery backed up memory
of the real time clock. This is the storage battmem.resource is
built on; normal applications should use that resource instead.

Inputs

data   - the field value, right aligned.
offset - bit offset of the field, counted from the first bit of
         the battery memory.
length - size of the field in bits. Values above 32 are clamped
         to 32.

Notes

Not all clock chips have battery backed up memory. The MSM6242B
fitted to some machines has none, and this function does nothing
there. Writes that start beyond the end of the battery memory are
ignored; writes that run past the end are truncated.