寄存器

请查看 寄存器访问类型 ,了解 Access 列缩写的含义。

RTL8721Dx:

Base Address: 0x41008A00

Name

Address offset

Access

Description

REG_RTC_TR

000h

R/W

This register is the calendar time shadow register. This register is write protected, and must be written in initialization mode only

REG_RTC_CR

004h

R/W

This register is write protected. Bit[7] (FMT) of this register can be written in initialization mode only when INITF = 1. ADD1H and SUB1H changes are effective in 2~3 seconds. Don’t write this register continuously without any delay when RTC is in free run mode. Software can use the RSF bit in RTC_ISR register to handle the delay.

REG_RTC_ISR

008h

R/W

The ALMF/WUTF/DOVTHF bit can be written without unlocking the write protection. Two APB clock cycles after programming it to 1, this bit is cleaned.

REG_RTC_PRER

00Ch

R/W

This register is write protected, and must be written in initialization mode only.

REG_RTC_CALIBR

010h

R/W

This register is write protected, and can be dynamically configured when RTC is running.

REG_RTC_ALMR1L

014h

R/W

This register is write protected, and can be written only when ALMWF is set to 1 in RTC_ISR register, or in initialization mode.

REG_RTC_ALMR1H

018h

R/W

This register is write protected, and can be written only when ALMWF is set to 1 in RTC_ISR register, or in initialization mode

REG_RTC_WPR

01Ch

R/W

Write "0xCA" then write "0x53" to disable write protection, and write "0xFF" to enable write protection.

REG_RTC_YEAR

020h

R/W

This register is controlled by software.

REG_RTC_WUTR

024h

R/W

This register is used to set wakeup timer value.

REG_RTC_DUMMY

028h

R/W

REG_RTC_TR

  • Name: RTC Time Register

  • Size: 32

  • Address offset: 000h

  • Read/write access: R/W

This register is the calendar time shadow register. This register is write protected, and must be

written in initialization mode only

31:23 DAY 22 PM 21:20 HT 19:16 HU 15 RSVD 14:12 MNT 11:8 MNU 7 RSVD 6:4 ST 3:0 SU

Bit

Symbol

Access

INI

Description

31:23

DAY

R/W

0

DAY in binary format

22

PM

R/W

0

PM:AM/PM notation

  • 0: AM or 24-hour format

  • 1: PM

21:20

HT

R/W

0

Hour tens in BCD format

19:16

HU

R/W

0

Hour units in BCD format

15

RSVD

R

-

Reserved

14:12

MNT

R/W

0

Minute tens in BCD format

11:8

MNU

R/W

0

Minute units in BCD format

7

RSVD

R

-

Reserved

6:4

ST

R/W

0

Second tens in BCD format

3:0

SU

R/W

0

Second units in BCD format

REG_RTC_CR

  • Name: RTC Control Register

  • Size: 32

  • Address offset: 004h

  • Read/write access: R/W

This register is write protected. Bit[7] (FMT) of this register can be written in initialization

mode only when INITF = 1. ADD1H and SUB1H changes are effective in 2~3 seconds. Don’t write this

register continuously without any delay when RTC is in free run mode. Software can use the RSF bit

in RTC_ISR register to handle the delay.

31:23 DAY_THRES 22:17 RSVD 16 DOVTHIE 15 RSVD 14 WUTIE 13 RSVD 12 ALMIE 11 RSVD 10 WUTE 9 RSVD 8 ALME 7 FMT 6:5 OSEL 4 RSVD 3 BYPSHAD 2 BKP 1 SUB1H 0 ADD1H

Bit

Symbol

Access

INI

Description

31:23

DAY_THRES

R

1FFh

Day threshold in binary format

22:17

RSVD

R

-

Reserved

16

DOVTHIE

R/W

0

Day over threshold interrupt enable

  • 0: Day over threshold interrupt disabled

  • 1: Day over threshold interrupt enabled

15

RSVD

R

