임베디드 OS 개발 프로젝트 CH7
In CH7, I will examine the timer hadware and the interrupt related to this.
RealviewPB uses SP804 Timer and my goal is to implement "delay()" using it.
To use a new hardware, fisrt to do is making a register struct.
레지스터
- timerxload register
- This is a value used to reload to the counter at the next rising edge.
- timerxvalue register
- This register decreases starting from the value of the timerxload register and invokes interrupt when its value be 0.
- Timercontrol register`
ypedef union TimerXControl_t
{
uint32_t all;
struct {
uint32_t OneShot:1; //0
uint32_t TimerSize:1; //1
uint32_t TimerPre:2; //3:2
uint32_t Reserved0:1; //4
uint32_t IntEnable:1; //5
uint32_t TimerMode:1; //6
uint32_t TimerEn:1; //7
uint32_t Reserved1:24; //31:8
} bits;
} TimerXControl_t;
- b0 : default(wrapping mode)
- b1 : Timer off after an interrupt
- [1]: Timer size
- b0 : 16 bits timer- b1 : 32 bits timer
- [3:2] : TimePre
- Timer interval- b00 : a clock
- b01 : 16 clocks
- b10 : 256 clocks
- [5] : Interrupt Enable bit
- b0 : disable- b1 : enable
- [6] : Mode bit
- b0 : free running- b1 : Periodic
- [7] : enabla bit
- b0 : timer disable- b1 : timer enable
Author And Source
이 문제에 관하여(임베디드 OS 개발 프로젝트 CH7), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@dddd/임베디드-OS-개발-프로젝트-CH7저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)