Kinetis SDK v.2.0 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
The KSDK provides a peripheral driver for the EWM module of Kinetis devices.
Files | |
file | fsl_ewm.h |
Data Structures | |
struct | ewm_config_t |
Describes ewm clock source. More... | |
Enumerations | |
enum | _ewm_interrupt_enable_t { kEWM_InterruptEnable = EWM_CTRL_INTEN_MASK } |
EWM interrupt configuration structure, default settings all disabled. More... | |
enum | _ewm_status_flags_t { kEWM_RunningFlag = EWM_CTRL_EWMEN_MASK } |
EWM status flags. More... | |
Driver version | |
#define | FSL_EWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
EWM driver version 2.0.1. More... | |
EWM Initialization and De-initialization | |
void | EWM_Init (EWM_Type *base, const ewm_config_t *config) |
Initializes the EWM peripheral. More... | |
void | EWM_Deinit (EWM_Type *base) |
Deinitializes the EWM peripheral. More... | |
void | EWM_GetDefaultConfig (ewm_config_t *config) |
Initializes the EWM configuration structure. More... | |
EWM functional Operation | |
static void | EWM_EnableInterrupts (EWM_Type *base, uint32_t mask) |
Enables the EWM interrupt. More... | |
static void | EWM_DisableInterrupts (EWM_Type *base, uint32_t mask) |
Disables the EWM interrupt. More... | |
static uint32_t | EWM_GetStatusFlags (EWM_Type *base) |
Gets EWM all status flags. More... | |
void | EWM_Refresh (EWM_Type *base) |
Service EWM. More... | |
struct ewm_config_t |
Data structure for EWM configuration.
This structure is used to configure the EWM.
Data Fields | |
bool | enableEwm |
Enable EWM module. | |
bool | enableEwmInput |
Enable EWM_in input. | |
bool | setInputAssertLogic |
EWM_in signal assertion state. | |
bool | enableInterrupt |
Enable EWM interrupt. | |
uint8_t | compareLowValue |
Compare low register value. | |
uint8_t | compareHighValue |
Compare high register value. | |
#define FSL_EWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
enum _ewm_status_flags_t |
void EWM_Init | ( | EWM_Type * | base, |
const ewm_config_t * | config | ||
) |
This function is used to initialize the EWM. After calling, the EWM runs immediately according to the configuration. Note that except for interrupt enable control bit, other control bits and registers are write once after a CPU reset. Modifying them more than once generates a bus transfer error.
Example:
base | EWM peripheral base address |
config | The configuration of EWM |
void EWM_Deinit | ( | EWM_Type * | base | ) |
This function is used to shut down the EWM.
base | EWM peripheral base address |
void EWM_GetDefaultConfig | ( | ewm_config_t * | config | ) |
This function initializes the EWM configure structure to default values. The default values are:
config | Pointer to EWM configuration structure. |
|
inlinestatic |
This function enables the EWM interrupt.
base | EWM peripheral base address |
mask | The interrupts to enable The parameter can be combination of the following source if defined:
|
|
inlinestatic |
This function enables the EWM interrupt.
base | EWM peripheral base address |
mask | The interrupts to disable The parameter can be combination of the following source if defined:
|
|
inlinestatic |
This function gets all status flags.
Example for getting Running Flag:
base | EWM peripheral base address |
void EWM_Refresh | ( | EWM_Type * | base | ) |
This function reset EWM counter to zero.
base | EWM peripheral base address |