cpu.c File Reference

#include "cpu.h"

Go to the source code of this file.

Functions

void InitCPU (Uint32 oscCLK, Uint16 dsp28_DIVSEL, Uint16 dsp28_PLLCR, Uint16 hspCLK, Uint16 lspCLK)
void InitSysCtrl (void)
void InitPieCtrl (void)
void EnableInterrupts (void)
 This function enables the PIE module and CPU interrupts.
void ServiceDog (void)
void DisableDog (void)
 This function disables the watchdog timer.
void InitPll (Uint16 val, Uint16 divsel)
 Initializes the PLL.
void InitPeripheralClocks (void)
 Initializes high speed and low speed clocks.

Variables

struct CPUConfiguration cpuConf

Function Documentation

void DisableDog ( void   ) 

This function disables the watchdog timer.

Definition at line 159 of file cpu.c.

void EnableInterrupts ( void   ) 

This function enables the PIE module and CPU interrupts.

Examples:
TIMotorLIBExample1/main.c, TIMotorLIBExample2/main.c, TIMotorLIBExample3/main.c, TIMotorLIBExampleHrdw/main.c, and TIMotorLIBExampleSw/main.c.

Definition at line 123 of file cpu.c.

void InitCPU ( Uint32  oscCLK,
Uint16  dsp28_DIVSEL,
Uint16  dsp28_PLLCR,
Uint16  hspCLK,
Uint16  lspCLK 
)

Init CPU clocks (spru712d pp 47).

Parameters:
oscCLK Oscillator frequency in Mhz
dsp28_DIVSEL SYSCLKOUT divider Values: 0, 1 (/4); 2(/2); 3(/1)
dsp28_PLLCR Pll Values: from 0 (bypass) to 10 (x10)
hspCLK High speed clock pre-scaler. This clock is the clock source for:

  • ADC
  • Values: [0 (reset default=SYSCLKOUT/2), 1, 2, 4, 6, 8, 10, 12, 14]
lspCLK Low speed clock pre-scaler. This clock is the clock source for:

  • SPI, SCI, I2C
  • McBSP
  • Values: [0 (reset default= SYSCLKOUT/4), 1, 2, 4, 6, 8, 10, 12, 14]
Examples:
TIMotorLIBExample1/main.c, TIMotorLIBExample2/main.c, TIMotorLIBExample3/main.c, TIMotorLIBExampleHrdw/main.c, and TIMotorLIBExampleSw/main.c.

Definition at line 30 of file cpu.c.

void InitPeripheralClocks ( void   ) 

Initializes high speed and low speed clocks.

Definition at line 333 of file cpu.c.

void InitPieCtrl ( void   ) 

This function initializes the PIE control registers to a known state. All the interrupt vectors are cleared.

Definition at line 79 of file cpu.c.

void InitPll ( Uint16  val,
Uint16  divsel 
)

Initializes the PLL.

Definition at line 168 of file cpu.c.

void InitSysCtrl ( void   ) 

This function initializes the System Control registers to a known state.

  • Disables the watchdog
  • Set the PLLCR for proper SYSCLKOUT frequency
  • Set the pre-scaler for the high and low frequency peripheral clocks
  • Enable the clocks to the peripherals

Definition at line 60 of file cpu.c.

void ServiceDog ( void   ) 

This function resets the watchdog timer. Enable this function for using ServiceDog in the application

Definition at line 146 of file cpu.c.


Variable Documentation

Definition at line 27 of file cpu.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated on Sat Apr 16 11:42:44 2011 for TIMotorLIB by  doxygen 1.6.3