SimpleLink MCU SDK Driver APIs  tidrivers_msp43x_3_01_01_03
TimerMSP432.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
58 #ifndef ti_driver_timer_TimerMSP432__include
59 #define ti_driver_timer_TimerMSP432__include
60 
61 #ifdef __cplusplus
62 extern "C"
63 {
64 #endif
65 
66 #include <stdbool.h>
67 #include <stdint.h>
68 #include <ti/drivers/Timer.h>
69 #include <ti/drivers/dpl/HwiP.h>
70 #include <ti/drivers/dpl/SemaphoreP.h>
71 
91 typedef struct _TimerMSP432_HWAttr
92 {
93  uint32_t timerBaseAddress;
94  uint32_t clockSource;
95  uint32_t intNum;
96  uint32_t intPriority;
98 
105 typedef struct TimerMSP432_Object
106 {
109  HwiP_Params hwiParams;
110  HwiP_Handle hwiHandle;
112  SemaphoreP_Handle timerSem;
115 
116 /* Function Declarations */
117 extern bool TimerMSP432_allocateTimerResource(uint32_t timerBase);
118 extern void TimerMSP432_close(Timer_Handle handle);
119 extern void TimerMSP432_freeTimerResource(uint32_t timerBase);
120 extern void TimerMSP432_init(Timer_Handle handle);
122 extern int_fast16_t TimerMSP432_Timer_A_control(Timer_Handle handle,
123  uint_fast16_t cmd, void *arg);
124 extern uint32_t TimerMSP432_Timer_A_getCount(Timer_Handle handle);
125 extern void TimerMSP432_Timer_A_start(Timer_Handle handle);
126 extern void TimerMSP432_Timer_A_stop(Timer_Handle handle);
127 extern int_fast16_t TimerMSP432_Timer32_control(Timer_Handle handle,
128  uint_fast16_t cmd, void *arg);
129 extern uint32_t TimerMSP432_Timer32_getCount(Timer_Handle handle);
130 extern void TimerMSP432_Timer32_start(Timer_Handle handle);
131 extern void TimerMSP432_Timer32_stop(Timer_Handle handle);
132 
133 /* External Hardware Configuration Variables */
135 extern const uint8_t Timer_count;
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* ti_driver_timer_TimerMSP432__include */
uint32_t TimerMSP432_Timer32_getCount(Timer_Handle handle)
SemaphoreP_Handle timerSem
Definition: TimerMSP432.h:112
int_fast16_t TimerMSP432_Timer32_control(Timer_Handle handle, uint_fast16_t cmd, void *arg)
void TimerMSP432_Timer_A_start(Timer_Handle handle)
Timer Parameters.
Definition: Timer.h:231
The definition of a Timer function table that contains the required set of functions to control a spe...
Definition: Timer.h:288
Timer_Config * config
Definition: TimerMSP432.h:108
Timer_Mode timerMode
Definition: TimerMSP432.h:113
struct _TimerMSP432_HWAttr TimerMSP432_HWAttrs
TimerMSP432 Hardware Attributes.
TimerMSP432_Object timerMSP432Objects[]
Timer_Handle TimerMSP432_open(Timer_Handle handle, Timer_Params *params)
Timer_CallBackFxn callBack
Definition: TimerMSP432.h:111
Definition: Timer.h:306
enum Timer_Mode_ Timer_Mode
Timer mode enum.
uint32_t intPriority
Definition: TimerMSP432.h:96
uint32_t clockSource
Definition: TimerMSP432.h:94
void TimerMSP432_Timer_A_stop(Timer_Handle handle)
void TimerMSP432_close(Timer_Handle handle)
Timer_FxnTable TimerMSP432_Timer32_fxnTable
Timer_FxnTable TimerMSP432_Timer_A_fxnTable
uint32_t timerBaseAddress
Definition: TimerMSP432.h:93
Timer driver interface.
bool resourceAvailable
Definition: TimerMSP432.h:107
TimerMSP432 Object Driver specific structure that takes care of various driver parameters such as har...
Definition: TimerMSP432.h:105
const uint8_t Timer_count
void TimerMSP432_freeTimerResource(uint32_t timerBase)
int_fast16_t TimerMSP432_Timer_A_control(Timer_Handle handle, uint_fast16_t cmd, void *arg)
uint32_t intNum
Definition: TimerMSP432.h:95
bool TimerMSP432_allocateTimerResource(uint32_t timerBase)
void TimerMSP432_init(Timer_Handle handle)
HwiP_Handle hwiHandle
Definition: TimerMSP432.h:110
HwiP_Params hwiParams
Definition: TimerMSP432.h:109
void(* Timer_CallBackFxn)(Timer_Handle handle)
Timer callback function.
Definition: Timer.h:222
TimerMSP432 Hardware Attributes.
Definition: TimerMSP432.h:91
uint32_t TimerMSP432_Timer_A_getCount(Timer_Handle handle)
struct TimerMSP432_Object TimerMSP432_Object
TimerMSP432 Object Driver specific structure that takes care of various driver parameters such as har...
void TimerMSP432_Timer32_start(Timer_Handle handle)
void TimerMSP432_Timer32_stop(Timer_Handle handle)
Copyright 2016, Texas Instruments Incorporated