CC3200 Peripheral Driver Library User's Guide: PRCM_Power_Reset_Clock_Module_api

CC3200 Peripheral Driver

CC3200 Peripheral Driver Library User's Guide  1.2.0
PRCM_Power_Reset_Clock_Module_api

Functions

void PRCMMCUReset (tBoolean bIncludeSubsystem)
 
unsigned long PRCMSysResetCauseGet ()
 
void PRCMPeripheralClkEnable (unsigned long ulPeripheral, unsigned long ulClkFlags)
 
void PRCMPeripheralClkDisable (unsigned long ulPeripheral, unsigned long ulClkFlags)
 
unsigned long PRCMPeripheralClockGet (unsigned long ulPeripheral)
 
void PRCMPeripheralReset (unsigned long ulPeripheral)
 
tBoolean PRCMPeripheralStatusGet (unsigned long ulPeripheral)
 
void PRCMI2SClockFreqSet (unsigned long ulI2CClkFreq)
 
void PRCMLPDSRestoreInfoSet (unsigned long ulStackPtr, unsigned long ulProgCntr)
 
void PRCMLPDSEnter ()
 
void PRCMLPDSEnterKeepDebugIf ()
 
void PRCMLPDSWakeupSourceEnable (unsigned long ulLpdsWakeupSrc)
 
void PRCMLPDSWakeupSourceDisable (unsigned long ulLpdsWakeupSrc)
 
unsigned long PRCMLPDSWakeupCauseGet ()
 
void PRCMLPDSIntervalSet (unsigned long ulTicks)
 
void PRCMLPDSWakeUpGPIOSelect (unsigned long ulGPIOPin, unsigned long ulType)
 
void PRCMSleepEnter ()
 
void PRCMSRAMRetentionEnable (unsigned long ulSramColSel, unsigned long ulModeFlags)
 
void PRCMSRAMRetentionDisable (unsigned long ulSramColSel, unsigned long ulFlags)
 
void PRCMHibernateWakeupSourceEnable (unsigned long ulHIBWakupSrc)
 
void PRCMHibernateWakeupSourceDisable (unsigned long ulHIBWakupSrc)
 
unsigned long PRCMHibernateWakeupCauseGet ()
 
void PRCMHibernateIntervalSet (unsigned long long ullTicks)
 
void PRCMHibernateWakeUpGPIOSelect (unsigned long ulGPIOBitMap, unsigned long ulType)
 
void PRCMHibernateEnter ()
 
unsigned long long PRCMSlowClkCtrGet ()
 
unsigned long long PRCMSlowClkCtrFastGet (void)
 
void PRCMSlowClkCtrMatchSet (unsigned long long ullValue)
 
unsigned long long PRCMSlowClkCtrMatchGet ()
 
void PRCMOCRRegisterWrite (unsigned char ucIndex, unsigned long ulRegValue)
 
unsigned long PRCMOCRRegisterRead (unsigned char ucIndex)
 
void PRCMIntRegister (void(*pfnHandler)(void))
 
void PRCMIntUnregister ()
 
void PRCMIntEnable (unsigned long ulIntFlags)
 
void PRCMIntDisable (unsigned long ulIntFlags)
 
unsigned long PRCMIntStatus ()
 
void PRCMRTCInUseSet ()
 
tBoolean PRCMRTCInUseGet ()
 
void PRCMRTCSet (unsigned long ulSecs, unsigned short usMsec)
 
void PRCMRTCGet (unsigned long *ulSecs, unsigned short *usMsec)
 
void PRCMRTCMatchSet (unsigned long ulSecs, unsigned short usMsec)
 
void PRCMRTCMatchGet (unsigned long *ulSecs, unsigned short *usMsec)
 
void PRCMCC3200MCUInit ()
 
unsigned long PRCMHIBRegRead (unsigned long ulRegAddr)
 
void PRCMHIBRegWrite (unsigned long ulRegAddr, unsigned long ulValue)
 
unsigned long PRCMCameraFreqSet (unsigned char ulDivider, unsigned char ulWidth)
 

Detailed Description

Function Documentation

