Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
The section describes the programming interface of the EWM HAL driver.
Data Structures | |
struct | ewm_config_t |
Data structure for EWM initialize. More... | |
Enumerations | |
enum | ewm_status_t { kStatus_EWM_Success = 0x0U, kStatus_EWM_Fail = 0x01, kStatus_EWM_NotInitlialized = 0x2U, kStatus_EWM_NullArgument = 0x3U } |
ewm status return codes. More... | |
Functions | |
static void | EWM_HAL_Enable (EWM_Type *base) |
Enable the EWM. More... | |
static void | EWM_HAL_Disable (EWM_Type *base) |
Disable the EWM. More... | |
static bool | EWM_HAL_IsEnable (EWM_Type *base) |
Checks whether the EWM is enabled. More... | |
static void | EWM_HAL_SetIntCmd (EWM_Type *base, bool enable) |
Enable/Disable EWM interrupt. More... | |
static void | EWM_HAL_SetCmpLowRegValue (EWM_Type *base, uint8_t minServiceCycles) |
Set EWM compare low register value. More... | |
static void | EWM_HAL_SetCmpHighRegValue (EWM_Type *base, uint8_t maxServiceCycles) |
Set EWM compare high register value. More... | |
static void | EWM_HAL_Refresh (EWM_Type *base) |
Service EWM. More... | |
void | EWM_HAL_SetConfig (EWM_Type *base, const ewm_config_t *ewmConfigPtr) |
Config EWM control register. More... | |
void | EWM_HAL_Init (EWM_Type *base) |
Restores the EWM module to reset value. More... | |
struct ewm_config_t |
This structure is used when initializing the EWM.
Data Fields | |
bool | ewmEnable |
Enable EWM module. | |
bool | ewmInEnable |
Enable EWM_in input enable. | |
bool | ewmInAssertLogic |
Set EWM_in signal assertion state. | |
bool | intEnable |
Enable EWM interrupt enable. | |
uint8_t | ewmCmpLowValue |
Set EWM compare low register value. | |
uint8_t | ewmCmpHighValue |
Set EWM compare high register value, the maximum value should be 0xfe otherwise the counter will never expire. | |
enum ewm_status_t |
|
inlinestatic |
This function enables the EWM.
base | The EWM peripheral base address |
|
inlinestatic |
This function disables the EWM.
base | The EWM peripheral base address |
|
inlinestatic |
This function checks whether the EWM is enabled.
base | The EWM peripheral base address |
false | means EWM is disabled |
true | means WODG is enabled |
|
inlinestatic |
This function sets EWM enable/disable.
base | The EWM peripheral base address |
enable | Set EWM interrupt enable/disable |
|
inlinestatic |
This function sets EWM compare low register value and defines the minimum cycles to service EWM, when counter value is greater than or equal to ewm compare low register value, refresh EWM can be successful, and this register is write once, one more write will cause bus fault.
base | The EWM peripheral base address |
minServiceCycles | The EWM compare low register value |
|
inlinestatic |
This function sets EWM compare high register value and defines the maximum cycles to service EWM, when counter value is less than or equal to ewm compare high register value, refresh EWM can be successful, the compare high register value must be greater than compare low register value, and this register is write once, one more write will cause bus fault.
base | The EWM peripheral base address |
maxServiceCycles | The EWM compare high register value |
|
inlinestatic |
This function reset EWM counter to zero and the period of writing the frist value and the second value should be within 15 bus cycles.
base | The EWM peripheral base address |
void EWM_HAL_SetConfig | ( | EWM_Type * | base, |
const ewm_config_t * | ewmConfigPtr | ||
) |
This function configures EWM control register, EWM enable bitfeild, EWM ASSIN bitfeild and EWM INPUT enable bitfeild are WRITE ONCE, one more write will cause bus fault.
base | The EWM peripheral base address |
ewmConfigPtr | config EWM CTRL register |
void EWM_HAL_Init | ( | EWM_Type * | base | ) |
This function restores the EWM module to reset value.
base | The EWM peripheral base address |