Infineon MOTIX™ MCU TLE985x Device Family SDK
Macros | Enumerations | Functions
scu.h File Reference

Go to the source code of this file.

Detailed Description

System Control Unit low level access library.

Version
V0.4.2
Date
28. Aug 2023
Note
This file violates [MISRA 2012 Rule 2.2, required], [MISRA 2012 Rule 11.1, required], [MISRA 2012 Rule 11.4, advisory], [MISRA 2012 Rule 11.6, required], [MISRA 2012 Rule 2.5, advisory], [MISRA 2012 Rule 8.7, advisory]

Include Graph

Include dependency graph for scu.h:

Macros

#define PASSWD_Open   (0x98U)
 PASSWD Phrases, PASSWD Opened. More...
 
#define PASSWD_Close   (0xA8U)
 PASSWD Phrases, PASSWD Closed. More...
 
#define NVM_PASSWORD_BOOT   (0U)
 NVM Protection indices, BOOT. More...
 
#define NVM_PASSWORD_CODE   (1U)
 NVM Protection indices, CODE. More...
 
#define NVM_PASSWORD_DATA   (2U)
 NVM Protection indices, DATA. More...
 
#define PROTECTION_CLEAR   (1U)
 NVM Protection actions, CLEAR ACTION. More...
 
#define PROTECTION_SET   (0U)
 NVM Protection actions, SET ACTION. More...
 
#define PBA0_Div_1   (0U)
 PBA0 Clock Divider, DIV1. More...
 
#define PBA0_Div_2   (1U)
 PBA0 Clock Divider, DIV2. More...
 
#define VCO_BYP_Msk   (0x80008U)
 VCO_BYP MASK. More...
 
#define VCO_BYP_0   (0x80000U)
 VCO_BYP Initial Value. More...
 
#define OSC_DISC_Msk   (0x40004U)
 OSC_DISC MASK. More...
 
#define OSC_DISC_0   (0x40000U)
 OSC_DISC Initial Value. More...
 

Enumerations

enum  TScu_Mod {
  Mod_ADC1 = 0x00 , Mod_SSC1 = 0x01 , Mod_CCU = 0x02 , Mod_Timer2 = 0x03 ,
  Mod_GPT12 = 0x04 , Mod_SSC2 = 0x08 , Mod_Timer21 = 0x0A
}
 This enum lists the SCU Modules Configuration. More...
 
enum  TSCU_System_Clock { SCU_System_Clock_LP_CLK = 2 , SCU_System_Clock_IntOsc = 3 }
 This enum lists the SCU System Clock Sources. More...
 
enum  TSCU_VTOR { SCU_VTOR_ROM = 0 , SCU_VTOR_RAM = 1 , SCU_VTOR_CBSL = 2 , SCU_VTOR_UCODE = 3 }
 This enum lists the SCU Vector Table Relocation. More...
 

Functions

void SCU_Init (void)
 Initializes the SCU module. More...
 
void SCU_ClkInit (void)
 Initializes the system clocks. More...
 
void SCU_EnterSleepMode (void)
 Sets the device into Sleep Mode. More...
 
void SCU_EnterStopMode (void)
 Sets the device into Stop Mode. More...
 
int32_t SCU_ChangeNVMProtection (NVM_PASSWORD_SEGMENT_t Protection, uint8 Action)
 Sets the Write/Read Protection for the Code/Data Flash. More...
 
INLINE void SCU_Disable_Module (TScu_Mod Module)
 Disables a given peripheral module. More...
 
INLINE void SCU_Enable_Module (TScu_Mod Module)
 Enables a given peripheral module. 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_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...
 
INLINE void SCU_Sel_PBA0_Clk_Div_Sel (uint8 div)
 Sets PBA0 Clock Divider. More...
 
INLINE void SCU_VTOR_Sel (TSCU_VTOR a)
 Selects a Vector Table Bypass Mode. More...
 
INLINE void SCU_System_Clock_Sel (TSCU_System_Clock a)
 Selects a System Clock. More...
 
INLINE void SCU_APCLK1_Sts_Clr (void)
 Clears Analog Peripherals Clock 1 Status. More...
 
INLINE void SCU_APCLK2_Sts_Clr (void)
 Clears Analog Peripherals Clock 2 Status. More...
 
INLINE void SCU_APCLK3_Sts_Clr (void)
 Clears Analog Peripherals Clock 3 Status. More...
 
