API Reference: Libraries

# MC146818K

#### NAME

> MC146818K - driver for the MC146818 RTC

#### ROUTINES

> mc146818RtcTimeGet() - retrieve the current date and time
> mc146818RtcTimeSet() - Set the current date and time

#### DESCRIPTION

> This driver implements the functionality specific to the the MC146818
> real time clock Timer. It doesn't implement
> functionality of standard MC146818 timer driver but adds RTC time functions

> Some extra features added:
> routine mc146818RtcTimeGet( ) ignore hardware register of Day of week and
> calculates it by software.
> also, returned structure is filled with correct data of Day of year

API Reference: Routines

# mc146818RtcTimeGet()

#### NAME

> mc146818RtcTimeGet (struct tm *) - retrieve the current date and time

#### DESCRIPTION

> Fill the time structure with values accured from RTC registers. Also, calculates values of 'Day of week' and 'Day of year'. RTC Alarm registers are ignored.

#### RETURNS

> OK or ERROR if the parameter is invalid.

#### ERRNO

#### SEE ALSO

> MC146818K

API Reference: Routines

# mc146818RtcTimeSet( )

#### NAME

> mc146818RtcTimeSet (struct tm *) - Set the current date and time

#### DESCRIPTION

> Updates RTC registers with values from the time structure.

#### RETURNS

> OK or ERROR if the parameter is invalid.

#### ERRNO

#### SEE ALSO

> MC146818K