CLOCK_XMC4: Methods

CLOCK XMC4

CLOCK_XMC4
Methods
DAVE_APP_VERSION_t CLOCK_XMC4_GetAppVersion (void)
 Get CLOCK_XMC4 APP version.
CLOCK_XMC4_STATUS_t CLOCK_XMC4_Init (CLOCK_XMC4_t *handle)
 Initializes a CLOCK_XMC4 APP instance.
uint32_t OSCHP_GetFrequency (void)
 This is a non-weak function, which retrieves high precision external oscillator frequency.
Note: This function is used by xmc4_scu LLD for internal operations. Therefore the user do not required to call this API explicitly.
void CLOCK_XMC4_StepSystemPllFrequency (uint32_t kdiv)
 API for ramping down the system PLL clock frequency.

Methods


Function Documentation

DAVE_APP_VERSION_t CLOCK_XMC4_GetAppVersion ( void  )

Get CLOCK_XMC4 APP version.

Returns:
DAVE_APP_VERSION_t APP version information (major, minor and patch number)
Description:
The function can be used to check application software compatibility with a specific version of the APP.

Example Usage:

 #include <DAVE.h>

 int main(void) {
   DAVE_STATUS_t init_status;
   DAVE_APP_VERSION_t version;

   // Initialize CLOCK_XMC4 APP:
   // SystemCoreClockSetup() is called from SystemInit().
   init_status = DAVE_Init();

   version = CLOCK_XMC4_GetAppVersion();
   if (version.major != 1U) {
     // Probably, not the right version.
   }

   // More code here
   while(1) {

   }
   return (0);
 }


Definition at line 83 of file CLOCK_XMC4.c.

CLOCK_XMC4_STATUS_t CLOCK_XMC4_Init ( CLOCK_XMC4_t handle)

Initializes a CLOCK_XMC4 APP instance.

Parameters:
handleaddress of CLOCK_XMC4 APP handler
Returns:
CLOCK_XMC4_STATUS_SUCCESS : if initialization is successful
CLOCK_XMC4_STATUS_FAILURE : if initialization is failed
Description:
CLOCK_XMC4_Init API is called during initialization of DAVE APPS. This API Initializes NMI TRAP Configuration.
Example Usage:
 #include <DAVE.h>

 int main(void)
 {
   DAVE_STATUS_t status;

   status = DAVE_Init();  //  CLOCK_XMC4_Init API is called during initialization of DAVE APPS
   if(DAVE_STATUS_SUCCESS == status)
   {
    // user code

     while(1)
     {

     }
   }
   return (1);
 }


Definition at line 96 of file CLOCK_XMC4.c.

References CLOCK_XMC4_STATUS_SUCCESS, and CLOCK_XMC4::init_status.

void CLOCK_XMC4_StepSystemPllFrequency ( uint32_t  kdiv)

API for ramping down the system PLL clock frequency.

Parameters:
kdivPLL output divider K2DIV. Range: 1 to 128. Represents (K2DIV+1).
Returns:
none
Description:
The function can be used for ramping down the system PLL clock frequency.

Example Usage:

 #include <DAVE.h>

 int main(void)
 {
   DAVE_STATUS_t init_status;
   uint32_t kdiv = 10U;  // (K2DIV+1) value for scaling down the system PLL clock frequency
   // Initialize CLOCK_XMC4 APP:
   // SystemCoreClockSetup() is called from SystemInit().
   init_status = DAVE_Init();
  if(DAVE_STATUS_SUCCESS == init_status)
  {
    // More code here


    // User decided to reduce the system power consumption by scaling down the system PLL clock frequency
    CLOCK_XMC4_StepSystemPllFrequency(kdiv); // fPLL frequency is scaling down by K2DIV factor.


    // More code here
    while(1) {

    }
  }
  return (1);
 }


Definition at line 116 of file CLOCK_XMC4.c.

uint32_t OSCHP_GetFrequency ( void  )

This is a non-weak function, which retrieves high precision external oscillator frequency.
Note: This function is used by xmc4_scu LLD for internal operations. Therefore the user do not required to call this API explicitly.

Returns:
uint32_t Range: 4 to 25 in External Crystal Mode, 4 to 40 in External External Direct Input Mode.
Description:
This function to retrieves the external high precision oscillator frequency value, derived from either "External Crystal Mode" or "External Direct Input Mode"

Definition at line 109 of file CLOCK_XMC4.c.