Part Number:CC2640R2F
GPTimerCC26XX_Params params;
GPTimerCC26XX_Params_init(¶ms);
params.width = GPT_CONFIG_16BIT;//默认是16位的,我看手册里面可以设置成24位模式,怎么设置成24位模式呢?
params.mode = GPT_MODE_EDGE_TIME_UP;
params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
hTimer = GPTimerCC26XX_open(Board_GPTIMER0A, ¶ms);
if(hTimer == NULL) {
//Log_error0("Failed to open GPTimer");
//Task_exit();
}
GPTimerCC26XX_PinMux pinMux = GPTimerCC26XX_getPinMux(hTimer);
PINCC26XX_setMux(PinMyHandle, IOID_11, pinMux);
// GPTimerCC26XX_setLoadValue(hTimer, 2400);
// GPTimerCC26XX_setMatchValue(hTimer, 1200);
GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_CAPTURE);
GPTimerCC26XX_disableInterrupt(hTimer, GPT_INT_CAPTURE);
GPTimerCC26XX_setCaptureEdge(hTimer, GPTimerCC26XX_BOTH_EDGES);
GPTimerCC26XX_start(hTimer);
GPTimerCC26XX_enableInterrupt(hTimer, GPT_INT_CAPTURE);
Kevin Qiu1:
风吹我衣 说:我看手册里面可以设置成24位模式,怎么设置成24位模式呢?
在16位模式下,可以通过预分频器达到16+8=24位的分辨率
The GPTimer can be used in two different configurations. In 32-bit mode the timer will act as a full-width timer and is controlled using the Timer A unit. In split (16-bit) mode the timer is split into 2x 16-bit timers. In 16-bit mode a prescaler is available for each timer unit, effectively increasing the resolution in this mode to 24-bit. All supported modes by driver in split configuration uses prescaler as timer extension.