![]() |
Infineon MOTIX™ MCU TLE987x Device Family SDK
|
Go to the source code of this file.
System Control Unit low level access library.
Macros | |
#define | PASSWD_Open (0x98U) |
PASSWD Phrases, PASSWD Opened. More... | |
#define | PASSWD_Close (0xA8U) |
PASSWD Phrases, PASSWD Closed. More... | |
#define | NVM_DATA_WRITE (0U) |
NVM Protection indices, DATA WRITE. More... | |
#define | NVM_CODE_WRITE (1U) |
NVM Protection indices, CODE WRITE. More... | |
#define | NVM_DATA_READ (2U) |
NVM Protection indices, DATA READ. More... | |
#define | NVM_CODE_READ (3U) |
NVM Protection indices, CODE READ. More... | |
#define | PROTECTION_CLEAR (1U) |
NVM Protection actions, CLEAR. More... | |
#define | PROTECTION_SET (0U) |
NVM Protection actions, SET. More... | |
#define | SLOWDOWN_PRESCALER_1 (0U) |
#define | SLOWDOWN_PRESCALER_2 (1U) |
#define | SLOWDOWN_PRESCALER_3 (2U) |
#define | SLOWDOWN_PRESCALER_4 (3U) |
#define | SLOWDOWN_PRESCALER_8 (4U) |
#define | SLOWDOWN_PRESCALER_16 (5U) |
#define | SLOWDOWN_PRESCALER_24 (6U) |
#define | SLOWDOWN_PRESCALER_32 (7U) |
#define | SLOWDOWN_PRESCALER_48 (8U) |
#define | SLOWDOWN_PRESCALER_64 (9U) |
#define | SLOWDOWN_PRESCALER_96 (10U) |
#define | SLOWDOWN_PRESCALER_128 (11U) |
#define | SLOWDOWN_PRESCALER_192 (12U) |
#define | SLOWDOWN_PRESCALER_256 (13U) |
#define | SLOWDOWN_PRESCALER_384 (14U) |
#define | SLOWDOWN_PRESCALER_512 (15U) |
Typedefs | |
typedef enum Scu_Mod | TScu_Mod |
Enumerations | |
enum | Scu_Mod { Mod_ADC1 = 0x00 , Mod_SSC1 = 0x01 , Mod_CCU6 = 0x02 , Mod_Timer2 = 0x03 , Mod_GPT12 = 0x04 , Mod_SSC2 = 0x11 , Mod_Timer21 = 0x13 , Mod_Timer3 = 0x15 } |
Functions | |
void | SCU_ClkInit (void) |
Initializes the system clocks. More... | |
void | SCU_Init (void) |
Initializes the SCU based on the Config Wizard for MOTIX MCU configuration. More... | |
void | SCU_EnterSleepMode (void) |
Sets the device into Sleep Mode. More... | |
void | SCU_EnterStopMode (void) |
Sets the device into Stop Mode. More... | |
void | SCU_EnterSlowMode (uint8 divider_scaled) |
Sets the device into Slow Down Mode. More... | |
void | SCU_ExitSlowMode (void) |
Gets the device out of Slow Mode. More... | |
bool | SCU_ChangeNVMProtection (uint32 mode, uint32 action) |
Sets the Write/Read Protection for the Code/Data Flash. More... | |
INLINE void | SCU_WDT_Start (void) |
Starts the Watchdog of SCU-DM in the Watchdog Timer Control Register The written bit is protected by the Bit Protection Register of SCU. More... | |
INLINE void | SCU_WDT_Stop (void) |
Stops the Watchdog of SCU-DM in the Watchdog Timer Control Register The written bit is protected by the Bit Protection Register of SCU. More... | |
INLINE void | SCU_WDT_Service (void) |
Services the Watchdog of SCU-DM in the Watchdog Timer Control Register. More... | |
INLINE void | SCU_Disable_Module (TScu_Mod Module) |
Disables a given peripheral module in the Peripheral Management Control Registers. More... | |
INLINE void | SCU_Enable_Module (TScu_Mod Module) |
Enables a given peripheral module in the Peripheral Management Control Registers. More... | |
INLINE void | SCU_OpenPASSWD (void) |
Opens the bit protection by writing PASSWD_Open to the Bit Protection Register. More... | |
INLINE void | SCU_ClosePASSWD (void) |
Closes the bit protection by writing PASSWD_Close to the Bit Protection Register. More... | |
#define NVM_CODE_READ (3U) |
NVM Protection indices, CODE READ.
#define NVM_CODE_WRITE (1U) |
NVM Protection indices, CODE WRITE.
#define NVM_DATA_READ (2U) |
NVM Protection indices, DATA READ.
#define NVM_DATA_WRITE (0U) |
NVM Protection indices, DATA WRITE.
#define PASSWD_Close (0xA8U) |
PASSWD Phrases, PASSWD Closed.
#define PASSWD_Open (0x98U) |
PASSWD Phrases, PASSWD Opened.
#define PROTECTION_CLEAR (1U) |
NVM Protection actions, CLEAR.
#define PROTECTION_SET (0U) |
NVM Protection actions, SET.
#define SLOWDOWN_PRESCALER_1 (0U) |
#define SLOWDOWN_PRESCALER_128 (11U) |
#define SLOWDOWN_PRESCALER_16 (5U) |
#define SLOWDOWN_PRESCALER_192 (12U) |
#define SLOWDOWN_PRESCALER_2 (1U) |
#define SLOWDOWN_PRESCALER_24 (6U) |
#define SLOWDOWN_PRESCALER_256 (13U) |
#define SLOWDOWN_PRESCALER_3 (2U) |
#define SLOWDOWN_PRESCALER_32 (7U) |
#define SLOWDOWN_PRESCALER_384 (14U) |
#define SLOWDOWN_PRESCALER_4 (3U) |
#define SLOWDOWN_PRESCALER_48 (8U) |
#define SLOWDOWN_PRESCALER_512 (15U) |
#define SLOWDOWN_PRESCALER_64 (9U) |
#define SLOWDOWN_PRESCALER_8 (4U) |
#define SLOWDOWN_PRESCALER_96 (10U) |
enum Scu_Mod |
Sets the Write/Read Protection for the Code/Data Flash.
mode | Protection CODE/DATA, READ/WRITE |
action | CLEAR/SET |
false | execution passes |
true | execution failed, maybe wrong password |
Example
This example sets Protection for the Code Write.
void SCU_ClkInit | ( | void | ) |
Initializes the system clocks.
INLINE void SCU_ClosePASSWD | ( | void | ) |
Closes the bit protection by writing PASSWD_Close to the Bit Protection Register.
Example
This example closes the PASSWD Register protection scheme.
Disables a given peripheral module in the Peripheral Management Control Registers.
Module | peripheral module (Bit[4] = PMCON1 or PMCON2, Bit[3:0] slects the bit) |
Example
This example disables ADC1 Module.
Enables a given peripheral module in the Peripheral Management Control Registers.
Module | peripheral module (Bit[4] = PMCON1 or PMCON2, Bit[3:0] slects the bit) |
Example
This example enables ADC1 Module.
void SCU_EnterSleepMode | ( | void | ) |
Sets the device into Sleep Mode.
performed steps: Set LIN to sleep mode, clear Main wake status and Wake Source MON Input, stop WDT1 and trigger a short open window, disable interrupts set Sleep Mode Enable flag in Power Mode Control Register 0, execute the WFE instruction twice to enter sleep mode
Example
This example Sets the device into Sleep Mode.
void SCU_EnterSlowMode | ( | uint8 | divider_scaled | ) |
Sets the device into Slow Down Mode.
divider_scaled | Divider from 1 up to 512 scaled to a value from 0 to 15; for scaling see User manual, register CMCON1->CLKREL. The macros SLOWDOWN_PRESCALER_x are recommended as parameter. |
Example
This example Sets the device into Slow Mode.
void SCU_EnterStopMode | ( | void | ) |
Sets the device into Stop Mode.
performed steps: clear Main wake status and Wake Source MON Input, stop WDT1 and trigger a short open window, disable interrupts select LP_CLK as sys clk for a defined state, select OSC_PLL async, set Sleep Mode Enable flag in Power Mode Control Register 0, send the event SEV, execute the WFE instruction twice to enter stop mode
Example
This example Sets the device into Stop Mode.
void SCU_ExitSlowMode | ( | void | ) |
Gets the device out of Slow Mode.
Example
This example Gets the device out of Slow Mode.
void SCU_Init | ( | void | ) |
Initializes the SCU based on the Config Wizard for MOTIX MCU configuration.
INLINE void SCU_OpenPASSWD | ( | void | ) |
Opens the bit protection by writing PASSWD_Open to the Bit Protection Register.
Example
This example opens the PASSWD Register protection scheme.
INLINE void SCU_WDT_Service | ( | void | ) |
Services the Watchdog of SCU-DM in the Watchdog Timer Control Register.
Example
This example starts the internal Watchdog and services the internal Watchdog.
INLINE void SCU_WDT_Start | ( | void | ) |
Starts the Watchdog of SCU-DM in the Watchdog Timer Control Register The written bit is protected by the Bit Protection Register of SCU.
Example
This example starts the internal Watchdog and services the internal Watchdog.
INLINE void SCU_WDT_Stop | ( | void | ) |
Stops the Watchdog of SCU-DM in the Watchdog Timer Control Register The written bit is protected by the Bit Protection Register of SCU.
Example
This example stops the internal Watchdog.