S32 SDK
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 
38 /*******************************************************************************
39  * Definitions
40  ******************************************************************************/
41 
47 typedef struct
48 {
50  uint16_t initialValue;
51  uint16_t finalValue;
53 
54 /*******************************************************************************
55  * API
56  ******************************************************************************/
57 
58 #if defined(__cplusplus)
59 extern "C" {
60 #endif
61 
76 status_t FTM_DRV_InitCounter(uint32_t instance,
77  const ftm_timer_param_t * timer);
78 
87 status_t FTM_DRV_CounterStart(uint32_t instance);
88 
96 status_t FTM_DRV_CounterStop(uint32_t instance);
97 
104 uint32_t FTM_DRV_CounterRead(uint32_t instance);
105 
106 #if defined(__cplusplus)
107 }
108 #endif
109  /* End of addtogroup ftm_mc_driver */
113 
114 #endif /* FTM_MC_DRIVER_H */
115 /*******************************************************************************
116  * EOF
117  ******************************************************************************/
status_t FTM_DRV_CounterStop(uint32_t instance)
Stops the FTM counter.
uint16_t initialValue
Definition: ftm_mc_driver.h:50
ftm_config_mode_t mode
Definition: ftm_mc_driver.h:49
FlexTimer driver timer mode configuration structure.
Definition: ftm_mc_driver.h:47
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:72