MotorWare f2806x Driver API Documentation
Data Structures | Macros | Typedefs | Enumerations | Functions
WDOG

Data Structures

struct  _WDOG_Obj_
 Defines the watchdog (WDOG) object. More...
 

Macros

#define WDOG_BASE_ADDR   (0x00007022)
 Defines the base address of the watchdog (WDOG) registers. More...
 
#define WDOG_SCSR_WDOVERRIDE_BITS   (1 << 0)
 Defines the location of the WDOVERRIDE bits in the SCSR register. More...
 
#define WDOG_SCSR_WDENINT_BITS   (1 << 1)
 Defines the location of the WDENINT bits in the SCSR register. More...
 
#define WDOG_SCSR_WDINTS_BITS   (1 << 2)
 Defines the location of the WDINTS bits in the SCSR register. More...
 
#define WDOG_WDCNTR_BITS   (255 << 0)
 Defines the location of the WDCNTR bits in the WDCNTR register. More...
 
#define WDOG_WDKEY_BITS   (255 << 0)
 Defines the location of the WDKEY bits in the WDKEY register. More...
 
#define WDOG_WDCR_WDPS_BITS   (7 << 0)
 Defines the location of the WDPS bits in the WDCR register. More...
 
#define WDOG_WDCR_WDCHK_BITS   (7 << 3)
 Defines the location of the WDCHK bits in the WDCR register. More...
 
#define WDOG_WDCR_WDDIS_BITS   (1 << 6)
 Defines the location of the WDDIS bits in the WDCR register. More...
 
#define WDOG_WDCR_WDFLAG_BITS   (1 << 7)
 Defines the location of the WDFLAG bits in the WDCR register. More...
 
#define WDOG_WDCR_WRITE_ENABLE   (5 << 3)
 Defines the watchdog write enable mode. More...
 

Typedefs

typedef struct _WDOG_Obj_ WDOG_Obj
 Defines the watchdog (WDOG) object. More...
 
typedef struct _WDOG_Obj_WDOG_Handle
 Defines the watchdog (WDOG) handle. More...
 

Enumerations

enum  WDOG_IntStatus_e { WDOG_IntStatus_Active =(0 << 2), WDOG_IntStatus_InActive =(1 << 2) }
 Enumeration to define the watchdog (WDOG) interrupt status. More...
 
enum  WDOG_PreScaler_e {
  WDOG_PreScaler_OscClk_by_512_by_1 =1, WDOG_PreScaler_OscClk_by_512_by_2, WDOG_PreScaler_OscClk_by_512_by_4, WDOG_PreScaler_OscClk_by_512_by_8,
  WDOG_PreScaler_OscClk_by_512_by_16, WDOG_PreScaler_OscClk_by_512_by_32, WDOG_PreScaler_OscClk_by_512_by_64
}
 Enumeration to define the watchdog (WDOG) timer clock prescaler, which sets the clock frequency. More...
 

Functions

void WDOG_clearCounter (WDOG_Handle wdogHandle)
 Clears the watchdog (WDOG) counter. More...
 
void WDOG_disable (WDOG_Handle wdogHandle)
 Disables the watchdog (WDOG) timer. More...
 
void WDOG_disableInt (WDOG_Handle wdogHandle)
 Disables the watchdog (WDOG) timer interrupt. More...
 
void WDOG_disableOverRide (WDOG_Handle wdogHandle)
 Disables the timer override. More...
 
void WDOG_enable (WDOG_Handle wdogHandle)
 Enables the watchdog (WDOG) timer. More...
 
void WDOG_enableInt (WDOG_Handle wdogHandle)
 Enables the watchdog (WDOG) timer interrupt. More...
 
void WDOG_enableOverRide (WDOG_Handle wdogHandle)
 Enables the watchdog (WDOG) timer override. More...
 
WDOG_IntStatus_e WDOG_getIntStatus (WDOG_Handle wdogHandle)
 Gets the watchdog (WDOG) interrupt status. More...
 