INLINE void SCUPM_CLKWDT_PD_N_En (void)
 Enables Clock Watchdog. More...
 
INLINE void SCUPM_CLKWDT_PD_N_Dis (void)
 Disables Clock Watchdog. More...
 
INLINE void SCUPM_AMCLK1_UP_TH_Set (uint8 thld)
 Sets Analog Module Clock 1 Upper Limit Threshold. More...
 
INLINE void SCUPM_AMCLK1_UP_HYS_Set (uint8 hyst)
 Sets Analog Module Clock 1 Upper Hysteresis. More...
 
INLINE void SCUPM_AMCLK1_LOW_TH_Set (uint8 thld)
 Sets Analog Module Clock 1 Lower Limit Threshold. More...
 
INLINE void SCUPM_AMCLK1_LOW_HYS_Set (uint8 hyst)
 Sets Analog Module Clock 1 Lower Hysteresis. More...
 
INLINE void SCUPM_AMCLK2_UP_TH_Set (uint8 thld)
 Sets Analog Module Clock 2 Upper Limit Threshold. More...
 
INLINE void SCUPM_AMCLK2_UP_HYS_Set (uint8 hyst)
 Sets Analog Module Clock 2 Upper Hysteresis. More...
 
INLINE void SCUPM_AMCLK2_LOW_TH_Set (uint8 thld)
 Sets Analog Module Clock 2 Lower Limit Threshold. More...
 
INLINE void SCUPM_AMCLK2_LOW_HYS_Set (uint8 hyst)
 Sets Analog Module Clock 2 Lower Hysteresis. More...
 
INLINE void CPU_DeepSleep_Sel (void)
 Selects low power deep sleep mode. More...
 
INLINE void CPU_SleepOnExit_Sel (void)
 Selects entering sleep or deep sleep on exit. More...
 

Macro Definition Documentation

◆ NVM_PASSWORD_BOOT

#define NVM_PASSWORD_BOOT   (0U)

NVM Protection indices, BOOT.

◆ NVM_PASSWORD_CODE

#define NVM_PASSWORD_CODE   (1U)

NVM Protection indices, CODE.

◆ NVM_PASSWORD_DATA

#define NVM_PASSWORD_DATA   (2U)

NVM Protection indices, DATA.

◆ OSC_DISC_0

#define OSC_DISC_0   (0x40000U)

OSC_DISC Initial Value.

◆ OSC_DISC_Msk

#define OSC_DISC_Msk   (0x40004U)

OSC_DISC MASK.

◆ PASSWD_Close

#define PASSWD_Close   (0xA8U)

PASSWD Phrases, PASSWD Closed.

◆ PASSWD_Open

#define PASSWD_Open   (0x98U)

PASSWD Phrases, PASSWD Opened.

◆ PBA0_Div_1

#define PBA0_Div_1   (0U)

PBA0 Clock Divider, DIV1.

◆ PBA0_Div_2

#define PBA0_Div_2   (1U)

PBA0 Clock Divider, DIV2.

◆ PROTECTION_CLEAR

#define PROTECTION_CLEAR   (1U)

NVM Protection actions, CLEAR ACTION.

◆ PROTECTION_SET

#define PROTECTION_SET   (0U)

NVM Protection actions, SET ACTION.

◆ VCO_BYP_0

#define VCO_BYP_0   (0x80000U)

VCO_BYP Initial Value.

◆ VCO_BYP_Msk

#define VCO_BYP_Msk   (0x80008U)

VCO_BYP MASK.

Enumeration Type Documentation

◆ TScu_Mod

enum TScu_Mod

This enum lists the SCU Modules Configuration.

Enumerator
Mod_ADC1 

SCU Modules Select: ADC1

Mod_SSC1 

SCU Modules Select: SSC1

Mod_CCU 

SCU Modules Select: CCU6

Mod_Timer2 

SCU Modules Select: Timer2

Mod_GPT12 

SCU Modules Select: GPT12

Mod_SSC2 

SCU Modules Select: SSC2

Mod_Timer21 

SCU Modules Select: Timer21

◆ TSCU_System_Clock

This enum lists the SCU System Clock Sources.

Enumerator
SCU_System_Clock_LP_CLK 

SCU System Clock Source Select: LP Clock

SCU_System_Clock_IntOsc 

SCU System Clock Source Select: Int Clock

◆ TSCU_VTOR

enum TSCU_VTOR