unsigned long PRCMCameraFreqSet ( unsigned char  ulDivider,
unsigned char  ulWidth 
)
Parameters
ulDivideris clock frequency divider value
ulWidthis the width of the high pulse

This function sets the input frequency for camera module.

The frequency is calculated as follows:

   f_out = 240MHz/ulDivider;

The parameter ulWidth sets the width of the high pulse.

For e.g.:

ulDivider = 4;
ulWidth   = 2;

f_out = 30 MHz and 50% duty cycle

And,

ulDivider = 4;
ulWidth   = 1;

f_out = 30 MHz and 25% duty cycle
Returns
0 on success, 1 on error
void PRCMCC3200MCUInit ( void  )

MCU Initialization Routine

This function sets mandatory configurations for the MCU

Returns
None
void PRCMHibernateEnter ( void  )

Puts the system into Hibernate

This function puts the system into Hibernate. The device enters HIB immediately and on exit from HIB device core starts its execution from reset thus the function never returns.

Returns
None.
void PRCMHibernateIntervalSet ( unsigned long long  ullTicks)

Sets Hibernate wakeup Timer

Parameters
ullTicksis number of 32.768 KHz clocks

This function sets internal hibernate wakeup timer running at 32.768 KHz.

Returns
Returns true on success, false otherwise.
unsigned long PRCMHibernateWakeupCauseGet ( void  )

Get hibernate wakeup cause

This function gets the hibernate wakeup cause.

Returns
Returns PRCM_HIB_WAKEUP_CAUSE_SLOW_CLOCK or PRCM_HIB_WAKEUP_CAUSE_GPIO
void PRCMHibernateWakeUpGPIOSelect ( unsigned long  ulGPIOBitMap,
unsigned long  ulType 
)

Selects the GPIO(s) for hibernate wakeup

Parameters
ulGPIOBitMapis the bit-map of valid hibernate wakeup GPIO.
ulTypeis the wakeup trigger type.

This function setects the wakeup GPIO for hibernate and can be used to select any combination of 7 pre-defined GPIO(s).

This function enables individual HIB wakeup source(s). The paramter ulGPIOBitMap should be one of the follwoing :- -PRCM_HIB_GPIO2 -PRCM_HIB_GPIO4 -PRCM_HIB_GPIO13 -PRCM_HIB_GPIO17 -PRCM_HIB_GPIO11 -PRCM_HIB_GPIO24 -PRCM_HIB_GPIO26

The parameter ulType sets the trigger type and can be one of the following:

  • PRCM_HIB_LOW_LEVEL
  • PRCM_HIB_HIGH_LEVEL
  • PRCM_HIB_FALL_EDGE
  • PRCM_HIB_RISE_EDGE
Returns
None.
void PRCMHibernateWakeupSourceDisable ( unsigned long  ulHIBWakupSrc)

Disable individual HIB wakeup source(s).

Parameters
ulHIBWakupSrcis logical OR of valid HIB wakeup sources.

This function disable individual HIB wakeup source(s). The paramter ulHIBWakupSrc is same as bit fileds defined in PRCMEnableHibernateWakeupSource()

Returns
None.
void PRCMHibernateWakeupSourceEnable ( unsigned long  ulHIBWakupSrc)

Enables individual HIB wakeup source(s).

Parameters
ulHIBWakupSrcis logical OR of valid HIB wakeup sources.

This function enables individual HIB wakeup source(s). The paramter ulHIBWakupSrc is the bit mask of HIB wakeup sources and should be logical OR of one or more of the follwoing :- -PRCM_HIB_SLOW_CLK_CTR -PRCM_HIB_GPIO2 -PRCM_HIB_GPIO4 -PRCM_HIB_GPIO13 -PRCM_HIB_GPIO17 -PRCM_HIB_GPIO11 -PRCM_HIB_GPIO24 -PRCM_HIB_GPIO26

Returns
None.
unsigned long PRCMHIBRegRead ( unsigned long  ulRegAddr)

Reads 32-bit value from register at specified address

Parameters
ulRegAddris the address of register to be read.

This function reads 32-bit value from the register as specified by ulRegAddr.

Returns
Return the value of the register.
void PRCMHIBRegWrite ( unsigned long  ulRegAddr,
unsigned long  ulValue 
)

