S32 SDK

Detailed Description

External Watchdog Monitor Hardware Abstraction Layer.

This HAL provides low-level access to all hardware features of the EWM.

Enumerations

enum  ewm_in_assert_logic_t { EWM_IN_ASSERT_DISABLED = 0x00U, EWM_IN_ASSERT_ON_LOGIC_ZERO = 0x01U, EWM_IN_ASSERT_ON_LOGIC_ONE = 0x02U }
 EWM input pin configuration Configures if the input pin is enabled and when is asserted Implements : ewm_in_assert_logic_t_Class. More...
 

External Watchdog Module HAL

void EWM_HAL_Init (EWM_Type *const base, bool interruptEnable, ewm_in_assert_logic_t assertLogic, bool enable)
 Init EWM. This method configures the EWM instance Control Register fields such as interrupt enable, input pin, instance enablement. The user must make sure that the prescaler, compare high and compare low registers are configured prior to this function call. More...
 
ewm_in_assert_logic_t EWM_HAL_GetInputPinAssertLogic (const EWM_Type *const base)
 Get the Input pin assert logic. More...
 
static void EWM_HAL_Refresh (EWM_Type *const base)
 Refresh EWM. This method needs to be called within the window period specified by the Compare Low and Compare High registers. More...
 
static bool EWM_HAL_IsInterruptEnabled (const EWM_Type *const base)
 Get the Interrupt Enable bit. More...
 
static bool EWM_HAL_IsEnabled (const EWM_Type *const base)
 Get the EWM enable bit. More...
 
static uint8_t EWM_HAL_GetControl (const EWM_Type *const base)
 Get the Control register Value. More...
 
static void EWM_HAL_SetCompareLow (EWM_Type *const base, uint8_t value)
 Set the Compare Low Value. This register can be only written once after a CPU reset. The user must make sure that the Compare High is greater than Compare Low value. More...
 
static uint8_t EWM_HAL_GetCompareLow (const EWM_Type *const base)
 Get the Compare Low Value. More...
 
static void EWM_HAL_SetCompareHigh (EWM_Type *const base, uint8_t value)
 Set the Compare High Value. This register can be only written once after a CPU reset. The user must make sure that the Compare High is greater than Compare Low value Note: The maximum Compare High value is 0xFE. More...
 
static uint8_t EWM_HAL_GetCompareHigh (const EWM_Type *const base)
 Get the Compare High Value. More...
 
static void EWM_HAL_SetPrescaler (EWM_Type *const base, uint8_t value)
 Set the Clock Prescaler Value. This register can be only written once after a CPU reset and it must be written before enabling the EWM. More...
 
static uint8_t EWM_HAL_GetPrescaler (const EWM_Type *const base)
 Get the Clock Prescaler Value. More...
 

Enumeration Type Documentation

EWM input pin configuration Configures if the input pin is enabled and when is asserted Implements : ewm_in_assert_logic_t_Class.

Enumerator
EWM_IN_ASSERT_DISABLED 

Input pin disabled

EWM_IN_ASSERT_ON_LOGIC_ZERO 

Input pin asserts EWM when on logic 0

EWM_IN_ASSERT_ON_LOGIC_ONE 

Input pin asserts EWM when on logic 1

Definition at line 43 of file ewm_hal.h.

Function Documentation

static uint8_t EWM_HAL_GetCompareHigh ( const EWM_Type *const  base)
inlinestatic

Get the Compare High Value.

Parameters
[in]baseEWM base pointer
Returns
Value stored in Compare High register Implements : EWM_HAL_GetCompareHigh_Activity

Definition at line 186 of file ewm_hal.h.

static uint8_t EWM_HAL_GetCompareLow ( const EWM_Type *const  base)
inlinestatic

Get the Compare Low Value.

Parameters
[in]baseEWM base pointer
Returns
Value stored in Compare Low register Implements : EWM_HAL_GetCompareLow_Activity

Definition at line 161 of file ewm_hal.h.

static uint8_t EWM_HAL_GetControl ( const EWM_Type *const  base)
inlinestatic

Get the Control register Value.