-

Reserved

14

WUTIE

R/W

0

Wakeup timer interrupt enable

  • 0: Wakeup timer interrupt disabled

  • 1: Wakeup timer interrupt enabled

13

RSVD

R

-

Reserved

12

ALMIE

R/W

0

Alarm interrupt enable

  • 0: Alarm interrupt disabled

  • 1: Alarm interrupt enabled

11

RSVD

R

-

Reserved

10

WUTE

R/W

0

Wakeup timer enable

  • 0: Wakeup timer disabled

  • 1: Wakeup timer enabled

9

RSVD

R

-

Reserved

8

ALME

R/W

0

Alarm enable

  • 0: Alarm disabled

  • 1: Alarm enabled

7

FMT

R/W

0

Hour format

  • 0: 24 hour/day format

  • 1: AM/PM hour format

6:5

OSEL

R/W

0

Output selection.

These bits are used to select the flag to be routed to RTC_OUT output.

  • 00: Output disabled

  • 01: Alarm output enabled

  • 10: Clock output is clk_spre (default: 1Hz)

  • 11: Clock output is clk_apre (default: 256Hz)

4

RSVD

R

-

Reserved

3

BYPSHAD

R/W

0

Bypass the shadow registers.

  • 0: Calendar values (when reading from RTC_TR) are taken from the shadow register, which are updated once every two RTCCLK cycles.

  • 1: Calendar values (when reading from RTC_TR) are taken directly from the calendar counters.

2

BKP

R/W

0

Backup

This bit can be written by the user to memorize whether the daylight saving time change has been performed or not.

1

SUB1H

R/W

0

Subtract one hour (winter time changes)

When this bit is set outside initialization mode, 1 hour is subtracted to the calendar time if the current hour is not 0, and this bit is always read as 0.

  • 0: No effect

  • 1: Subtract one hour to the current time

0

ADD1H

R/W

0

Add one hour (summer time changes)

When this bit is set outside initialization mode, 1 hour is added to the calendar time, and this bit is always read as 0.

  • 0: No effect

  • 1: Add one hour to the current time

REG_RTC_ISR

  • Name: RTC Init Mode and Status Register

  • Size: 32

  • Address offset: 008h

  • Read/write access: R/W

The ALMF/WUTF/DOVTHF bit can be written without unlocking the write protection. Two APB clock cycles

after programming it to 1, this bit is cleaned.

31:17 RSVD 16 RECALPF 15 DOVTHF 14:11 RSVD 10 WUTF 9 RSVD 8 ALMF 7 INIT 6 INITF 5 RSF 4 INITS 3 RSVD 2 WUTWF 1 WUTRSF 0 ALMWF

Bit

Symbol

Access

INI

Description

31:17

RSVD

R

-

Reserved

16

RECALPF

R

0

Recalibration pending flag

The RECALPF status flag is automatically set to '1' when software writes to the RTC_CALIBR register, indicating that the RTCCALIBR register is blocked. When the new calibration settings are taken into account, this bit returns to '0'. Refer to Re-calibration on-the-fly.

15

DOVTHF

R/W

0

Day over threshold flag

This flag is set by hardware when the Day in RTC_TR over the DAY_THRES set in RTC_CR register.

14:11

RSVD

R

-

Reserved

10

WUTF

R/W

0

Wakeup timer flag

This flag is set by hardware when the wakeup auto-reload counter reaches to.

This flag must be cleared by software at least 2 RTCCLK periods before WUTF is set to '1' again.

9

RSVD

R

-

Reserved

8

ALMF

R/W

0

Alarm flag

This flag is set by hardware when the time register (RTC_TR) matches the Alarm registers (RTC_ALMR1L and RTC_ALMR1H).

7

INIT

R/W

0

Initialization mode

  • 0: Free running mode.

  • 1: Initialization mode used to program time and date register (RTC_TR) and prescaler register (RTC_PRER). Counters are stopped and start counting from the new value when INIT is set.