Writes 32-bit value to register at specified address

Parameters
ulRegAddris the address of register to be read.
ulValueis the 32-bit value to be written.

This function writes 32-bit value passed as ulValue to the register as specified by ulRegAddr

Returns
None
void PRCMI2SClockFreqSet ( unsigned long  ulI2CClkFreq)

Configure I2S fracactional divider

Parameters
ulI2CClkFreqis the required input clock for McAPS module

This function configures I2S fractional divider. By default this divider is set to output 24 Mhz clock to I2S module.

The minimum frequency that can be obtained by configuring this divider is

(240000KHz/1023.99) = 234.377 KHz

Returns
None.
void PRCMIntDisable ( unsigned long  ulIntFlags)

Disables individual PRCM interrupt sources.

Parameters
ulIntFlagsis the bit mask of the interrupt sources to be disabled.

This function disables the indicated ARCM interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ulIntFlags parameter has the same definition as the ulIntFlags parameter to PRCMEnableInterrupt().

Returns
None.
void PRCMIntEnable ( unsigned long  ulIntFlags)

Enables individual PRCM interrupt sources.

Parameters
ulIntFlagsis the bit mask of the interrupt sources to be enabled.

This function enables the indicated ARCM interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ulIntFlags parameter is the logical OR of any of the following: -PRCM_INT_SLOW_CLK_CTR

void PRCMIntRegister ( void(*)(void)  pfnHandler)

Registers an interrupt handler for the PRCM.

Parameters
pfnHandleris a pointer to the function to be called when the interrupt is activated.

This function does the actual registering of the interrupt handler. This function enables the global interrupt in the interrupt controller;

Returns
None.
unsigned long PRCMIntStatus ( void  )

Gets the current interrupt status.

This function returns the PRCM interrupt status of interrupts that are allowed to reflect to the processor. The interrupts are cleared on read.

Returns
Returns the current interrupt status.
void PRCMIntUnregister ( void  )

Unregisters an interrupt handler for the PRCM.

This function does the actual unregistering of the interrupt handler. It clears the handler to be called when a PRCM interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.

Returns
None.
void PRCMLPDSEnter ( void  )

Puts the system into Low Power Deel Sleep (LPDS) power mode.

This function puts the system into Low Power Deel Sleep (LPDS) power mode. A call to this function never returns and the execution starts from Reset.

See also
PRCMLPDSRestoreInfoSet().
Returns
None.
Note
External debugger will always disconnect whenever the system enters LPDS and debug interface is shutdown until next POR reset. In order to avoid this and allow for connecting back the debugger after waking up from LPDS
See also
PRCMLPDSEnterKeepDebugIf().
void PRCMLPDSEnterKeepDebugIf ( void  )

Puts the system into Low Power Deel Sleep (LPDS) power mode keeping debug interface alive.

This function puts the system into Low Power Deel Sleep (LPDS) power mode keeping debug interface alive. A call to this function never returns and the execution starts from Reset

See also
PRCMLPDSRestoreInfoSet().
Returns
None.
Note
External debugger will always disconnect whenever the system enters LPDS, using this API will allow connecting back the debugger after waking up from LPDS. This API is recommended for development purposes only as it adds to the current consumption of the system.
void PRCMLPDSIntervalSet ( unsigned long  ulTicks)

Sets LPDS wakeup Timer

Parameters
ulTicksis number of 32.768 KHz clocks

This function sets internal LPDS wakeup timer running at 32.768 KHz. The timer is only configured if the parameter ulTicks is in valid range i.e. from 21 to 2^32.

Returns
Returns true on success, false otherwise.
void PRCMLPDSRestoreInfoSet ( unsigned long  ulStackPtr,
unsigned long  ulProgCntr 
)

Sets the LPDS exit PC and SP restore vlaues.

Parameters
ulStackPtris the SP restore value.
ulProgCntris the PC restore value

This function sets the LPDS exit PC and SP restore vlaues. Setting ulProgCntr to a non-zero value, forces bootloader to jump to that address with Stack Pointer initialized to ulStackPtr on LPDS exit, otherwise the application's vector table entries are used.

