143 #ifndef ti_drivers_timer_GPTIMERCC26XX__include 144 #define ti_drivers_timer_GPTIMERCC26XX__include 150 #include <ti/drivers/dpl/HwiP.h> 152 #include <ti/devices/DeviceFamily.h> 153 #include DeviceFamily_constructPath(inc/hw_gpt.h) 154 #include DeviceFamily_constructPath(driverlib/event.h) 155 #include DeviceFamily_constructPath(driverlib/ioc.h) 156 #include DeviceFamily_constructPath(driverlib/timer.h) 163 #define GPT_MODE_ONESHOT_UP GPT_MODE_ONESHOT 164 #define GPT_MODE_PERIODIC_UP GPT_MODE_PERIODIC 165 #define GPT_MODE_EDGE_COUNT_UP GPT_MODE_EDGE_COUNT 166 #define GPT_MODE_EDGE_TIME_UP GPT_MODE_EDGE_TIME 174 GPT_CONFIG_32BIT = GPT_CFG_CFG_32BIT_TIMER,
175 GPT_CONFIG_16BIT = GPT_CFG_CFG_16BIT_TIMER,
189 GPT_MODE_ONESHOT = GPT_TAMR_TAMR_ONE_SHOT | GPT_TAMR_TAMIE,
191 GPT_MODE_PERIODIC = GPT_TAMR_TAMR_PERIODIC | GPT_TAMR_TAMIE,
193 GPT_MODE_EDGE_COUNT = GPT_TAMR_TAMR_CAPTURE | GPT_TAMR_TACM_EDGCNT,
195 GPT_MODE_EDGE_TIME = GPT_TAMR_TAMR_CAPTURE | GPT_TAMR_TACM_EDGTIME,
198 GPT_MODE_PWM = GPT_TAMR_TAMR_PERIODIC | GPT_TAMR_TAPWMIE_EN | GPT_TAMR_TAAMS_PWM | GPT_TAMR_TACM_EDGCNT |
199 GPT_TAMR_TAPLO_CCP_ON_TO,
210 GPT_INT_TIMEOUT = 1 << 0,
211 GPT_INT_CAPTURE_MATCH = 1 << 1,
212 GPT_INT_CAPTURE = 1 << 2,
213 GPT_INT_MATCH = 1 << 3,
217 #define GPT_NUM_INTS 4 231 #define GPT_PARTS_COUNT 2 243 GPT_PIN_0A = IOC_PORT_MCU_PORT_EVENT0,
244 GPT_PIN_0B = IOC_PORT_MCU_PORT_EVENT1,
245 GPT_PIN_1A = IOC_PORT_MCU_PORT_EVENT2,
246 GPT_PIN_1B = IOC_PORT_MCU_PORT_EVENT3,
247 GPT_PIN_2A = IOC_PORT_MCU_PORT_EVENT4,
248 GPT_PIN_2B = IOC_PORT_MCU_PORT_EVENT5,
249 GPT_PIN_3A = IOC_PORT_MCU_PORT_EVENT6,
250 GPT_PIN_3B = IOC_PORT_MCU_PORT_EVENT7,
259 GPTimerCC26XX_DEBUG_STALL_OFF = 0,
260 GPTimerCC26XX_DEBUG_STALL_ON,
270 GPTimerCC26XX_DIRECTION_DOWN = 0,
271 GPTimerCC26XX_DIRECTION_UP,
285 GPTimerCC26XX_SET_MATCH_NEXT_CLOCK = 0,
286 GPTimerCC26XX_SET_MATCH_ON_TIMEOUT,
296 GPTimerCC26XX_POS_EDGE = GPT_CTL_TAEVENT_POS,
297 GPTimerCC26XX_NEG_EDGE = GPT_CTL_TAEVENT_NEG,
298 GPTimerCC26XX_BOTH_EDGES = GPT_CTL_TAEVENT_BOTH,
308 typedef uint16_t GPTimerCC26XX_IntMask;
311 typedef uint32_t GPTimerCC26XX_Value;
314 typedef void (*GPTimerCC26XX_HwiFxn)(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask);
377 bool isOpen[GPT_PARTS_COUNT];
378 HwiP_Struct hwi[GPT_PARTS_COUNT];
379 GPTimerCC26XX_HwiFxn hwiCallbackFxn[GPT_PARTS_COUNT];
380 volatile bool powerConstraint[GPT_PARTS_COUNT];
404 struct GPTimerCC26XX_Config
408 GPTimerCC26XX_Part timerPart;
599 GPTimerCC26XX_HwiFxn callback,
600 GPTimerCC26XX_IntMask intMask);
700 static inline GPTimerCC26XX_PinMux GPTimerCC26XX_getPinMux(GPTimerCC26XX_Handle handle)
702 return handle->hwAttrs->
pinMux;
void GPTimerCC26XX_setArg(GPTimerCC26XX_Handle handle, void *arg)
Function to set a custom argument.
GPTimerCC26XX_DebugMode debugStallMode
Definition: GPTimerCC26XX.h:425
GPTimerCC26XX_DebugMode
Definitions for controlling timer debug stall mode.
Definition: GPTimerCC26XX.h:257
struct GPTimerCC26XX_Object GPTimerCC26XX_Object
GPTimer26XX Object.
uint8_t intNum
Definition: GPTimerCC26XX.h:341
uint32_t arg
Definition: GPTimerCC26XX.h:381
uint8_t intPriority
Definition: GPTimerCC26XX.h:351
GPTimerCC26XX Parameters.
Definition: GPTimerCC26XX.h:419
void GPTimerCC26XX_configureDebugStall(GPTimerCC26XX_Handle handle, GPTimerCC26XX_DebugMode mode)
Function to control timer debug stall mode. When enabled, the timer will stop when the debugger halts...
GPTimerCC26XX_Mode
Definitions for supported GPTimer modes. Driver code assumes only modes using prescaler as timer exte...
Definition: GPTimerCC26XX.h:186
void GPTimerCC26XX_setLoadValue(GPTimerCC26XX_Handle handle, GPTimerCC26XX_Value loadValue)
Function to set load value of the specified GPTimer. Function can be called while GPTimer is running...
void GPTimerCC26XX_disableInterrupt(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask)
Function to disable a set of GPTimer interrupt sources.
GPTimerCC26XX_Direction
Definitions for controlling timer counting direction. Setting the Direction for PWM operation has no ...
Definition: GPTimerCC26XX.h:268
void GPTimerCC26XX_unregisterInterrupt(GPTimerCC26XX_Handle handle)
Function to disable a CPU interrupt for a given timer handle and disable all interrupt sources for co...
void GPTimerCC26XX_registerInterrupt(GPTimerCC26XX_Handle handle, GPTimerCC26XX_HwiFxn callback, GPTimerCC26XX_IntMask intMask)
Function to register a CPU interrupt for a given timer handle and enable a set of timer interrupt sou...
uint8_t powerMngrId
Definition: GPTimerCC26XX.h:353
GPTimerCC26XX_PinMux
Definitions for input / output ports in IO controller to connect GPTimer to a pin. Used in gptimerCC26xxHWAttrs for static timer configuration PIN driver is used to mux a pin to the timer.
Definition: GPTimerCC26XX.h:241
void GPTimerCC26XX_setCaptureEdge(GPTimerCC26XX_Handle handle, GPTimerCC26XX_Edge edge)
Function to set which input edge the GPTimer capture should use. Applies to edge-count and edge-time ...
void GPTimerCC26XX_close(GPTimerCC26XX_Handle handle)
Function to close a GPTimer peripheral specified by the GPTimer handle. Closing timer will releae dep...
uint32_t baseAddr
Definition: GPTimerCC26XX.h:339
struct GPTimerCC26XX_HWAttrs GPTimerCC26XX_HWAttrs
GPTimer26XX Hardware attributes.
GPTimerCC26XX_Mode mode
Definition: GPTimerCC26XX.h:422
struct GPTimerCC26XX_Params GPTimerCC26XX_Params
GPTimerCC26XX Parameters.
GPTimerCC26XX_Value GPTimerCC26XX_getFreeRunValue(GPTimerCC26XX_Handle handle)
Function to retrieve the current free-running value of timer.
GPTimerCC26XX_SetMatchTiming matchTiming
Definition: GPTimerCC26XX.h:423
GPTimer26XX Object.
Definition: GPTimerCC26XX.h:374
GPTimerCC26XX_Part timer
Definition: GPTimerCC26XX.h:355
GPTimerCC26XX_Direction direction
Definition: GPTimerCC26XX.h:424
GPTimer Global configuration.
Definition: GPTimerCC26XX.h:404
GPTimerCC26XX_Edge
Definitions for controlling edges used for timer capture. Used in GPTimer edge-time and edge-count mo...
Definition: GPTimerCC26XX.h:294
GPTimerCC26XX_Width width
Definition: GPTimerCC26XX.h:376
GPTimer26XX Hardware attributes.
Definition: GPTimerCC26XX.h:336
void GPTimerCC26XX_start(GPTimerCC26XX_Handle handle)
Function to start the specified GPTimer with current settings.
GPTimerCC26XX_Value GPTimerCC26XX_getValue(GPTimerCC26XX_Handle handle)
Function to retrieve the current value of timer This returns the value of the timer in all modes exce...
void GPTimerCC26XX_setMatchValue(GPTimerCC26XX_Handle handle, GPTimerCC26XX_Value matchValue)
Function to set match value of the specified GPTimer. Function can be called while GPTimer is running...
GPTimerCC26XX_Handle GPTimerCC26XX_open(unsigned int index, const GPTimerCC26XX_Params *params)
This function opens a given GPTimer peripheral. Will set dependency on timer and configure it into sp...
GPTimerCC26XX_PinMux pinMux
Definition: GPTimerCC26XX.h:357
GPTimerCC26XX_Part
Definitions for GPTimer parts (Timer A / Timer B). Used in GPTimer configuration structure GPTimerCC2...
Definition: GPTimerCC26XX.h:225
GPTimerCC26XX_Interrupt
Definitions for supported GPTimer interrupts. GPTimerCC26XX_IntMask arguments should be a bit vector ...
Definition: GPTimerCC26XX.h:208
void GPTimerCC26XX_stop(GPTimerCC26XX_Handle handle)
Function to stop the specified GPTimer.
GPTimerCC26XX_Width
Definitions for specifying the GPTimer configuration (width)
Definition: GPTimerCC26XX.h:172
GPTimerCC26XX_Width width
Definition: GPTimerCC26XX.h:421
void GPTimerCC26XX_Params_init(GPTimerCC26XX_Params *params)
Function to initialize the GPTimerCC26XX_Params struct to its default values.
void GPTimerCC26XX_enableInterrupt(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask)
Function to enable a set of GPTimer interrupt sources. The interrupt to the CPU must be enabled using...
uint32_t GPTimerCC26XX_getArg(GPTimerCC26XX_Handle handle)
Function to get a custom argument.
GPTimerCC26XX_SetMatchTiming
Definitions for new value loading behaviour.
Definition: GPTimerCC26XX.h:283