6

INITF

R

0

Initialization flag.

When this bit is set to '1', the RTC is in initialization state, and the time, date, and prescaler registers can be updated.

  • 0: Calendar registers update is not allowed.

  • 1: Calendar registers update is allowed.

5

RSF

R/W

0

Registers synchronization flag.

This bit is set by hardware each time the calendar registers are copied into the shadow registers (RTC_TR). This bit is cleared by hardware in initialization mode or when in bypass shadow register mode (BYPSHAD=1). This bit can also be cleared by software.

It is cleared either by software or by hardware in initialization mode.

  • 0: Calendar shadow registers are not yet synchronized.

  • 1: Calendar shadow registers are synchronized.

4

INITS

R

0

This bit is set by hardware when the calendar day field is different from 0 (RTC domain reset state).

  • 0: Calendar has not been initialized.

  • 1: Calendar has been initialized.

3

RSVD

R

-

Reserved

2

WUTWF

R

0

Wakeup timer write flag

This flag is set by hardware when WUT value can be changed, after the WUTE bit has been set to '0' in RTC_CR.

  • 0: Wakeup timer configuration update not allowed except in initialization mode

  • 1: Wakeup timer configuration update allowed

1

WUTRSF

R/W

0

This bit is set by hardware each time the WUTE bit is copied into the shadow register. This bit is cleared by hardware in initialization mode. This bit can also be cleared by software.

It is cleared either by software or by hardware in initialization mode.

  • 0: WUTE is not yet synchronized.

  • 1: WUTE is synchronized.

0

ALMWF

R

0

Alarm write flag

This bit is set by hardware when Alarm values can be changed, after the ALME bit has been set to '0' in RTC_CR.

It is cleared by hardware when ALME bit has been set to '1' in RTC_CR.

  • 0: Alarm update not allowed

  • 1: Alarm update allowed

REG_RTC_PRER

  • Name: RTC Prescaler Register

  • Size: 32

  • Address offset: 00Ch

  • Read/write access: R/W

This register is write protected, and must be written in initialization mode only.

31:25 RSVD 24:16 PREDIV_A 15:9 RSVD 8:0 PREDIV_S

Bit

Symbol

Access

INI

Description

31:25

RSVD

R

-

Reserved

24:16

PREDIV_A

R/W

7Fh

Asynchronous prescaler factor

This is the asynchronous division factor: clk_apre freq = RTCCLK freq/(PREDIV_A + 1)

15:9

RSVD

R

-

Reserved

8:0

PREDIV_S

R/W

FFh

Synchronous prescaler factor

This is the synchronous division factor: clk_spre freq = clk_apre freq/(PREDIV_S + 1)

REG_RTC_CALIBR

  • Name: RTC Calibration Register

  • Size: 32

  • Address offset: 010h

  • Read/write access: R/W

This register is write protected, and can be dynamically configured when RTC is running.

31:19 RSVD 18:16 CALP 15 DCE 14 DCS 13:7 RSVD 6:0 DC

Bit

Symbol

Access

INI

Description

31:19

RSVD

R

-

Reserved

18:16

CALP

R/W

0

Calibration period

15

DCE

R/W

0

Digital calibration enable

  • 0: Digital calibration disabled

  • 1: Digital calibration enabled

14

DCS

R/W

0

Digital calibration signal

  • 0: Positive calibration, time update frequency is increased.

  • 1: Negative calibration, time update frequency is decreased.

13:7

RSVD

R

-

Reserved

6:0

DC

R/W

0

Digital calibration

REG_RTC_ALMR1L

  • Name: RTC Alarm 1 Register Low

  • Size: 32

  • Address offset: 014h

  • Read/write access: R/W

This register is write protected, and can be written only when ALMWF is set to 1 in RTC_ISR

register, or in initialization mode.