This enum lists the SCU Vector Table Relocation.

Enumerator
SCU_VTOR_ROM 

SCU Vector Table Relocation: ROM

SCU_VTOR_RAM 

SCU Vector Table Relocation: RAM

SCU_VTOR_CBSL 

SCU Vector Table Relocation: CBSL

SCU_VTOR_UCODE 

SCU Vector Table Relocation: UCODE

Function Documentation

◆ CPU_DeepSleep_Sel()

INLINE void CPU_DeepSleep_Sel ( void  )

Selects low power deep sleep mode.

Example

This example selects low power deep sleep mode.

void Example_Function(void)
{
}
INLINE void CPU_DeepSleep_Sel(void)
Selects low power deep sleep mode.
Definition: scu.h:776

◆ CPU_SleepOnExit_Sel()

INLINE void CPU_SleepOnExit_Sel ( void  )

Selects entering sleep or deep sleep on exit.

Example

This example selects entering deep sleep on exit.

void Example_Function(void)
{
}
INLINE void CPU_SleepOnExit_Sel(void)
Selects entering sleep or deep sleep on exit.
Definition: scu.h:781

◆ SCU_APCLK1_Sts_Clr()

INLINE void SCU_APCLK1_Sts_Clr ( void  )

Clears Analog Peripherals Clock 1 Status.

Example

This example clears Analog Peripherals Clock 1 Status.

void Example_Function(void)
{
}
INLINE void SCU_APCLK1_Sts_Clr(void)
Clears Analog Peripherals Clock 1 Status.
Definition: scu.h:711

◆ SCU_APCLK2_Sts_Clr()

INLINE void SCU_APCLK2_Sts_Clr ( void  )

Clears Analog Peripherals Clock 2 Status.

Example

This example clears Analog Peripherals Clock 2 Status.

void Example_Function(void)
{
}
INLINE void SCU_APCLK2_Sts_Clr(void)
Clears Analog Peripherals Clock 2 Status.
Definition: scu.h:716

◆ SCU_APCLK3_Sts_Clr()

INLINE void SCU_APCLK3_Sts_Clr ( void  )

Clears Analog Peripherals Clock 3 Status.

Example

This example clears Analog Peripherals Clock 3 Status.

void Example_Function(void)
{
}
INLINE void SCU_APCLK3_Sts_Clr(void)
Clears Analog Peripherals Clock 3 Status.
Definition: scu.h:721

◆ SCU_ChangeNVMProtection()

int32_t SCU_ChangeNVMProtection ( NVM_PASSWORD_SEGMENT_t  Protection,
uint8  Action 
)

Sets the Write/Read Protection for the Code/Data Flash.

Parameters
ProtectionBOOT/CODE/DATA, see NVM_PASSWORD_SEGMENT_t
ActionCLEAR/SET
Returns
ERR_LOG_SUCCESS or error code, see BOOTROM_RETURN_CODE_t

Example

This example writes Protection for the Code Flash.

void Example_Function(void)
{
}
#define NVM_PASSWORD_CODE
NVM Protection indices, CODE.
Definition: scu.h:119
#define PROTECTION_SET
NVM Protection actions, SET ACTION.
Definition: scu.h:126
int32_t SCU_ChangeNVMProtection(NVM_PASSWORD_SEGMENT_t Protection, uint8 Action)
Sets the Write/Read Protection for the Code/Data Flash.

◆ SCU_ClkInit()

void SCU_ClkInit ( void  )

Initializes the system clocks.

◆ SCU_ClosePASSWD()

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.

void Example_Function(void)
{
}
INLINE void SCU_ClosePASSWD(void)
Closes the bit protection by writing PASSWD_Close to the Bit Protection Register.
Definition: scu.h:685

◆ SCU_Disable_Module()

INLINE void SCU_Disable_Module ( TScu_Mod  Module)

Disables a given peripheral module.

Parameters
ModuleSCU Modules, see TScu_Mod

Example

This example disables ADC1 Module.

void Example_Function(void)
{
}
@ Mod_ADC1
Definition: scu.h:150
INLINE void SCU_Disable_Module(TScu_Mod Module)
Disables a given peripheral module.
Definition: scu.h:651

◆ SCU_Enable_Module()

INLINE void SCU_Enable_Module ( TScu_Mod  Module)

Enables a given peripheral module.

Parameters
ModuleSCU Modules, see TScu_Mod

