This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.
|
static void | COP_EnableInterrupt (COP_Type *base) |
| Enables the COP interrupt, if psConfig->bEnableWriteProtect is set to true for calling WDOG_Init, the operation does not take effect. More...
|
|
static void | COP_DisableInterrupt (COP_Type *base) |
| Disables the COP interrupt, if psConfig->bEnableWriteProtect is set to true for calling WDOG_Init, the operation does not take effect. More...
|
|
uint16_t cop_config_t::u16TimeoutCount |
uint16_t cop_config_t::u16WindowCount |
uint16_t cop_config_t::u16InterruptCount |
Enumerator |
---|
kCOP_RoscClockSource |
COP clock sourced from Relaxation oscillator (ROSC)
|
kCOP_CoscClockSource |
COP clock sourced from Crystal oscillator (COSCs)
|
kCOP_BusClockSource |
COP clock sourced from IP Bus clock.
|
kCOP_LpoClockSource |
COP clock sourced from Low speed oscillator.
|
Enumerator |
---|
kCOP_ClockPrescalerDivide1 |
Divided by 1.
|
kCOP_ClockPrescalerDivide16 |
Divided by 16.
|
kCOP_ClockPrescalerDivide256 |
Divided by 256.
|
kCOP_ClockPrescalerDivide1024 |
Divided by 1024.
|
void COP_Init |
( |
COP_Type * |
base, |
|
|
const cop_config_t * |
psConfig |
|
) |
| |
Call this function to do initialization configuration for COP module. The configurations are:
- COP configuration write protect enablement
- Clock source selection for COP module
- Prescaler configuration to the input clock source
- Counter timeout value
- Window value
- WAIT/STOP work mode enablement
- Interrupt enable/disable and interrupt timing value
- Loss of reference counter enablement
- COP enable/disable
- Parameters
-
base | COP peripheral base address. |
psConfig | The pointer to COP configuration structure, cop_config_t. |
This function initializes the COP configuration structure to default values.
* psConfig->bEnableWriteProtect = false;
* psConfig->bEnableWait = false;
* psConfig->bEnableStop = false;
* psConfig->bEnableLossOfReference = false;
* psConfig->bEnableInterrupt = false;
* psConfig->bEnableCOP = false;
* psConfig->u16TimeoutCount = 0xFFFFU;
* psConfig->u16WindowCount = 0xFFFFU;
* psConfig->u16InterruptCount = 0xFFU;
*
- Parameters
-
psConfig | Pointer to the COP configuration structure, cop_config_t. |
static void COP_Enable |
( |
COP_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
This function disables the COP Watchdog. To disable the COP Watchdog, call COP_Enable(base, false).
- Parameters
-
base | COP peripheral base address. |
bEnable | Enable the feature or not. |
static void COP_EnableLossOfReferenceCounter |
( |
COP_Type * |
base, |
|
|
bool |
bEnable |
|
) |
| |
|
inlinestatic |
This function writes a value into the COP_CTRL register to enable or disable the COP Loss of Reference counter.
- Parameters
-
base | COP peripheral base address. |
bEnable | Enable the feature or not. |
static void COP_SetTimeoutCount |
( |
COP_Type * |
base, |
|
|
uint16_t |
u16TimeoutCount |
|
) |
| |
|
inlinestatic |
This function sets the COP timeout value, if psConfig->bEnableWriteProtect is set to true for calling WDOG_Init, the set does not take effect. It should be ensured that the time-out value for the COP is always greater than interrupt time + 40 bus clock cycles. This function writes a value into COP_TOUT register, when COP count down to zero from the timeout count value, COP_RST_B signal will be asserted. There are some considerations for setting the timeout count afer COP is enabled:
- The recommended procedure for changing TIMEOUT is to disable the COP by invoking COP_Enable(), then call the function COP_SetTimeoutCount, and then re-enable the by invoking COP_Enable() again.
- Alternatively, call the function COP_SetTimeoutCount, then feed the COP by invoking COP_Refresh() to reload the timeout.
- Parameters
-
base | COP peripheral base address |
u16TimeoutCount | COP timeout value, count of COP clock tick. Use macro definition MSEC_TO_COUNT to convert value in ms to count of ticks, the COP clock rate is source clock divide prescaler. |
static void COP_SetInterruptCount |
( |
COP_Type * |
base, |
|
|
uint16_t |
u16InterruptCount |
|
) |
| |
|
inlinestatic |
This function sets the COP interrupt value, if psConfig->bEnableWriteProtect is set to true for calling WDOG_Init, the set does not take effect. This function writes a value into COP_INTVAL register, if COP interrupt is enabled and COP count down to the interrupt value configured, an interrupt will be triggered. Ensure the COP counter is disabled while the function is called.
- Parameters
-
base | COP peripheral base address |
u16InterruptCount | COP interrupt value, count of COP clock tick. Use macro definition MSEC_TO_COUNT to convert value in ms to count of ticks, the COP clock rate is source clock divide prescaler. |
static void COP_SetWindowCount |
( |
COP_Type * |
base, |
|
|
uint16_t |
u16WindowCount |
|
) |
| |
|
inlinestatic |
This function sets the COP window value, if psConfig->bEnableWriteProtect is set to true for calling WDOG_Init, the set does not take effect. This function writes a value into COP_WINDOW register. Ensure the COP counter is disabled while the function is called.
- Parameters
-
base | COP peripheral base address |
u16WindowCount | COP window value, count of COP clock tick. Use macro definition MSEC_TO_COUNT to convert value in ms to count of ticks, the COP clock rate is source clock divide prescaler. |
void COP_Refresh |
( |
COP_Type * |
base | ) |
|
This function feeds/services the COP.
- Parameters
-
base | COP peripheral base address. |
static void COP_EnableInterrupt |
( |
COP_Type * |
base | ) |
|
|
inlinestatic |
This function writes a value into the COP_CTRL register to enable the COP interrupt.
- Parameters
-
base | COP peripheral base address |
static void COP_DisableInterrupt |
( |
COP_Type * |
base | ) |
|
|
inlinestatic |
This function writes a value into the COP_CTRL register to disable the COP interrupt.
- Parameters
-
base | COP peripheral base address |