寄存器

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

RTL8721Dx:

Base Address:

  • TIMER0_REG : 0x41017000

  • TIMER1_REG : 0x41017200

  • TIMER2_REG : 0x41017400

  • TIMER3_REG : 0x41017600

  • TIMER4_REG : 0x41017800

  • TIMER5_REG : 0x41017A00

  • TIMER6_REG : 0x41017C00

  • TIMER7_REG : 0x41017E00

  • TIMER10_REG : 0x41100400

  • TIMER11_REG : 0x41100600

Name

Address offset

Access

Description

REG_TIM_EN

000h

R/W

Users can configure and observe the counter operation.

REG_TIM_CR

004h

R/W

This register is about the update operation.

REG_TIM_DIER

008h

R/W

This is the interrupt enable register.

REG_TIM_SR

00Ch

R/W

This register is about timer interrupt and update status.

REG_TIM_EGR

010h

R/W

This register is about update generation, and is user defined.

REG_TIM_CNT

014h

R

This is the timer count register.

REG_TIM_ARR

01Ch

R/W

This is the auto-reload value register.

REG_TIM_SEC

020h

R/W

This register is about security status.

REG_TIM_BASIC_DUMMY

024h

R/W

REG_TIM_EN

  • Name: TIM enable register

  • Size: 32

  • Address offset: 000h

  • Read/write access: R/W

Users can configure and observe the counter operation.

31:17 RSVD 16 CNT_EN 15:9 RSVD 8 CNT_RUN 7:2 RSVD 1 CNT_STOP 0 CNT_START

Bit

Symbol

Access

INI

Description

31:17

RSVD

R

-

Reserved

16

CNT_EN

R

0x0

Counter working status

  • 0: Counter is stopped

  • 1: Counter is working

15:9

RSVD

R

-

Reserved

8

CNT_RUN

R

0x0

Counter run status

  • 0: Counter is disabled

  • 1: Counter is enabled

7:2

RSVD

R

-

Reserved

1

CNT_STOP

R/W

0x0

Disable the counter

Poll CNT_RUN to see the counter status. If CNT_RUN is 0, it means that the counter has been disabled internally.

0

CNT_START

R/W

0x0

Enable the counter

Poll CNT_RUN to see the counter status. If CNT_RUN is 1, it means that the counter has been enabled internally.

REG_TIM_CR

  • Name: TIM control register

  • Size: 32

  • Address offset: 004h

  • Read/write access: R/W

This register is about the update operation.

31:5 RSVD 4 ARPE 3 RSVD 2 URS 1 UDIS 0 RSVD

Bit

Symbol

Access

INI

Description

31:5

RSVD

R

-

Reserved

4

ARPE

R/W

0x0

Enable auto-reload preloading

  • 0: TIM_ARR register is not buffered.

  • 1: TIM_ARR register is buffered.

3

RSVD

R

-

Reserved

2

URS

R/W

0x0

Update request source

  • 0: Counter overflow and setting the UG bit

  • 1: Counter overflow

1

UDIS

R/W

0x0

Disable UEV

Shadow registers keep their values. Otherwise, buffered registers are then loaded with their preload values when UEV happens.

0

RSVD

R

-

Reserved

REG_TIM_DIER

  • Name: TIM interrupt enable register

  • Size: 32

  • Address offset: 008h

  • Read/write access: R/W

This is the interrupt enable register.

31:1 RSVD 0 UIE

Bit

Symbol

Access

INI

Description

31:1

RSVD

R

-

Reserved

0

UIE

R/W

0x0

Enable update interrupt

REG_TIM_SR

  • Name: TIM status register

  • Size: 32

  • Address offset: 00Ch

  • Read/write access: R/W

This register is about timer interrupt and update status.

31 UG_DONE 30:1 RSVD 0 UIF

Bit

Symbol

Access

INI

Description

31

UG_DONE

R

0x1

UG operation status

This bit is cleared by hardware when the UG bit in the TIMx_EGR register is set. When the UG operation is done, hardware set this bit to '1'. So, software can poll this bit to see the UG operation status.

30:1

RSVD

R

-

Reserved

0

UIF

R/W

0x0

Update interrupt flag

REG_TIM_EGR

  • Name: TIM event generation register

  • Size: 32

  • Address offset: 010h

  • Read/write access: R/W

This register is about update generation, and is user defined.

31:1 RSVD 0 UG

Bit

Symbol

Access

INI

Description

31:1

RSVD

R

-

Reserved

0

UG

R/W

0x0

Update generation

Re-initialize the counter and generate an update of registers. Note that the prescaler counter is cleared too. (anyway the prescaler ratio is not affected)

REG_TIM_CNT

  • Name: TIM counter register

  • Size: 32

  • Address offset: 014h

  • Read/write access: R

This is the timer count register.

31:0 CNT

Bit

Symbol

Access

INI

Description

31:0

CNT

R

0x0

Counter value

REG_TIM_ARR

  • Name: TIM auto-reload register

  • Size: 32

  • Address offset: 01Ch

  • Read/write access: R/W

This is the auto-reload value register.

31:0 ARR

Bit

Symbol

Access

INI

Description

31:0

ARR

R/W

0xFFFFFFFF

The value to be loaded in the actual auto-reload register. It can be preloaded by setting ARPE bit in TIM_CR.

REG_TIM_SEC

  • Name: TIM security control register

  • Size: 32

  • Address offset: 020h

  • Read/write access: R/W

This register is about security status.

31:1 RSVD 0 SEC

Bit

Symbol

Access

INI

Description

31:1

RSVD

R

-

Reserved

0

SEC

R/W

0x0

Secure timer enable

  • 0: This is a non-secure timer. All its registers except TIMx_SEC can be accessed from both secure and non-secure address. As a result, both secure and non-secure code can access it.

  • 1: This is a secure timer. All its registers can only be accessed from secure address. As a result, only secure code can access it. Non-secure code can't access it through non-secure address.

REG_TIM_BASIC_DUMMY

  • Name: Timer Basic Dummy Register

  • Size: 32

  • Address offset: 024h

  • Read/write access: R/W

31:0 DUMMY

Bit

Symbol

Access

INI

Description

31:0

DUMMY

R/W

ffffh

Dummy register