WDOG_Handle WDOG_init (void *pMemory, const size_t numBytes)
 Initializes the watchdog (WDOG) object handle. More...
 
void WDOG_setCount (WDOG_Handle wdogHandle, const uint_least8_t count)
 Sets the watchdog (WDOG) counter. More...
 
void WDOG_setPreScaler (WDOG_Handle wdogHandle, const WDOG_PreScaler_e preScaler)
 Sets the watchdog (WDOG) timer clock prescaler. More...
 

Detailed Description


Data Structure Documentation

struct _WDOG_Obj_

Defines the watchdog (WDOG) object.

Definition at line 146 of file wdog.h.

Data Fields
volatile uint16_t rsvd_1 Reserved.
volatile uint16_t rsvd_2[3] Reserved.
volatile uint16_t SCSR System Control & Status Register.
volatile uint16_t WDCNTR Watchdog Counter Register.
volatile uint16_t WDCR Watchdog Control Register.
volatile uint16_t WDKEY Watchdog Reset Key Register.

Macro Definition Documentation

#define WDOG_BASE_ADDR   (0x00007022)

Defines the base address of the watchdog (WDOG) registers.

Definition at line 69 of file wdog.h.

#define WDOG_SCSR_WDENINT_BITS   (1 << 1)

Defines the location of the WDENINT bits in the SCSR register.

Definition at line 78 of file wdog.h.

Referenced by WDOG_disableInt(), and WDOG_enableInt().

#define WDOG_SCSR_WDINTS_BITS   (1 << 2)

Defines the location of the WDINTS bits in the SCSR register.

Definition at line 82 of file wdog.h.

Referenced by WDOG_getIntStatus().

#define WDOG_SCSR_WDOVERRIDE_BITS   (1 << 0)

Defines the location of the WDOVERRIDE bits in the SCSR register.

Definition at line 74 of file wdog.h.

Referenced by WDOG_disableOverRide(), and WDOG_enableOverRide().

#define WDOG_WDCNTR_BITS   (255 << 0)

Defines the location of the WDCNTR bits in the WDCNTR register.

Definition at line 87 of file wdog.h.

#define WDOG_WDCR_WDCHK_BITS   (7 << 3)

Defines the location of the WDCHK bits in the WDCR register.

Definition at line 101 of file wdog.h.

#define WDOG_WDCR_WDDIS_BITS   (1 << 6)

Defines the location of the WDDIS bits in the WDCR register.

Definition at line 105 of file wdog.h.

Referenced by WDOG_disable(), and WDOG_enable().

#define WDOG_WDCR_WDFLAG_BITS   (1 << 7)

Defines the location of the WDFLAG bits in the WDCR register.

Definition at line 109 of file wdog.h.

#define WDOG_WDCR_WDPS_BITS   (7 << 0)

Defines the location of the WDPS bits in the WDCR register.

Definition at line 97 of file wdog.h.

Referenced by WDOG_setPreScaler().

#define WDOG_WDCR_WRITE_ENABLE   (5 << 3)

Defines the watchdog write enable mode.

Definition at line 114 of file wdog.h.

Referenced by WDOG_disable(), WDOG_enable(), and WDOG_setPreScaler().

#define WDOG_WDKEY_BITS   (255 << 0)

Defines the location of the WDKEY bits in the WDKEY register.

Definition at line 92 of file wdog.h.

Typedef Documentation

typedef struct _WDOG_Obj_* WDOG_Handle

Defines the watchdog (WDOG) handle.

Definition at line 159 of file wdog.h.

typedef struct _WDOG_Obj_ WDOG_Obj

Defines the watchdog (WDOG) object.

Enumeration Type Documentation

Enumeration to define the watchdog (WDOG) interrupt status.

Enumerator
WDOG_IntStatus_Active 
WDOG_IntStatus_InActive 

Definition at line 123 of file wdog.h.

Enumeration to define the watchdog (WDOG) timer clock prescaler, which sets the clock frequency.

Enumerator
WDOG_PreScaler_OscClk_by_512_by_1 

