ftm_mc_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
7  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
11  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
12  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
14  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
16  * THE POSSIBILITY OF SUCH DAMAGE.
17  */
25 #ifndef FTM_MC_DRIVER_H
26 #define FTM_MC_DRIVER_H
27 
28 #include "ftm_common.h"
29 
35 /*******************************************************************************
36  * Definitions
37  ******************************************************************************/
38 
44 typedef struct
45 {
47  uint16_t initialValue;
48  uint16_t finalValue;
50 
51 /*******************************************************************************
52  * API
53  ******************************************************************************/
54 
55 #if defined(__cplusplus)
56 extern "C" {
57 #endif
58 
73 status_t FTM_DRV_InitCounter(uint32_t instance,
74  const ftm_timer_param_t * timer);
75 
84 status_t FTM_DRV_CounterStart(uint32_t instance);
85 
93 status_t FTM_DRV_CounterStop(uint32_t instance);
94 
101 uint32_t FTM_DRV_CounterRead(uint32_t instance);
102 
103 #if defined(__cplusplus)
104 }
105 #endif
106  /* End of addtogroup ftm_mc_driver */
110 
111 #endif /* FTM_MC_DRIVER_H */
112 /*******************************************************************************
113  * EOF
114  ******************************************************************************/
status_t FTM_DRV_CounterStop(uint32_t instance)
Stops the FTM counter.
uint16_t initialValue
Definition: ftm_mc_driver.h:47
ftm_config_mode_t mode
Definition: ftm_mc_driver.h:46
FlexTimer driver timer mode configuration structure.
Definition: ftm_mc_driver.h:44
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:44
status_t FTM_DRV_CounterStart(uint32_t instance)
Starts the FTM counter.
uint32_t FTM_DRV_CounterRead(uint32_t instance)
Reads back the current value of the FTM counter.
status_t FTM_DRV_InitCounter(uint32_t instance, const ftm_timer_param_t *timer)
Initialize the FTM counter.
Definition: ftm_mc_driver.c:53
ftm_config_mode_t
FlexTimer operation mode.
Definition: ftm_common.h:221