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

Data Structures

struct  _OSC_Obj_
 Defines the oscillator (OSC) object. More...
 

Macros

#define OSC_BASE_ADDR   (0x00007014)
 Defines the base address of the oscillator (OSC) registers. More...
 
#define OSC_INTOSCnTRIM_COARSE_BITS   (255 << 0)
 Defines the location of the COARSETRIM bits in the INTOSCnTRIM register. More...
 
#define OSC_INTOSCnTRIM_FINE_BITS   (63 << 9)
 Defines the location of the FINETRIM bits in the INTOSCnTRIM register. More...
 

Typedefs

typedef struct _OSC_Obj_ OSC_Obj
 Defines the oscillator (OSC) object. More...
 
typedef struct _OSC_Obj_OSC_Handle
 Defines the oscillator (OSC) handle. More...
 

Enumerations

enum  OSC_Src_e { OSC_Src_Internal =(0 << 0), OSC_Src_External =(1 << 0) }
 Enumeration to define the oscillator (OSC) source. More...
 
enum  OSC_Osc2Src_e { OSC_Osc2Src_Internal =(0 << 1), OSC_Osc2Src_External =(1 << 1) }
 Enumeration to define the oscillator (OSC) 2 source. More...
 
enum  OSC_Number_e { OSC_Number_1 =1, OSC_Number_2 }
 Enumeration to define the oscillator (OSC) number. More...
 

Functions

OSC_Handle OSC_init (void *pMemory, const size_t numBytes)
 Initializes the oscillator (OSC) handle. More...
 
void OSC_setCoarseTrim (OSC_Handle clkHandle, const OSC_Number_e oscNumber, const uint_least8_t trimValue)
 Sets the coarse trim value for a specified oscillator. More...
 
void OSC_setFineTrim (OSC_Handle clkHandle, const OSC_Number_e oscNumber, const uint_least8_t trimValue)
 Sets the fine trim value for a specified oscillator. More...
 
void OSC_setTrim (OSC_Handle clkHandle, const OSC_Number_e oscNumber, const uint16_t trimValue)
 Sets the trim value for a specified oscillator. More...
 

Detailed Description


Data Structure Documentation

struct _OSC_Obj_

Defines the oscillator (OSC) object.

Definition at line 115 of file osc.h.

Data Fields
volatile uint16_t INTOSC1TRIM Internal Oscillator 1 Trim Register.
volatile uint16_t INTOSC2TRIM Internal Oscillator 2 Trim Register.
volatile uint16_t rsvd_1 Reserved.

Macro Definition Documentation

#define OSC_BASE_ADDR   (0x00007014)

Defines the base address of the oscillator (OSC) registers.

Definition at line 70 of file osc.h.

#define OSC_INTOSCnTRIM_COARSE_BITS   (255 << 0)

Defines the location of the COARSETRIM bits in the INTOSCnTRIM register.

Definition at line 75 of file osc.h.

Referenced by OSC_setCoarseTrim().

#define OSC_INTOSCnTRIM_FINE_BITS   (63 << 9)

Defines the location of the FINETRIM bits in the INTOSCnTRIM register.

Definition at line 79 of file osc.h.

Referenced by OSC_setFineTrim().

Typedef Documentation

typedef struct _OSC_Obj_* OSC_Handle

Defines the oscillator (OSC) handle.

Definition at line 125 of file osc.h.

typedef struct _OSC_Obj_ OSC_Obj

Defines the oscillator (OSC) object.

Enumeration Type Documentation

Enumeration to define the oscillator (OSC) number.

Enumerator
OSC_Number_1 

Denotes oscillator number 1.

OSC_Number_2 

Denotes oscillator number 2.

Definition at line 106 of file osc.h.

Enumeration to define the oscillator (OSC) 2 source.

Enumerator
OSC_Osc2Src_Internal 

Denotes an internal oscillator source for oscillator 2.

OSC_Osc2Src_External 

Denotes an external oscillator source for oscillator 2.

Definition at line 97 of file osc.h.

enum OSC_Src_e

Enumeration to define the oscillator (OSC) source.

Enumerator
OSC_Src_Internal 

Denotes an internal oscillator.

OSC_Src_External 

Denotes an external oscillator.

Definition at line 88 of file osc.h.

Function Documentation

OSC_Handle OSC_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the oscillator (OSC) handle.

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

Definition at line 57 of file osc.c.

void OSC_setCoarseTrim ( OSC_Handle  clkHandle,
const OSC_Number_e  oscNumber,
const uint_least8_t  trimValue 
)

Sets the coarse trim value for a specified oscillator.

Parameters
[in]clkHandleThe oscillator (OSC) object handle
[in]oscNumberThe oscillator number
[in]trimValueThe coarse trim value

Definition at line 72 of file osc.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _OSC_Obj_::INTOSC1TRIM, _OSC_Obj_::INTOSC2TRIM, OSC_INTOSCnTRIM_COARSE_BITS, and OSC_Number_1.

void OSC_setFineTrim ( OSC_Handle  clkHandle,
const OSC_Number_e  oscNumber,
const uint_least8_t  trimValue 
)

Sets the fine trim value for a specified oscillator.

Parameters
[in]clkHandleThe oscillator (OSC) object handle
[in]oscNumberThe oscillator number
[in]trimValueThe fine trim value

Definition at line 103 of file osc.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _OSC_Obj_::INTOSC1TRIM, _OSC_Obj_::INTOSC2TRIM, OSC_INTOSCnTRIM_FINE_BITS, and OSC_Number_1.

void OSC_setTrim ( OSC_Handle  clkHandle,
const OSC_Number_e  oscNumber,
const uint16_t  trimValue 
)

Sets the trim value for a specified oscillator.

Parameters
[in]clkHandleThe oscillator (OSC) object handle
[in]oscNumberThe oscillator number
[in]trimValueThe fine trim value

Definition at line 134 of file osc.c.

References DISABLE_PROTECTED_REGISTER_WRITE_MODE, ENABLE_PROTECTED_REGISTER_WRITE_MODE, _OSC_Obj_::INTOSC1TRIM, _OSC_Obj_::INTOSC2TRIM, and OSC_Number_1.