Denotes WDCLK = OSCCLK/512/1.

WDOG_PreScaler_OscClk_by_512_by_2 

Denotes WDCLK = OSCCLK/512/2.

WDOG_PreScaler_OscClk_by_512_by_4 

Denotes WDCLK = OSCCLK/512/4.

WDOG_PreScaler_OscClk_by_512_by_8 

Denotes WDCLK = OSCCLK/512/8.

WDOG_PreScaler_OscClk_by_512_by_16 

Denotes WDCLK = OSCCLK/512/16.

WDOG_PreScaler_OscClk_by_512_by_32 

Denotes WDCLK = OSCCLK/512/32.

WDOG_PreScaler_OscClk_by_512_by_64 

Denotes WDCLK = OSCCLK/512/64.

Definition at line 132 of file wdog.h.

Function Documentation

void WDOG_clearCounter ( WDOG_Handle  wdogHandle)

Clears the watchdog (WDOG) counter.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle

Definition at line 57 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, and _WDOG_Obj_::WDKEY.

void WDOG_disable ( WDOG_Handle  wdogHandle)

Disables the watchdog (WDOG) timer.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle

Definition at line 76 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _WDOG_Obj_::WDCR, WDOG_WDCR_WDDIS_BITS, and WDOG_WDCR_WRITE_ENABLE.

void WDOG_disableInt ( WDOG_Handle  wdogHandle)

Disables the watchdog (WDOG) timer interrupt.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle

Definition at line 96 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _WDOG_Obj_::SCSR, and WDOG_SCSR_WDENINT_BITS.

void WDOG_disableOverRide ( WDOG_Handle  wdogHandle)

Disables the timer override.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle

Definition at line 112 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _WDOG_Obj_::SCSR, and WDOG_SCSR_WDOVERRIDE_BITS.

void WDOG_enable ( WDOG_Handle  wdogHandle)

Enables the watchdog (WDOG) timer.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle

Definition at line 128 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _WDOG_Obj_::WDCR, WDOG_WDCR_WDDIS_BITS, and WDOG_WDCR_WRITE_ENABLE.

void WDOG_enableInt ( WDOG_Handle  wdogHandle)

Enables the watchdog (WDOG) timer interrupt.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle

Definition at line 148 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _WDOG_Obj_::SCSR, and WDOG_SCSR_WDENINT_BITS.

void WDOG_enableOverRide ( WDOG_Handle  wdogHandle)

Enables the watchdog (WDOG) timer override.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle

Definition at line 164 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _WDOG_Obj_::SCSR, and WDOG_SCSR_WDOVERRIDE_BITS.

WDOG_IntStatus_e WDOG_getIntStatus ( WDOG_Handle  wdogHandle)

Gets the watchdog (WDOG) interrupt status.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle
Returns
The interrupt status

Definition at line 180 of file wdog.c.

References _WDOG_Obj_::SCSR, and WDOG_SCSR_WDINTS_BITS.

WDOG_Handle WDOG_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the watchdog (WDOG) object handle.

Parameters
[in]pMemoryA pointer to the base address of the WDOG registers
[in]numBytesThe number of bytes allocated for the WDOG object, bytes
Returns
The watchdog (WDOG) object handle

Definition at line 192 of file wdog.c.

void WDOG_setCount ( WDOG_Handle  wdogHandle,
const uint_least8_t  count 
)

Sets the watchdog (WDOG) counter.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle
[in]countThe count

Definition at line 207 of file wdog.c.

References _WDOG_Obj_::WDCNTR.

void WDOG_setPreScaler ( WDOG_Handle  wdogHandle,
const WDOG_PreScaler_e  preScaler 
)

Sets the watchdog (WDOG) timer clock prescaler.

Parameters
[in]wdogHandleThe watchdog (WDOG) timer object handle
[in]preScalerThe prescaler

Definition at line 219 of file wdog.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _WDOG_Obj_::WDCR, WDOG_WDCR_WDPS_BITS, and WDOG_WDCR_WRITE_ENABLE.