Example

This example enables ADC1 Module.

void Example_Function(void)
{
}
INLINE void SCU_Enable_Module(TScu_Mod Module)
Enables a given peripheral module.
Definition: scu.h:656

◆ SCU_EnterSleepMode()

void SCU_EnterSleepMode ( void  )

Sets the device into Sleep Mode.

Note
This function violates [MISRA 2012 Rule 2.2, required]

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 exter sleep mode

Example

This example Sets the device into Sleep Mode.

void Example_Function(void)
{
}
void SCU_EnterSleepMode(void)
Sets the device into Sleep Mode.

◆ SCU_EnterStopMode()

void SCU_EnterStopMode ( void  )

Sets the device into Stop Mode.

Note
This function violates [MISRA 2012 Rule 2.2, required]

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, set Sleep Mode Enable flag in Power Mode Control Register 0, execute the WFE instruction twice to exter sleep mode

  • in case TLE985X doesn't wake up with a reset: switch back fINTOSC (was set to LP_CLK before), enable interrupts, initialize WDT1

Example

This example Sets the device into Stop Mode.

void Example_Function(void)
{
}
void SCU_EnterStopMode(void)
Sets the device into Stop Mode.

◆ SCU_Init()

void SCU_Init ( void  )

Initializes the SCU module.

◆ SCU_OpenPASSWD()

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.

void Example_Function(void)
{
}
INLINE void SCU_OpenPASSWD(void)
Opens the bit protection by writing PASSWD_Open to the Bit Protection Register.
Definition: scu.h:680

◆ SCU_Sel_PBA0_Clk_Div_Sel()

INLINE void SCU_Sel_PBA0_Clk_Div_Sel ( uint8  div)

Sets PBA0 Clock Divider.

Parameters
divPBA0 Clock Divider: 0 if div1, 1 if div2

Example

This example sets The PBA0 Clock Divider to 2.

void Example_Function(void)
{
}
INLINE void SCU_Sel_PBA0_Clk_Div_Sel(uint8 div)
Sets PBA0 Clock Divider.
Definition: scu.h:690
#define PBA0_Div_2
PBA0 Clock Divider, DIV2.
Definition: scu.h:131

◆ SCU_System_Clock_Sel()

INLINE void SCU_System_Clock_Sel ( TSCU_System_Clock  a)

Selects a System Clock.

Parameters
aSystem Clock, see TSCU_System_Clock

Example

This example sets The clock output signal to fINTOSC.

void Example_Function(void)
{
}
@ SCU_System_Clock_IntOsc
Definition: scu.h:165
INLINE void SCU_System_Clock_Sel(TSCU_System_Clock a)
Selects a System Clock.
Definition: scu.h:704

◆ SCU_VTOR_Sel()

INLINE void SCU_VTOR_Sel ( TSCU_VTOR  a)

Selects a Vector Table Bypass Mode.

Parameters
aVector Table Bypass Mode, see TSCU_VTOR

Example

This example configures the VTOR to be remapped to RAM.

void Example_Function(void)
{
}
@ SCU_VTOR_RAM
Definition: scu.h:174
INLINE void SCU_VTOR_Sel(TSCU_VTOR a)
Selects a Vector Table Bypass Mode.
Definition: scu.h:697

◆ SCU_WDT_Service()

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.

void Example_Function(void)
{
}
INLINE void SCU_WDT_Start(void)
Starts the Watchdog of SCU-DM in the Watchdog Timer Control Register The written bit is protected by ...
Definition: scu.h:661
INLINE void SCU_WDT_Service(void)
Services the Watchdog of SCU-DM in the Watchdog Timer Control Register.
Definition: scu.h:675

◆ SCU_WDT_Start()

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.

void Example_Function(void)
{
}

◆ SCU_WDT_Stop()

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.

void Example_Function(void)
{
}
INLINE void SCU_WDT_Stop(void)
Stops the Watchdog of SCU-DM in the Watchdog Timer Control Register The written bit is protected by t...
Definition: scu.h:668

◆ SCUPM_AMCLK1_LOW_HYS_Set()

INLINE void SCUPM_AMCLK1_LOW_HYS_Set ( uint8  hyst)

Sets Analog Module Clock 1 Lower Hysteresis.

Parameters
hystLower Hysteresis

Example

