S32 SDK
ewm_driver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 - 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  */
18 
23 #ifndef EWM_DRIVER_H
24 #define EWM_DRIVER_H
25 
26 #include "device_registers.h"
27 #include "status.h"
28 
34 /*******************************************************************************
35 * Definitions
36 ******************************************************************************/
37 
38 /*
39  * @brief EWM input pin configuration
40  * Configures if the input pin is enabled and when is asserted
41  * Implements : ewm_in_assert_logic_t_Class
42  */
43 typedef enum
44 {
49 
50 /*
51  * @brief EWM configuration structure
52  * This structure is used to configure the EWM prescaler, window, interrupt
53  * and input pin.
54  *
55  * Implements : ewm_init_config_t_Class
56  */
57 typedef struct
58 {
61  uint8_t prescaler;
62  uint8_t compareLow;
63  uint8_t compareHigh;
65 
66 /*******************************************************************************
67  * API
68  ******************************************************************************/
74 #if defined(__cplusplus)
75 extern "C" {
76 #endif
77 
110 status_t EWM_DRV_Init(uint32_t instance, const ewm_init_config_t * config);
111 
121 
131 void EWM_DRV_Refresh(uint32_t instance);
132 
142 
144 #if defined(__cplusplus)
145 }
146 #endif
147 
150 #endif /* EWM_DRIVER_H */
151 /*******************************************************************************
152  * EOF
153  ******************************************************************************/
ewm_in_assert_logic_t EWM_DRV_GetInputPinAssertLogic(uint32_t instance)
Get the Input pin assert logic.
Definition: ewm_driver.c:175
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:153
ewm_in_assert_logic_t
Definition: ewm_driver.h:43
ewm_in_assert_logic_t assertLogic
Definition: ewm_driver.h:59
uint8_t prescaler
Definition: ewm_driver.h:61
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:44
void EWM_DRV_GetDefaultConfig(ewm_init_config_t *config)
Init configuration structure to default values.
Definition: ewm_driver.c:131
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:63
uint8_t compareLow
Definition: ewm_driver.h:62
uint8_t compareHigh
Definition: ewm_driver.h:63