S32 SDK
ewm_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 - 2016, Freescale Semiconductor, Inc.
3  * Copyright 2016 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  */
18 
23 #ifndef EWM_DRIVER_H
24 #define EWM_DRIVER_H
25 
26 #include <stddef.h>
27 #include "ewm_hal.h"
28 #include "interrupt_manager.h"
29 #include "status.h"
30 
35  /*******************************************************************************
36  * Definitions
37  ******************************************************************************/
38 /*
39  * @brief EWM configuration structure
40  * This structure is used to configure the EWM prescaler, window, interrupt
41  * and input pin.
42  *
43  * Implements : ewm_init_config_t_Class
44  */
45 typedef struct
46 {
49  uint8_t prescaler;
50  uint8_t compareLow;
51  uint8_t compareHigh;
53 
54 /*******************************************************************************
55  * API
56  ******************************************************************************/
62 #if defined(__cplusplus)
63 extern "C" {
64 #endif
65 
98 status_t EWM_DRV_Init(uint32_t instance, const ewm_init_config_t * config);
99 
109 
119 void EWM_DRV_Refresh(uint32_t instance);
120 
121 
123 #if defined(__cplusplus)
124 }
125 #endif
126 
129 #endif /* EWM_DRIVER_H */
130 /*******************************************************************************
131  * EOF
132  ******************************************************************************/
void EWM_DRV_Refresh(uint32_t instance)
Refresh EWM. This method needs to be called within the window period specified by the Compare Low and...
Definition: ewm_driver.c:129
ewm_in_assert_logic_t assertLogic
Definition: ewm_driver.h:47
ewm_in_assert_logic_t
EWM input pin configuration Configures if the input pin is enabled and when is asserted Implements : ...
Definition: ewm_hal.h:43
uint8_t prescaler
Definition: ewm_driver.h:49
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:31
void EWM_DRV_GetDefaultConfig(ewm_init_config_t *config)
Init configuration structure to default values.
Definition: ewm_driver.c:107
status_t EWM_DRV_Init(uint32_t instance, const ewm_init_config_t *config)
Init EWM. This method initializes EWM instance to the configuration from the passed structure...
Definition: ewm_driver.c:61
uint8_t compareLow
Definition: ewm_driver.h:50
uint8_t compareHigh
Definition: ewm_driver.h:51