This example sets Analog Module Clock 1 Lower Hysteresis to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK1_LOW_HYS_Set(uint8 hyst)
Sets Analog Module Clock 1 Lower Hysteresis.
Definition: scu.h:751

◆ SCUPM_AMCLK1_LOW_TH_Set()

INLINE void SCUPM_AMCLK1_LOW_TH_Set ( uint8  thld)

Sets Analog Module Clock 1 Lower Limit Threshold.

Parameters
thldLower Limit Threshold

Example

This example sets Analog Module Clock 1 Lower Limit Threshold to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK1_LOW_TH_Set(uint8 thld)
Sets Analog Module Clock 1 Lower Limit Threshold.
Definition: scu.h:746

◆ SCUPM_AMCLK1_UP_HYS_Set()

INLINE void SCUPM_AMCLK1_UP_HYS_Set ( uint8  hyst)

Sets Analog Module Clock 1 Upper Hysteresis.

Parameters
hystUpper Hysteresis

Example

This example sets Analog Module Clock 1 Upper Hysteresis to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK1_UP_HYS_Set(uint8 hyst)
Sets Analog Module Clock 1 Upper Hysteresis.
Definition: scu.h:741

◆ SCUPM_AMCLK1_UP_TH_Set()

INLINE void SCUPM_AMCLK1_UP_TH_Set ( uint8  thld)

Sets Analog Module Clock 1 Upper Limit Threshold.

Parameters
thldUpper Limit Threshold

Example

This example sets Analog Module Clock 1 Upper Limit Threshold to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK1_UP_TH_Set(uint8 thld)
Sets Analog Module Clock 1 Upper Limit Threshold.
Definition: scu.h:736

◆ SCUPM_AMCLK2_LOW_HYS_Set()

INLINE void SCUPM_AMCLK2_LOW_HYS_Set ( uint8  hyst)

Sets Analog Module Clock 2 Lower Hysteresis.

Parameters
hystLower Hysteresis

Example

This example sets Analog Module Clock 2 Lower Hysteresis to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK2_LOW_HYS_Set(uint8 hyst)
Sets Analog Module Clock 2 Lower Hysteresis.
Definition: scu.h:771

◆ SCUPM_AMCLK2_LOW_TH_Set()

INLINE void SCUPM_AMCLK2_LOW_TH_Set ( uint8  thld)

Sets Analog Module Clock 2 Lower Limit Threshold.

Parameters
thldLower Limit Threshold

Example

This example sets Analog Module Clock 2 Lower Limit Threshold to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK2_LOW_TH_Set(uint8 thld)
Sets Analog Module Clock 2 Lower Limit Threshold.
Definition: scu.h:766

◆ SCUPM_AMCLK2_UP_HYS_Set()

INLINE void SCUPM_AMCLK2_UP_HYS_Set ( uint8  hyst)

Sets Analog Module Clock 2 Upper Hysteresis.

Parameters
hystUpper Hysteresis

Example

This example sets Analog Module Clock 2 Upper Hysteresis to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK2_UP_HYS_Set(uint8 hyst)
Sets Analog Module Clock 2 Upper Hysteresis.
Definition: scu.h:761

◆ SCUPM_AMCLK2_UP_TH_Set()

INLINE void SCUPM_AMCLK2_UP_TH_Set ( uint8  thld)

Sets Analog Module Clock 2 Upper Limit Threshold.

Parameters
thldUpper Limit Threshold

Example

This example sets Analog Module Clock 2 Upper Limit Threshold to Maximum value.

void Example_Function(void)
{
}
INLINE void SCUPM_AMCLK2_UP_TH_Set(uint8 thld)
Sets Analog Module Clock 2 Upper Limit Threshold.
Definition: scu.h:756

◆ SCUPM_CLKWDT_PD_N_Dis()

INLINE void SCUPM_CLKWDT_PD_N_Dis ( void  )

Disables Clock Watchdog.

Example

This example disables Clock Watchdog.

void Example_Function(void)
{
}
INLINE void SCUPM_CLKWDT_PD_N_Dis(void)
Disables Clock Watchdog.
Definition: scu.h:731

◆ SCUPM_CLKWDT_PD_N_En()

INLINE void SCUPM_CLKWDT_PD_N_En ( void  )

Enables Clock Watchdog.

Example

This example enables Clock Watchdog.

void Example_Function(void)
{
}
INLINE void SCUPM_CLKWDT_PD_N_En(void)
Enables Clock Watchdog.
Definition: scu.h:726