Parameters
[in]baseEWM base pointer
Returns
Value stored in Control register Implements : EWM_HAL_GetControl_Activity

Definition at line 137 of file ewm_hal.h.

ewm_in_assert_logic_t EWM_HAL_GetInputPinAssertLogic ( const EWM_Type *const  base)

Get the Input pin assert logic.

Parameters
[in]baseEWM base pointer
Returns
The input pin assert logic:
  • EWM_IN_ASSERT_DISABLED - EWM in disabled
  • EWM_IN_ASSERT_ON_LOGIC_ZERO - EWM is asserted when EWM_in is logic 0
  • EWM_IN_ASSERT_ON_LOGIC_ONE - EWM is asserted when EWM_in is logic 1

Definition at line 87 of file ewm_hal.c.

static uint8_t EWM_HAL_GetPrescaler ( const EWM_Type *const  base)
inlinestatic

Get the Clock Prescaler Value.

Parameters
[in]baseEWM base pointer
Returns
Value stored in Clock Prescaler register Implements : EWM_HAL_GetPrescaler_Activity

Definition at line 209 of file ewm_hal.h.

void EWM_HAL_Init ( EWM_Type *const  base,
bool  interruptEnable,
ewm_in_assert_logic_t  assertLogic,
bool  enable 
)

Init EWM. This method configures the EWM instance Control Register fields such as interrupt enable, input pin, instance enablement. The user must make sure that the prescaler, compare high and compare low registers are configured prior to this function call.

Parameters
[in]baseEWM base pointer
[in]interruptEnableEnable or disable EWM interrupt
[in]assertLogicConfigure when the EWM input pin asserts
[in]enableEnable or disable the EWM instance

Definition at line 49 of file ewm_hal.c.

static bool EWM_HAL_IsEnabled ( const EWM_Type *const  base)
inlinestatic

Get the EWM enable bit.

Parameters
[in]baseEWM base pointer
Returns
The state of the device enable bit:
  • false - EWM disabled
  • true - EWM enabled Implements : EWM_HAL_IsEnabled_Activity

Definition at line 125 of file ewm_hal.h.

static bool EWM_HAL_IsInterruptEnabled ( const EWM_Type *const  base)
inlinestatic

Get the Interrupt Enable bit.

Parameters
[in]baseEWM base pointer
Returns
The state of the interrupt enable bit:
  • false - interrupt disabled
  • true - interrupt enabled Implements : EWM_HAL_IsInterruptEnabled_Activity

Definition at line 111 of file ewm_hal.h.

static void EWM_HAL_Refresh ( EWM_Type *const  base)
inlinestatic

Refresh EWM. This method needs to be called within the window period specified by the Compare Low and Compare High registers.

Parameters
[in]baseEWM base pointer Implements : EWM_HAL_Refresh_Activity

Definition at line 95 of file ewm_hal.h.

static void EWM_HAL_SetCompareHigh ( EWM_Type *const  base,
uint8_t  value 
)
inlinestatic

Set the Compare High Value. This register can be only written once after a CPU reset. The user must make sure that the Compare High is greater than Compare Low value Note: The maximum Compare High value is 0xFE.

Parameters
[in]baseEWM base pointer
[in]valueValue to write into Compare High register Implements : EWM_HAL_SetCompareHigh_Activity

Definition at line 175 of file ewm_hal.h.

static void EWM_HAL_SetCompareLow ( EWM_Type *const  base,
uint8_t  value 
)
inlinestatic

Set the Compare Low Value. This register can be only written once after a CPU reset. The user must make sure that the Compare High is greater than Compare Low value.

Parameters
[in]baseEWM base pointer
[in]valueValue to write into Compare Low register Implements : EWM_HAL_SetCompareLow_Activity

Definition at line 150 of file ewm_hal.h.

static void EWM_HAL_SetPrescaler ( EWM_Type *const  base,
uint8_t  value 
)
inlinestatic

Set the Clock Prescaler Value. This register can be only written once after a CPU reset and it must be written before enabling the EWM.

Parameters
[in]baseEWM base pointer
[in]valuePrescaler Value Implements : EWM_HAL_SetPrescaler_Activity

Definition at line 198 of file ewm_hal.h.