QEI的内部定时器重装载值是怎么配置的??
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
找到了,是这个函数,他的函数原型如下:
QEIVelocityConfigure(uint32_t ui32Base, uint32_t ui32PreDiv,
uint32_t ui32Period)
{
//
// Check the arguments.
//
ASSERT((ui32Base == QEI0_BASE) || (ui32Base == QEI1_BASE));
ASSERT(!(ui32PreDiv & ~(QEI_CTL_VELDIV_M)));
ASSERT(ui32Period != 0);
//
// Set the velocity predivider.
//
HWREG(ui32Base + QEI_O_CTL) = ((HWREG(ui32Base + QEI_O_CTL) &
~(QEI_CTL_VELDIV_M)) | ui32PreDiv);
//
// Set the timer period.
//
HWREG(ui32Base + QEI_O_LOAD) = ui32Period - 1;
}