S32 SDK
ftm_oc_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_OC_DRIVER_H
26 #define FTM_OC_DRIVER_H
27 
28 #include "ftm_common.h"
29 
38 /*******************************************************************************
39  * Definitions
40  ******************************************************************************/
41 
47 typedef enum
48 {
54 
60 typedef enum
61 {
65 
71 typedef struct
72 {
73  uint8_t hwChannelId;
75  uint16_t comparedValue;
79 
85 typedef struct
86 {
89  uint16_t maxCountValue;
92 
93 /*******************************************************************************
94  * API
95  ******************************************************************************/
96 
97 #if defined(__cplusplus)
98 extern "C" {
99 #endif
100 
115 status_t FTM_DRV_InitOutputCompare(uint32_t instance,
116  const ftm_output_cmp_param_t * param);
117 
127 status_t FTM_DRV_DeinitOutputCompare(uint32_t instance,
128  const ftm_output_cmp_param_t * param);
129 
148  uint8_t channel,
149  uint16_t nextComparematchValue,
151  bool softwareTrigger);
152 
153 #if defined(__cplusplus)
154 }
155 #endif
156  /* End of addtogroup ftm_oc_driver */
160 
161 #endif /* FTM_OC_DRIVER_H */
162 /*******************************************************************************
163  * EOF
164  ******************************************************************************/
FlexTimer driver PWM parameters.
Definition: ftm_oc_driver.h:71
ftm_config_mode_t mode
Definition: ftm_oc_driver.h:88
ftm_output_compare_mode_t chMode
Definition: ftm_oc_driver.h:74
ftm_output_compare_mode_t
FlexTimer Mode configuration for output compare mode.
Definition: ftm_oc_driver.h:47
status_t FTM_DRV_InitOutputCompare(uint32_t instance, const ftm_output_cmp_param_t *param)
Configures the FTM to generate timed pulses(Output compare mode).
Definition: ftm_oc_driver.c:45
ftm_output_compare_update_t
FlexTimer input capture type of the next output compare value.
Definition: ftm_oc_driver.h:60
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:44
const ftm_output_cmp_ch_param_t * outputChannelConfig
Definition: ftm_oc_driver.h:90
FlexTimer driver PWM parameters.
Definition: ftm_oc_driver.h:85
status_t FTM_DRV_UpdateOutputCompareChannel(uint32_t instance, uint8_t channel, uint16_t nextComparematchValue, ftm_output_compare_update_t update, bool softwareTrigger)
Sets the next compare match value based on the current counter value.
ftm_config_mode_t
FlexTimer operation mode.
Definition: ftm_common.h:72
status_t FTM_DRV_DeinitOutputCompare(uint32_t instance, const ftm_output_cmp_param_t *param)
Disables compare match output control and clears FTM timer configuration.