Returns
None.
unsigned long PRCMLPDSWakeupCauseGet ( void  )

Get LPDS wakeup cause

This function gets LPDS wakeup caouse

Returns
Returns values enumerated as described in PRCMLPDSWakeupSourceEnable().
void PRCMLPDSWakeUpGPIOSelect ( unsigned long  ulGPIOPin,
unsigned long  ulType 
)

Selects the GPIO for LPDS wakeup

Parameters
ulGPIOPinis one of the valid GPIO fro LPDS wakeup.
ulTypeis the wakeup trigger type.

This function setects the wakeup GPIO for LPDS wakeup and can be used to select one out of 7 pre-defined GPIO(s).

The parameter ulLpdsGPIOSel should be one of the following:- -PRCM_LPDS_GPIO2 -PRCM_LPDS_GPIO4 -PRCM_LPDS_GPIO13 -PRCM_LPDS_GPIO17 -PRCM_LPDS_GPIO11 -PRCM_LPDS_GPIO24 -PRCM_LPDS_GPIO26

The parameter ulType sets the trigger type and can be one of the following:

  • PRCM_LPDS_LOW_LEVEL
  • PRCM_LPDS_HIGH_LEVEL
  • PRCM_LPDS_FALL_EDGE
  • PRCM_LPDS_RISE_EDGE
Returns
None.
void PRCMLPDSWakeupSourceDisable ( unsigned long  ulLpdsWakeupSrc)

Disable the individual LPDS wakeup source(s).

Parameters
ulLpdsWakeupSrcis logical OR of wakeup sources.

This function enable the individual LPDS wakeup source(s) and following three wake up sources (ulLpdsWakeupSrc ) are supported by the device. -PRCM_LPDS_HOST_IRQ -PRCM_LPDS_GPIO -PRCM_LPDS_TIMER

Returns
None.
void PRCMLPDSWakeupSourceEnable ( unsigned long  ulLpdsWakeupSrc)

Enable the individual LPDS wakeup source(s).

Parameters
ulLpdsWakeupSrcis logical OR of wakeup sources.

This function enable the individual LPDS wakeup source(s) and following three wakeup sources (ulLpdsWakeupSrc ) are supported by the device. -PRCM_LPDS_HOST_IRQ -PRCM_LPDS_GPIO -PRCM_LPDS_TIMER

Returns
None.
void PRCMMCUReset ( tBoolean  bIncludeSubsystem)

Performs a software reset of a MCU and associated peripherals

Parameters
bIncludeSubsystemis true to reset associated peripherals.

This function performs a software reset of a MCU and associated peripherals. To reset the associated peripheral, the parameter bIncludeSubsystem should be set to true.

Returns
None.
unsigned long PRCMOCRRegisterRead ( unsigned char  ucIndex)

Read from On-Chip Retention (OCR) register.

This function reads from On-Chip retention register. The device supports two 4-byte OCR register which are retained across all power mode.

The parameter ucIndex is an index of the OCR and can be 0 or 1.

Returns
None.
void PRCMOCRRegisterWrite ( unsigned char  ucIndex,
unsigned long  ulRegValue 
)

Write to On-Chip Retention (OCR) register.

This function writes to On-Chip retention register. The device supports two 4-byte OCR register which are retained across all power mode.

The parameter ucIndex is an index of the OCR and can be 0 or 1.

Returns
None.
void PRCMPeripheralClkDisable ( unsigned long  ulPeripheral,
unsigned long  ulClkFlags 
)

Disables clock(s) to peripheral.

Parameters
ulPeripheralis one of the valid peripherals
ulClkFlagsare bitmask of clock(s) to be enabled.

This function disable the clock for the specified peripheral. Peripherals are by default clock gated (disabled) and generated a bus fault if accessed.

The parameter ulClkFlags can be logical OR bit fields as defined in PRCMEnablePeripheral().

Returns
None.
void PRCMPeripheralClkEnable ( unsigned long  ulPeripheral,
unsigned long  ulClkFlags 
)

Enable clock(s) to peripheral.

Parameters
ulPeripheralis one of the valid peripherals
ulClkFlagsare bitmask of clock(s) to be enabled.