31:24 RSVD 23 MSK2 22 ALR_PM 21:20 ALR_HT 19:16 ALR_HU 15 MSK1 14:12 ALR_MNT 11:8 ALR_MNU 7 MSK0 6:4 ALR_ST 3:0 ALR_SU

Bit

Symbol

Access

INI

Description

31:24

RSVD

R

-

Reserved

23

MSK2

R/W

0

Alarm hour mask

  • 0: Alarm set if the hours match

  • 1: Hours don't care in Alarm comparison

22

ALR_PM

R/W

0

AM/PM notation.

  • 0: AM or 24-hour format

  • 1: PM

21:20

ALR_HT

R/W

0

Hour tens in BCD format

19:16

ALR_HU

R/W

0

Hour units in BCD format

15

MSK1

R/W

0

Alarm minutes mask.

  • 0: Alarm set if the minutes match

  • 1: Minutes don't care in Alarm comparison

14:12

ALR_MNT

R/W

0

Minute tens in BCD format

11:8

ALR_MNU

R/W

0

Minute units in BCD format

7

MSK0

R/W

0

Alarm seconds mask

  • 0: Alarm set if the seconds match

  • 1: Seconds don't care in Alarm comparison

6:4

ALR_ST

R/W

0

Second tens in BCD format

3:0

ALR_SU

R/W

0

Second units in BCD format

REG_RTC_ALMR1H

  • Name: RTC Alarm 1 Register High

  • Size: 32

  • Address offset: 018h

  • Read/write access: R/W

This register is write protected, and can be written only when ALMWF is set to 1 in RTC_ISR

register, or in initialization mode

31:10 RSVD 9 MSK3 8:0 ALR_DAY

Bit

Symbol

Access

INI

Description

31:10

RSVD

R

-

Reserved

9

MSK3

R/W

0

Alarm day mask

  • 0: Alarm set if the days match

  • 1: Days don't care in Alarm comparison

8:0

ALR_DAY

R/W

0

DAY in binary format

REG_RTC_WPR

  • Name: RTC Write Protection Register

  • Size: 32

  • Address offset: 01Ch

  • Read/write access: R/W

Write "0xCA" then write "0x53" to disable write protection, and write "0xFF" to enable write

protection.

31:8 RSVD 7:0 KEY

Bit

Symbol

Access

INI

Description

31:8

RSVD

R

-

Reserved

7:0

KEY

R/W

0

Write protection key

This byte is written by software. Refer to RTC register write protection for a description of how to unlock RTC register write protection.

REG_RTC_YEAR

  • Name: RTC Year Register

  • Size: 32

  • Address offset: 020h

  • Read/write access: R/W

This register is controlled by software.

31 RESTORE 30:8 RSVD 7:0 YEAR

Bit

Symbol

Access

INI

Description

31

RESTORE

R/W

0

Reset Flag. Indicates whether any reset conditions have occurred (except POR/PDR/BOD), so that the bit is set to '1' before reset, and then the global variable that determines whether the recovery time information is needed depending on whether the bit is '1'.

30:8

RSVD

R

-

Reserved

7:0

YEAR

R/W

0

Year in binary format

REG_RTC_WUTR

  • Name: RTC Wakeup Timer Register

  • Size: 32

  • Address offset: 024h

  • Read/write access: R/W

This register is used to set wakeup timer value.

31:17 RSVD 16:0 WUT

Bit

Symbol

Access

INI

Description

31:17

RSVD

R

-

Reserved

16:0

WUT

R/W

0

Wakeup auto-reload value bits

When the wakeup timer is enabled (WUTE is set to '1'), the WUTF flag is set every (WUT[16:0]+1) cycles. The first assertion of WUTF occurs between WUT and (WUT+1) cycles after WUTE is set.

REG_RTC_DUMMY

  • Name: RTC Dummy Register

  • Size: 32

  • Address offset: 028h

  • Read/write access: R/W

31:0 DUMMY

Bit

Symbol

Access

INI

Description

31:0

DUMMY

R/W

ffffh

Dummy register