Missing PWMC register in LPC13xx LPCOpen V2.05

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Missing PWMC register in LPC13xx LPCOpen V2.05

427 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon May 12 03:08:19 MST 2014
There's no PWMC register in timer register struct of lpc_chip_13xx\inc\timer_13xx.h  :((
(lpcopen_2_05_lpcxpresso_nxp_lpcxpresso_1343 & lpcopen_2_05_lpcxpresso_nxp_lpcxpresso_1347)

typedef struct {
__IO uint32_t IR;
__IO uint32_t TCR;
__IO uint32_t TC;
__IO uint32_t PR;
__IO uint32_t PC;
__IO uint32_t MCR;
__IO uint32_t MR[4];
__IO uint32_t CCR;
__IO uint32_t CR[4];
__IO uint32_t EMR;
__I  uint32_t RESERVED0[12];
__IO uint32_t CTCR;
[color=#f00]//!!**!!added
__IO uint32_t PWMC;/*!< PWM Control Register */
[/color]} LPC_TIMER_T;


and of course no PWMC read/write functions:

//!!**!!added
STATIC INLINE void Chip_TIMER_PWMWrite(LPC_TIMER_T *pTMR, uint32_t pwmval)
{
pTMR->PWMC = pwmval;
}

//!!**!!added
STATIC INLINE uint32_t Chip_TIMER_PWMRead(LPC_TIMER_T *pTMR)
{
return pTMR->PWMC;
}


标签 (1)
0 项奖励
3 回复数

353 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hetii on Wed Jun 11 04:07:58 MST 2014
Hi there :)

In file timer_11xx.h for lpc_chip_11cxx_lib, this method to set PWMC register is still missing.

Regards.
0 项奖励

353 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue May 13 17:17:02 MST 2014
I'm a little bit confused by this function Naming  :~


STATIC INLINE uint32_t Chip_TIMER_[color=#f00]ReadPrescale[/color](LPC_TIMER_T *pTMR)
STATIC INLINE void Chip_TIMER_[color=#f00]PrescaleSet[/color](LPC_TIMER_T *pTMR, uint32_t prescale)
STATIC INLINE void Chip_TIMER_[color=#f00]SetMatch[/color](LPC_TIMER_T *pTMR, int8_t matchnum, uint32_t matchval)


Looking for a convention there how to add a timer write function...

Read function is named:

STATIC INLINE uint32_t Chip_TIMER_[color=#f00]ReadCount[/color](LPC_TIMER_T *pTMR)

Options:

STATIC INLINE void Chip_TIMER_[color=#f00]WriteCount[/color](LPC_TIMER_T *pTMR, uint32_t tcval)
STATIC INLINE void Chip_TIMER_[color=#f00]SetCount[/color](LPC_TIMER_T *pTMR, uint32_t tcval)
STATIC INLINE void Chip_TIMER_[color=#f00]CountWrite[/color](LPC_TIMER_T *pTMR, uint32_t tcval)
STATIC INLINE void Chip_TIMER_[color=#f00]CountSet[/color](LPC_TIMER_T *pTMR, uint32_t tcval)

Decided to use:

STATIC INLINE void Chip_TIMER_[color=#30f]CountWrite[/color](LPC_TIMER_T *pTMR, uint32_t tcval)


Just because it looks familiar 
0 项奖励

353 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon May 12 06:09:00 MST 2014
Hi R2D2,
Thanks for the feedback. We will add missing register and function. It has been added to bug tracker.
0 项奖励