XU XUv0.16.0

#core/rtc

import: #core/rtc

counts: 8 functions, 0 methods, 1 types, 14 constants, 0 method sets

Standard library package `#core/rtc`.

const CMOS_ADDR_PORT

XuAPI
pub const CMOS_ADDR_PORT = 0x70

Purpose

Constant CMOS_ADDR_PORT, defining protocol or algorithm parameters.

const CMOS_DATA_PORT

XuAPI
pub const CMOS_DATA_PORT = 0x71

Purpose

Constant CMOS_DATA_PORT, defining protocol or algorithm parameters.

const CMOS_REG_SECONDS

XuAPI
pub const CMOS_REG_SECONDS = 0x00

Purpose

Constant CMOS_REG_SECONDS, defining protocol or algorithm parameters.

const CMOS_REG_MINUTES

XuAPI
pub const CMOS_REG_MINUTES = 0x02

Purpose

Constant CMOS_REG_MINUTES, defining protocol or algorithm parameters.

const CMOS_REG_HOURS

XuAPI
pub const CMOS_REG_HOURS = 0x04

Purpose

Constant CMOS_REG_HOURS, defining protocol or algorithm parameters.

const CMOS_REG_DAY

XuAPI
pub const CMOS_REG_DAY = 0x07

Purpose

Constant CMOS_REG_DAY, defining protocol or algorithm parameters.

const CMOS_REG_MONTH

XuAPI
pub const CMOS_REG_MONTH = 0x08

Purpose

Constant CMOS_REG_MONTH, defining protocol or algorithm parameters.

const CMOS_REG_YEAR

XuAPI
pub const CMOS_REG_YEAR = 0x09

Purpose

Constant CMOS_REG_YEAR, defining protocol or algorithm parameters.

const CMOS_REG_STATUS_A

XuAPI
pub const CMOS_REG_STATUS_A = 0x0A

Purpose

Constant CMOS_REG_STATUS_A, defining protocol or algorithm parameters.

const CMOS_REG_STATUS_B

XuAPI
pub const CMOS_REG_STATUS_B = 0x0B

Purpose

Constant CMOS_REG_STATUS_B, defining protocol or algorithm parameters.

const CMOS_REG_CENTURY

XuAPI
pub const CMOS_REG_CENTURY = 0x32

Purpose

Constant CMOS_REG_CENTURY, defining protocol or algorithm parameters.

const PL031_REG_RTCDR

XuAPI
pub const PL031_REG_RTCDR = 0x000

Purpose

Constant PL031_REG_RTCDR, defining protocol or algorithm parameters.

const GOLDFISH_REG_TIME_LOW

XuAPI
pub const GOLDFISH_REG_TIME_LOW = 0x00

Purpose

Constant GOLDFISH_REG_TIME_LOW, defining protocol or algorithm parameters.

const GOLDFISH_REG_TIME_HIGH

XuAPI
pub const GOLDFISH_REG_TIME_HIGH = 0x04

Purpose

Constant GOLDFISH_REG_TIME_HIGH, defining protocol or algorithm parameters.

struct RtcDateTime

XuAPI
pub struct RtcDateTime {
    pub year u16
    pub month u8
    pub day u8
    pub hour u8
    pub minute u8
    pub second u8
}

Purpose

Structure encapsulating year, month, day, hour, minute.

Public fields

year u16
field (u16)
month u8
field (u8)
day u8
field (u8)
hour u8
field (u8)
minute u8
field (u8)
second u8
field (u8)

rtc_bcd_to_bin

XuAPI
pub fn rtc_bcd_to_bin(v u8) u8

Purpose

Rtc bcd to bin.

Parameters

v u8
value (u8)

Returns

u8 — a value of this type

rtc_is_leap_year

XuAPI
pub fn rtc_is_leap_year(y u32) bool

Purpose

Whether rtc is leap_year.

Parameters

y u32
value (u32)

Returns

bool — true or false

rtc_datetime_to_unix

XuAPI
pub fn rtc_datetime_to_unix(dt &RtcDateTime) u64

Purpose

Rtc datetime to unix.

Parameters

dt &RtcDateTime
dt (read-only borrow; caller keeps the original; type &RtcDateTime)

Returns

u64 — a value of this type

rtc_unix_to_datetime

XuAPI
pub fn rtc_unix_to_datetime(epoch u64) RtcDateTime

Purpose

Rtc unix to datetime.

Parameters

epoch u64
epoch (u64)

Returns

RtcDateTime — a value of this type

cmos_read_datetime

XuAPI
pub fn cmos_read_datetime() RtcDateTime

Purpose

Cmos read datetime.

Parameters

No arguments are required.

Returns

RtcDateTime — a value of this type

pl031_read_unix

XuAPI
pub fn pl031_read_unix(base u64) u64

Purpose

Pl031 read unix.

Parameters

base u64
numeric base (u64)

Returns

u64 — a value of this type

goldfish_rtc_read_ns

XuAPI
pub fn goldfish_rtc_read_ns(base u64) u64

Purpose

Goldfish rtc read ns.

Parameters

base u64
numeric base (u64)

Returns

u64 — a value of this type

goldfish_rtc_read_unix

XuAPI
pub fn goldfish_rtc_read_unix(base u64) u64

Purpose

Goldfish rtc read unix.

Parameters

base u64
numeric base (u64)

Returns

u64 — a value of this type