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 
35 /*******************************************************************************
36  * Definitions
37  ******************************************************************************/
38 
44 typedef enum
45 {
51 
57 typedef enum
58 {
62 
68 typedef struct
69 {
70  uint8_t hwChannelId;
72  uint16_t comparedValue;
76 
82 typedef struct
83 {
86  uint16_t maxCountValue;
89 
90 /*******************************************************************************
91  * API
92  ******************************************************************************/
93 
94 #if defined(__cplusplus)
95 extern "C" {
96 #endif
97 
112 status_t FTM_DRV_InitOutputCompare(uint32_t instance,
113  const ftm_output_cmp_param_t * param);
114 
124 status_t FTM_DRV_DeinitOutputCompare(uint32_t instance,
125  const ftm_output_cmp_param_t * param);
126 
145  uint8_t channel,
146  uint16_t nextComparematchValue,
148  bool softwareTrigger);
149 
150 #if defined(__cplusplus)
151 }
152 #endif
153  /* End of addtogroup ftm_oc_driver */
157 
158 #endif /* FTM_OC_DRIVER_H */
159 /*******************************************************************************
160  * EOF
161  ******************************************************************************/
FlexTimer driver PWM parameters.
Definition: ftm_oc_driver.h:68
ftm_config_mode_t mode
Definition: ftm_oc_driver.h:85
ftm_output_cmp_ch_param_t * outputChannelConfig
Definition: ftm_oc_driver.h:87
ftm_output_compare_mode_t chMode
Definition: ftm_oc_driver.h:71
ftm_output_compare_mode_t
FlexTimer Mode configuration for output compare mode.
Definition: ftm_oc_driver.h:44
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:57
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:44
FlexTimer driver PWM parameters.
Definition: ftm_oc_driver.h:82
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:221
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.