This function enables the clock for the specified peripheral. Peripherals are by default clock gated (disabled) and generates a bus fault if accessed.

The parameter ulClkFlags can be logical OR of the following: -PRCM_RUN_MODE_CLK - Ungates clock to the peripheral -PRCM_SLP_MODE_CLK - Keeps the clocks ungated in sleep.

Returns
None.
unsigned long PRCMPeripheralClockGet ( unsigned long  ulPeripheral)

Gets the input clock for the specified peripheral.

Parameters
ulPeripheralis one of the valid peripherals.

This function gets the input clock for the specified peripheral.

The parameter ulPeripheral has the same definition as that in PRCMPeripheralClkEnable();

Returns
Returns input clock frequency for specified peripheral.
void PRCMPeripheralReset ( unsigned long  ulPeripheral)

Performs a software reset of a peripheral.

Parameters
ulPeripheralis one of the valid peripheral.

This assert or deassert reset to the specified peripheral based of the bAssert parameter.

Returns
None.
tBoolean PRCMPeripheralStatusGet ( unsigned long  ulPeripheral)

Determines if a peripheral is ready.

Parameters
ulPeripheralis one of the valid modules

This function determines if a particular peripheral is ready to be accessed. The peripheral may be in a non-ready state if it is not enabled, is being held in reset, or is in the process of becoming ready after being enabled or taken out of reset.

Returns
Returns true if the peripheral is ready, false otherwise.
void PRCMRTCGet ( unsigned long *  ulSecs,
unsigned short *  usMsec 
)

Get the instantaneous calendar time from the device.

Parameters
ulSecsrefers to the seconds part of the calendar time
usMsecrefers to the fractional (ms) part of the second

This function fetches the instantaneous value of the ticking calendar time from the device. The calendar time is outlined in terms of seconds and milliseconds.

The device provides the calendar value that has been maintained across active and low power states.

The function PRCMRTCSet() must have been invoked once to set a reference.

Returns
None.
tBoolean PRCMRTCInUseGet ( void  )

Ascertain whether function of RTC is being used

This function indicates whether function of RTC is being used on the device or not.

This routine should be utilized by the application software, when returning from low-power, to confirm that RTC has been put to use and may not need to set the value of the RTC.

The RTC feature, if set or marked, can be only reset either through reboot or power cycle.

Returns
None.
void PRCMRTCInUseSet ( void  )

Mark the function of RTC as being used

This function marks in HW that feature to maintain calendar time in device is being used.

Specifically, this feature reserves user's HIB Register-1 accessed through PRCMOCRRegisterWrite(1) for internal work / purpose, therefore, the stated register is not available to user. Also, users must not excercise the Slow Clock Counter API(s), if RTC has been set for use.

The RTC feature, if set or marked, can be only reset either through reboot or power cycle.

Returns
None.
void PRCMRTCMatchGet ( unsigned long *  ulSecs,
unsigned short *  usMsec 
)

Get a previously set calendar time alarm.

Parameters
ulSecsrefers to the seconds part of the calendar time
usMsecrefers to the fractional (ms) part of the second

This function fetches from the device a wall-clock alarm that would have been previously set in the device. The calendar time is outlined in terms of seconds and milliseconds.

If no alarm was set in the past, then this function would fetch a random information.

The function PRCMRTCMatchSet() must have been invoked once to set an alarm.

Returns
None.
void PRCMRTCMatchSet ( unsigned long  ulSecs,
unsigned short  usMsec 
)

Set a calendar time alarm.

Parameters
ulSecsrefers to the seconds part of the calendar time
usMsecrefers to the fractional (ms) part of the second

This function sets an wall-clock alarm in the device to be reported for a futuristic calendar time. The calendar time is outlined in terms of seconds and milliseconds.

The device provides uses the calendar value that has been maintained across active and low power states to report attainment of alarm time.

The function PRCMRTCSet() must have been invoked once to set a reference.

Returns
None.
void PRCMRTCSet ( unsigned long  ulSecs,
unsigned short  usMsec 
)

Set the calendar time in the device.

Parameters
ulSecsrefers to the seconds part of the calendar time
usMsecrefers to the fractional (ms) part of the second

This function sets the specified calendar time in the device. The calendar time is outlined in terms of seconds and milliseconds. However, the device makes no assumption about the origin or reference of the calendar time.

The device uses the indicated calendar value to update and maintain the wall-clock time across active and low power states.

The function PRCMRTCInUseSet() must be invoked prior to use of this feature.

Returns
None.
void PRCMSleepEnter ( void  )

Puts the system into Sleep.

This function puts the system into sleep power mode. System exits the power state on any one of the available interrupt. On exit from sleep mode the function returns to the calling function with all the processor core registers retained.

Returns
None.
unsigned long long PRCMSlowClkCtrFastGet ( void  )

Gets the current value of the internal slow clock counter

This function is similar to

See also
PRCMSlowClkCtrGet() but reads the counter value from a relatively faster interface using an auto-latch mechainsm.
Note
Due to the nature of implemetation of auto latching, when using this API, the recommendation is to read the value thrice and identify the right value (as 2 out the 3 read values will always be correct and with a max. of 1 LSB change)
Returns
64-bit current counter vlaue.
unsigned long long PRCMSlowClkCtrGet ( void  )

Gets the current value of the internal slow clock counter

This function latches and reads the internal RTC running at 32.768 Khz

Returns
64-bit current counter vlaue.
unsigned long long PRCMSlowClkCtrMatchGet ( void  )

Gets slow clock counter match value.

This function gets the match value for slow clock counter. This is use to interrupt the processor when RTC counts to the specified value.

Returns
None.
void PRCMSlowClkCtrMatchSet ( unsigned long long  ullValue)

Sets slow clock counter match value to interrupt the processor.

Parameters
ullValueis the match value.

This function sets the match value for slow clock counter. This is use to interrupt the processor when RTC counts to the specified value.

Returns
None.
void PRCMSRAMRetentionDisable ( unsigned long  ulSramColSel,
unsigned long  ulFlags 
)

Disable SRAM column retention during LPDS Power mode(s).

Parameters
ulSramColSelis bit mask of valid SRAM columns.
ulFlagsis the bit mask of power modes.

This functions disable the SRAM retention. The device supports configurable SRAM column retention in Low Power Deep Sleep (LPDS). Each column is of 64 KB size.

The parameter ulSramColSel should be logical OR of the following:- -PRCM_SRAM_COL_1 -PRCM_SRAM_COL_2 -PRCM_SRAM_COL_3 -PRCM_SRAM_COL_4

The parameter ulFlags selects the power modes and sholud be logical OR of one or more of the following -PRCM_SRAM_LPDS_RET

Returns
None.
void PRCMSRAMRetentionEnable ( unsigned long  ulSramColSel,
unsigned long  ulModeFlags 
)

Enable SRAM column retention during LPDS Power mode(s)

Parameters
ulSramColSelis bit mask of valid SRAM columns.
ulModeFlagsis the bit mask of power modes.

This functions enables the SRAM retention. The device supports configurable SRAM column retention in Low Power Deep Sleep (LPDS). Each column is of 64 KB size.

The parameter ulSramColSel should be logical OR of the following:- -PRCM_SRAM_COL_1 -PRCM_SRAM_COL_2 -PRCM_SRAM_COL_3 -PRCM_SRAM_COL_4

The parameter ulModeFlags selects the power modes and sholud be logical OR of one or more of the following -PRCM_SRAM_LPDS_RET

Returns
None.
unsigned long PRCMSysResetCauseGet ( void  )

Gets the reason for a reset.

This function returns the reason(s) for a reset. The reset reason are:- -PRCM_POWER_ON - Device is powering up. -PRCM_LPDS_EXIT - Device is exiting from LPDS. -PRCM_CORE_RESET - Device is exiting soft core only reset -PRCM_MCU_RESET - Device is exiting soft subsystem reset. -PRCM_WDT_RESET - Device was reset by watchdog. -PRCM_SOC_RESET - Device is exting SOC reset. -PRCM_HIB_EXIT - Device is exiting hibernate.

Returns
Returns one of the cause defined above.
Generated on Thu Feb 18 2016 13:22:02 for CC3200 Peripheral Driver Library User's Guide by   doxygen 1.8.11