5.1. MCU
5.1.1. Types
Base type |
Type Name |
Brief |
---|---|---|
enum |
This is a status value returned by the function Mcu_GetPllStatus of the MCU module. |
|
enum |
This is the type of the reset enumerator containing the subset of reset types. |
|
enum |
This is a status value returned by the function Mcu_GetRamState of the MCU module. |
|
enum |
Type of the clock sources. |
|
enum |
The following are clock sources available for Cpu Timer module. |
|
enum |
The following are clock sources available for MCAN module. |
|
enum |
The following are dividers available for MCAN module. |
|
enum |
The following are instances available for MCAN module. |
|
enum |
The following are clock sources available for XCLKOUT module. |
|
enum |
The following are dividers available for XCLKOUT. |
|
enum |
The following are dividers available for Ethercat clock. |
|
enum |
The following are values available to set enable/disable for EthcatPhyClock. |
|
enum |
The following are dividers available for HSM clock. |
|
enum |
The following are dividers available for EPWM clock. |
|
enum |
The following are dividers available for EMIF clock. |
|
enum |
The following are dividers available for LIN clock. |
|
enum |
The following are instances available for LIN module. |
|
enum |
List of low power modes. |
|
typedef uint8 |
This type specifies the identification (ID) for a ClockType status used by Mcu_InitClock. |
|
typedef uint32 |
This type specifies the identification (ID) for a RAW reset status returned by Mcu_GetResetRawValue. |
|
typedef uint8 |
This type specifies the identification (ID) for a MCU low power mode used in Mcu_SetMode. |
|
typedef uint8 |
This type specifies the identification (ID) for a RAM section used in Mcu_InitRamSection. |
|
typedef const Mcu_RamSectionConfigType * |
||
typedef const Mcu_PeripheralClkRegConfigType * |
||
typedef const Mcu_MCanClkConfigType * |
||
typedef const Mcu_LinClkConfigType * |
||
typedef const Mcu_ClockConfigType * |
||
typedef const Mcu_ModeConfigType * |
5.1.1.1. enum Mcu_PllStatusType
Enumerator |
Value |
Description |
---|---|---|
MCU_PLL_LOCKED |
0U |
PLL status Locked. |
MCU_PLL_UNLOCKED |
1U |
PLL status Unlocked. |
MCU_PLL_STATUS_UNDEFINED |
2U |
PLL status undefined. |
Brief: This is a status value returned by the function Mcu_GetPllStatus of the MCU module.
5.1.1.2. enum Mcu_ResetType
Enumerator |
Value |
Description |
---|---|---|
MCU_POWER_ON_RESET |
0U |
Power On reset. |
MCU_EXTERNAL_RESET |
1U |
External reset. |
MCU_ESM_NMI_WATCHDOG_RESET |
2U |
NMI Watchdog reset. |
MCU_WATCHDOG_RESET |
3U |
Watchdog reset |
MCU_SW_RESET |
4U |
Simulation of external reset |
MCU_ESM_RESET |
5U |
ESM reset |
MCU_RESET_UNDEFINED |
6U |
UNDEFINED reset |
Brief: This is the type of the reset enumerator containing the subset of reset types.
5.1.1.3. enum Mcu_RamStateType
Enumerator |
Value |
Description |
---|---|---|
MCU_RAMSTATE_INVALID |
0U |
Ram state status invalid |
MCU_RAMSTATE_VALID |
1U |
Ram state status valid |
Brief: This is a status value returned by the function Mcu_GetRamState of the MCU module.
5.1.1.4. enum Mcu_ClkSourceIdType
Enumerator |
Value |
Description |
---|---|---|
MCU_CLKSRC_OSC2 |
0x00 |
Internal Oscillator 2 |
MCU_CLKSRC_XTAL |
0x01 |
External XTAL |
MCU_CLKSRC_XTAL_SE |
0x11 |
External XTAL Single-ended mode |
MCU_CLKSRC_OSC1 |
0x02 |
Internal Oscillator 1 |
Brief: Type of the clock sources.
5.1.1.5. enum Mcu_CpuTimerClkSrc
Enumerator |
Value |
Description |
---|---|---|
MCU_CPUTIMERCLKSRC_SYSCLK |
0U |
SYSCLK (default on reset) |
MCU_CPUTIMERCLKSRC_INTOSC1 |
1U |
Internal Oscillator 1 |
MCU_CPUTIMERCLKSRC_INTOSC2 |
2U |
Internal Oscillator 2 |
MCU_CPUTIMERCLKSRC_XTAL |
3U |
External Oscillator (XTAL) |
MCU_CPUTIMERCLKSRC_MAX |
Brief: The following are clock sources available for Cpu Timer module.
5.1.1.6. enum Mcu_MCanClkSrc
Enumerator |
Value |
Description |
---|---|---|
MCU_MCANCLKSRC_PERxSYSCLK |
0U |
SYSCLK (default on reset) |
MCU_MCANCLKSRC_AUXCLKIN |
2U |
SYSCLK (default on reset) |
MCU_MCANCLKSRC_PLLRAWCLK |
3U |
Raw PLL Clock |
MCU_MCANCLKSRC_MAX |
Brief: The following are clock sources available for MCAN module.
5.1.1.7. enum Mcu_MCANClkDivider
Enumerator |
Value |
Description |
---|---|---|
MCU_MCANCLK_DIV_1 |
0x0 |
MCAN clock = MCAN clock source / 1. |
MCU_MCANCLK_DIV_2 |
0x1 |
MCAN clock = MCAN clock source / 2. |
MCU_MCANCLK_DIV_3 |
0x2 |
MCAN clock = MCAN clock source / 3. |
MCU_MCANCLK_DIV_4 |
0x3 |
MCAN clock = MCAN clock source / 4. |
MCU_MCANCLK_DIV_5 |
0x4 |
MCAN clock = MCAN clock source / 5. |
MCU_MCANCLK_DIV_6 |
0x5 |
MCAN clock = MCAN clock source / 6. |
MCU_MCANCLK_DIV_7 |
0x6 |
MCAN clock = MCAN clock source / 7. |
MCU_MCANCLK_DIV_8 |
0x7 |
MCAN clock = MCAN clock source / 8. |
MCU_MCANCLK_DIV_9 |
0x8 |
MCAN clock = MCAN clock source / 9. |
MCU_MCANCLK_DIV_10 |
0x9 |
MCAN clock = MCAN clock source / 10. |
MCU_MCANCLK_DIV_11 |
0xA |
MCAN clock = MCAN clock source / 11. |
MCU_MCANCLK_DIV_12 |
0xB |
MCAN clock = MCAN clock source / 12. |
MCU_MCANCLK_DIV_13 |
0xC |
MCAN clock = MCAN clock source / 13. |
MCU_MCANCLK_DIV_14 |
0xD |
MCAN clock = MCAN clock source / 14. |
MCU_MCANCLK_DIV_15 |
0xE |
MCAN clock = MCAN clock source / 15. |
MCU_MCANCLK_DIV_16 |
0xF |
MCAN clock = MCAN clock source / 16. |
MCU_MCANCLK_DIV_17 |
0x10 |
MCAN clock = MCAN clock source / 17. |
MCU_MCANCLK_DIV_18 |
0x11 |
MCAN clock = MCAN clock source / 18. |
MCU_MCANCLK_DIV_19 |
0x12 |
MCAN clock = MCAN clock source / 19. |
MCU_MCANCLK_DIV_20 |
0x13 |
MCAN clock = MCAN clock source / 20. |
Brief: The following are dividers available for MCAN module.
5.1.1.8. enum Mcu_MCANInstance
Enumerator |
Value |
Description |
---|---|---|
MCU_MCAN_A |
0U |
MCAN Instance A. |
MCU_MCAN_B |
1U |
MCAN Instance B. |
MCU_MCAN_C |
2U |
MCAN Instance C. |
MCU_MCAN_D |
3U |
MCAN Instance D. |
MCU_MCAN_E |
4U |
MCAN Instance E. |
MCU_MCAN_F |
5U |
MCAN Instance F. |
Brief: The following are instances available for MCAN module.
5.1.1.9. enum Mcu_ExternalClockOutClkSrc
Enumerator |
Value |
Description |
---|---|---|
MCU_XCLKOUTSRC_PLLSYS |
0U |
PLL System Clock post SYSCLKDIV |
MCU_XCLKOUTSRC_CPU1CLK |
1U |
CPU1.CLOCK |
MCU_XCLKOUTSRC_CPU2CLK |
2U |
CPU2.CLOCK |
MCU_XCLKOUTSRC_CPU3CLK |
3U |
CPU3.CLOCK |
MCU_XCLKOUTSRC_INTOSC1 |
5U |
Internal Oscillator 1 |
MCU_XCLKOUTSRC_INTOSC2 |
6U |
Internal Oscillator 2 |
MCU_XCLKOUTSRC_XTALOSC |
7U |
External Oscillator |
Brief: The following are clock sources available for XCLKOUT module.
5.1.1.10. enum Mcu_ExternalClockOutDiv
Enumerator |
Value |
Description |
---|---|---|
MCU_XCLKOUT_DIV_1 |
0U |
divided by 1 |
MCU_XCLKOUT_DIV_2 |
1U |
divided by 2 |
MCU_XCLKOUT_DIV_4 |
2U |
divided by 4 |
MCU_XCLKOUT_DIV_8 |
3U |
divided by 8 |
Brief: The following are dividers available for XCLKOUT.
5.1.1.11. enum Mcu_EthercatClockDiv
Enumerator |
Value |
Description |
---|---|---|
MCU_ECATCLKOUT_DIV_1 |
0U |
divided by 1 |
MCU_ECATCLKOUT_DIV_2 |
1U |
divided by 2 |
MCU_ECATCLKOUT_DIV_3 |
2U |
divided by 3 |
MCU_ECATCLKOUT_DIV_4 |
3U |
divided by 4 |
MCU_ECATCLKOUT_DIV_5 |
4U |
divided by 5 |
MCU_ECATCLKOUT_DIV_6 |
5U |
divided by 6 |
MCU_ECATCLKOUT_DIV_7 |
6U |
divided by 7 |
MCU_ECATCLKOUT_DIV_8 |
7U |
divided by 8 |
Brief: The following are dividers available for Ethercat clock.
5.1.1.12. enum Mcu_EthercatPhyClk
Enumerator |
Value |
Description |
---|---|---|
MCU_ECAT_PHYCLK_ENABLE |
0x100U |
Enable value 0x100. |
MCU_ECAT_PHYCLK_DISABLE |
0U |
Disable value 0. |
Brief: The following are values available to set enable/disable for EthcatPhyClock.
5.1.1.13. enum Mcu_HsmClockDiv
Enumerator |
Value |
Description |
---|---|---|
MCU_HSMCLK_DIV_1 |
0U |
divided by 1 |
MCU_HSMCLK_DIV_2 |
1U |
divided by 2 |
MCU_HSMCLK_DIV_4 |
2U |
divided by 4 |
MCU_HSMCLK_DIV_8 |
3U |
divided by 8 |
MCU_HSMCLK_DIV_16 |
4U |
divided by 16 |
Brief: The following are dividers available for HSM clock.
5.1.1.14. enum Mcu_EPWMClkDivider
Enumerator |
Value |
Description |
---|---|---|
MCU_EPWMCLK_DIV_1 |
0U |
EPWMCLK = PLLSYSCLK / 1. |
MCU_EPWMCLK_DIV_2 |
1U |
EPWMCLK = PLLSYSCLK / 2. |
Brief: The following are dividers available for EPWM clock.
5.1.1.15. enum Mcu_EMIFClkDivider
Enumerator |
Value |
Description |
---|---|---|
MCU_EMIFCLK_DIV_1 |
0U |
EMIF1CLK = PLLSYSCLK / 1. |
MCU_EMIFCLK_DIV_2 |
1U |
EMIF1CLK = PLLSYSCLK / 2. |
MCU_EMIFCLK_DIV_4 |
2U |
EMIF1CLK = PLLSYSCLK / 4. |
Brief: The following are dividers available for EMIF clock.
5.1.1.16. enum Mcu_LINClkDivider
Enumerator |
Value |
Description |
---|---|---|
MCU_LINCLK_DIV_1 |
0U |
LINCLK = PLLSYSCLK / 1. |
MCU_LINCLK_DIV_2 |
1U |
LINCLK = PLLSYSCLK / 2. |
MCU_LINCLK_DIV_4 |
2U |
LINCLK = PLLSYSCLK / 4. |
Brief: The following are dividers available for LIN clock.
5.1.1.17. enum Mcu_LINInstance
Enumerator |
Value |
Description |
---|---|---|
MCU_LIN_A |
0U |
LIN Instance A. |
MCU_LIN_B |
1U |
LIN Instance B. |
Brief: The following are instances available for LIN module.
5.1.1.18. enum Mcu_LowPowerModeType
Enumerator |
Value |
Description |
---|---|---|
MCU_IDLE_MODE |
0U |
MCU Idle mode. |
MCU_STANDBY_MODE |
1U |
MCU Standby mode. |
MCU_MODE_MAX |
Brief: List of low power modes.
5.1.2. Structures
Name |
Brief |
---|---|
MCU CONFIG ROOT structure. |
|
Structure for data pre-setting to be initialized. |
|
Structure for LIN clock register setting. |
|
Structure for EtherCat clock setting. |
|
Structure for MCAN clock register setting. |
|
Structure for Cpu Timer clock register setting. |
|
Structure for External Clock Output setting. |
|
Structure for peripheral clock register setting. |
|
Structure for device clock setting. |
|
Structure for Mcu low power mode configuration type. |
5.1.3. Defines
Name |
Brief |
---|---|
MCU_SW_MAJOR_VERSION |
Driver Implementation Major Version. |
MCU_SW_MINOR_VERSION |
Driver Implementation Minor Version. |
MCU_SW_PATCH_VERSION |
Driver Implementation Patch Version. |
MCU_AR_RELEASE_MAJOR_VERSION |
AUTOSAR Major version specification implemented by MCU Driver. |
MCU_AR_RELEASE_MINOR_VERSION |
AUTOSAR Minor version specification implemented by MCU Driver. |
MCU_AR_RELEASE_REVISION_VERSION |
AUTOSAR Patch version specification implemented by MCU Driver. |
MCU_VENDOR_ID |
Texas Instruments Vendor ID. |
MCU_MODULE_ID |
MCU Driver Module ID. |
MCU_INSTANCE_ID |
MCU Instance ID. |
MCU_SID_INIT |
Service ID for Mcu_Init. |
MCU_SID_INIT_RAMSECTION |
Service ID for Mcu_InitRamSection. |
MCU_SID_INIT_CLOCK |
Service ID for Mcu_InitClock. |
MCU_SID_DISTRIBUTE_PLL_CLOCK |
Service ID for Mcu_DistributePllClock. |
MCU_SID_GET_PLL_STATUS |
Service ID for Mcu_GetPllStatus. |
MCU_SID_GET_RESET_REASON |
Service ID for Mcu_GetResetReason. |
MCU_SID_GET_RESET_RAW_VALUE |
Service ID for Mcu_GetResetRawValue. |
MCU_SID_PERFORM_RESET |
Service ID for Mcu_PerformReset. |
MCU_SID_SET_MODE |
Service ID for Mcu_SetMode. |
MCU_SID_GET_VERSION_INFO |
Service ID for Mcu_GetVersionInfo. |
MCU_SID_GET_RAM_STATE |
Service ID for Mcu_GetRamState. |
MCU_E_PARAM_CONFIG |
Mcu_Init config param invalid. |
MCU_E_PARAM_CLOCK |
Mcu_InitClock clockid param invalid. |
MCU_E_PARAM_MODE |
Mcu_SetMode modeid param invalid. |
MCU_E_PARAM_RAMSECTION |
Mcu_InitRamSection ramSect param invalid. |
MCU_E_PLL_NOT_LOCKED |
PLL not locked. |
MCU_E_UNINIT |
API invoked without performing Mcu_Init. |
MCU_E_PARAM_POINTER |
NULL_PTR passed to MCU driver APIs. |
MCU_E_INIT_FAILED |
Mcu Initialization failed. |
MCU_ERRORRST_MASK |
Define indicating invalid raw reset value. |
MCU_REG_KEY |
Keys for the System control registers write protection. |
MCU_SYSCLKDIV_MAX |
Maximum System Clock Divider supported. |
MCU_PLLREFDIV_MAX |
Maximum PLL Reference Clock Divider supported. |
MCU_PLLINTMULT_MAX |
Maximum PLL Integer Multiplier supported. |
MCU_PLLOUTDIV_MAX |
Maximum PLL Output Clock Divider supported. |
MCU_EXTCLKFREQ_XTAL_MIN |
Minimum XTAL frequency supported. |
MCU_EXTCLKFREQ_XTAL_MAX |
Maximum XTAL frequency supported. |
MCU_EXTCLKFREQ_XTAL_SE_MIN |
Minimum XTAL frequency supported in Single Ended mode. |
MCU_EXTCLKFREQ_XTAL_SE_MAX |
Maximum XTAL frequency supported in Single Ended mode. |
MCU_OSC_CLK_FREQ |
Internal Oscillator Frequency. |
MCU_PLLRAWCLK_MIN |
Minimum Frequency of PLL RAW clock (before SYSCLK divider) |
MCU_PLLRAWCLK_MAX |
Maximum Frequency of PLL RAW clock (before SYSCLK divider) |
MCU_PLLINTCLK_MIN |
Minimum Frequency of Internal clock (before SYSCLK divider) |
MCU_PLLINTCLK_MAX |
Maximum Frequency of Internal clock (before SYSCLK divider) |
MCU_PLLVCOCLK_MIN |
Minimum Frequency of VCO clock (before SYSCLK divider) |
MCU_PLLVCOCLK_MAX |
Maximum Frequency of VCO clock (before SYSCLK divider) |
MCU_SYSCLK_MIN |
Minimum Frequency of device (system) clock. |
MCU_SYSCLK_MAX |
Maximum Frequency of device (system) clock. |
MCU_LPM_IDLE |
LPM defines for LPMCR.LPM IDLE. |
MCU_LPM_STANDBY |
LPM defines for LPMCR.LPM STANDBY. |
MCU_STANDBY_QUALPERIOD_MAX |
Maximum Standby Qualification period supported. |
MCU_STANDBY_QUALPERIOD_MIN |
Minimum Standby Qualification period supported. |
5.1.4. Functions
Return type |
Function Name |
Brief |
---|---|---|
void |
Mcu_GetVersionInfo(Std_VersionInfoType * versioninfo) |
This service provides the version information of MCU module. |
void |
Mcu_Init(const Mcu_ConfigType * CfgPtr) |
This service initializes the MCU driver. |
Std_ReturnType |
Mcu_InitRamSection(Mcu_RamSectionType RamSection) |
This service initializes the RAM section wise with default values supplied in configuration set. |
Std_ReturnType |
Mcu_InitClock(Mcu_ClockType ClockSetting) |
This service initializes the PLL and other MCU specific clock options. |
Mcu_GetPllStatus(void ) |
This service provides the lock status of the PLL. |
|
Mcu_GetResetReason(void ) |
The service reads the reset reason from the hardware. |
|
Mcu_GetResetRawValue(void ) |
The service reads the raw reset value from the hardware register. |
|
void |
Mcu_PerformReset(void ) |
The service performs a microcontroller reset. |
void |
Mcu_SetMode(Mcu_ModeType McuMode) |
The service activates low power modes. |
Mcu_GetRamState(void ) |
This service provides the actual status of the microcontroller Ram. |
|
Std_ReturnType |
Mcu_SetClock(Mcu_ClockConfigPtrType ClockConfigPtr) |
Set the Oscillator source, Multiplier and divider to derive the clock. |
void |
Mcu_EnablePll(void ) |
Sets up the SysPLL divider & enables the PLL. |
uint16 |
Mcu_IsPllLocked(void ) |
Checks if the PLL is locked successfully. |
Mcu_GetResetCause(void ) |
Gets the reason for a reset. |
|
Mcu_ConvertResetReason(Mcu_RawResetType RawResetType) |
Converts the controller specific reset reason to AUTOSAR format. |
|
void |
Mcu_ClearReset(Mcu_RawResetType RawResetType) |
Clears the Reset Cause register. |
void |
Mcu_PerformControllerReset(void ) |
Perform simulation of external reset. |
void |
Mcu_EnterLowPowerMode(Mcu_ModeConfigPtrType ModeConfigPtr) |
Set & enter the Low Power Mode. |
boolean |
Get the missing clock detection Failure Status. |
|
void |
Mcu_ResetMCD(void ) |
Reset the missing clock detection logic after clock failure. |
void |
Mcu_SetPLLSysClk(uint16 divider) |
Sets up PLLSYSCLK divider. |
void |
Mcu_EnterIdleMode(void ) |
Enters IDLE mode. |
void |
Mcu_EnterStandbyMode(void ) |
Enters STANDBY mode. |
void |
Mcu_SetStandbyQualificationPeriod(uint16 cycles) |
Sets the number of cycles to qualify an input on waking from STANDBY mode. |
void |
Enable the device to wake from STANDBY mode upon a watchdog interrupt. |
|
void |
Disable the device from waking from STANDBY mode upon a watchdog interrupt. |
5.1.4.1. function Mcu_GetVersionInfo
void Mcu_GetVersionInfo(
Std_VersionInfoType * versioninfo
)
Brief: This service provides the version information of MCU module.
Parameters:
versioninfo - Pointer to MCU driver version information.
Returns:
None
Return: None
Precondition: This API is available only if MCU_CFG_GET_VERSION_INFO_API is STD_ON
Postcondition: None
5.1.4.2. function Mcu_Init
void Mcu_Init(
const Mcu_ConfigType * CfgPtr
)
Brief: This service initializes the MCU driver.
This API is used to configure MCU settings for PLL and clock. This API is used to configure RAM section settings and Power mode settings.
Parameters:
CfgPtr - Pointer to MCU driver configuration set.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.3. function Mcu_InitRamSection
Std_ReturnType Mcu_InitRamSection(
Mcu_RamSectionType RamSection
)
Brief: This service initializes the RAM section wise with default values supplied in configuration set.
This service initializes the RAM section wise.
Parameters:
RamSection Selects RAM memory section provided in configuration set
Returns:
E_OK command has been accepted
E_NOT_OK command has not been accepted
Return: Std_ReturnType
Precondition: None
Postcondition: None
5.1.4.4. function Mcu_InitClock
Std_ReturnType Mcu_InitClock(
Mcu_ClockType ClockSetting
)
Brief: This service initializes the PLL and other MCU specific clock options.
This API is used to initializate clock & PLL This API is used to Set CPU timer clock, XCLKOUT, Ethercat clock, Peripheral clocks, MCAN module clocks
Parameters:
ClockSetting Selects clock section details provided in configuration set
Returns:
E_OK command has been accepted.
E_NOT_OK command has not been accepted
Return: Std_ReturnType
Precondition: This API is available only if MCU_CFG_INIT_CLOCK_API is STD_ON
Postcondition: None
5.1.4.5. function Mcu_GetPllStatus
Mcu_PllStatusType Mcu_GetPllStatus(
void
)
Brief: This service provides the lock status of the PLL.
Parameters:
None
None
Returns:
MCU_PLL_LOCKED PLL is in locked state. MCU_PLL_UNLOCKED: PLL is in unlocked state. MCU_PLL_STATUS_UNDEFINED: Pre-compile McuNoPll is set to true.
Return: Mcu_PllStatusType - PLL Status
Precondition: None
Postcondition: None
5.1.4.6. function Mcu_GetResetReason
Mcu_ResetType Mcu_GetResetReason(
void
)
Brief: The service reads the reset reason from the hardware.
This API reads the reset value from hardware and returns from the list of reset types defined in Mcu_ResetType.
Returns:
MCU_POWER_ON_RESET Power On reset
MCU_EXTERNAL_RESET External reset
MCU_ESM_NMI_WATCHDOG_RESET NMI Watchdog reset
MCU_WATCHDOG_RESET Watchdog reset
MCU_SW_RESET Simulation of external reset
MCU_ESM_RESET ESM reset
MCU_RESET_UNDEFINED UNDEFINED reset
Return: Mcu_ResetType - Reset Type
Precondition: None
Postcondition: None
5.1.4.7. function Mcu_GetResetRawValue
Mcu_RawResetType Mcu_GetResetRawValue(
void
)
Brief: The service reads the raw reset value from the hardware register.
This API reads the reset value from hardware and returns it.
Returns:
Reset raw value
Return: Mcu_RawResetType - Reset raw value
Precondition: None
Postcondition: None
5.1.4.8. function Mcu_PerformReset
void Mcu_PerformReset(
void
)
Brief: The service performs a microcontroller reset.
This API perform simulation of external reset only
Returns:
None
Return: None
Precondition: This API is available only if MCU_CFG_PERFORM_RESET_API is STD_ON
Postcondition: None
5.1.4.9. function Mcu_SetMode
void Mcu_SetMode(
Mcu_ModeType McuMode
)
Brief: The service activates low power modes.
This API is used to activate the low power modes IDLE & STANDBY
Parameters:
McuMode - ID to select one MCU mode setting from the list provided in configuration set
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.10. function Mcu_GetRamState
Mcu_RamStateType Mcu_GetRamState(
void
)
Brief: This service provides the actual status of the microcontroller Ram.
This API is not checking actual RAM status. So no actions are performed and returns RAM VALID
Returns:
MCU_RAMSTATE_INVALID Invalid Ram status
MCU_RAMSTATE_VALID Valid Ram status
Return: Mcu_RamStateType - Ram State Type
Precondition: This API is available only if MCU_CFG_GET_RAM_STATE_API is STD_ON
Postcondition: None
5.1.4.11. function Mcu_SetClock
Std_ReturnType Mcu_SetClock(
Mcu_ClockConfigPtrType ClockConfigPtr
)
Brief: Set the Oscillator source, Multiplier and divider to derive the clock.
This function sets the clocks to Cputimer2 module, XCLKOUT, Ethercat and enables peripheral module clock gatings
Parameters:
ClockConfigPtr Pointer to Clock configuration set. (Mcu_ClockConfigPtrType) configured in EB Tresos.
Returns:
E_OK - If all parameters are in range & no error is present in configuration.
E_NOT_OK - If there are no errors.
Return: Std_ReturnType
Precondition: None
Postcondition: None
5.1.4.12. function Mcu_EnablePll
void Mcu_EnablePll(
void
)
Brief: Sets up the SysPLL divider & enables the PLL.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.13. function Mcu_IsPllLocked
uint16 Mcu_IsPllLocked(
void
)
Brief: Checks if the PLL is locked successfully.
Returns:
0 - If PLL is not locked yet.
1 - If PLL is locked.
Return: returns the pll lock status
Precondition: None
Postcondition: None
5.1.4.14. function Mcu_GetResetCause
Mcu_RawResetType Mcu_GetResetCause(
void
)
Brief: Gets the reason for a reset.
This function will return the reason(s) for a reset. Since the reset reasons are sticky until either cleared by software or an external reset, multiple reset reasons may be returned if multiple resets have occurred.
Returns:
Reason(s) for a reset.
Return: returns the raw reset value
Precondition: None
Postcondition: None
5.1.4.15. function Mcu_ConvertResetReason
Mcu_ResetType Mcu_ConvertResetReason(
Mcu_RawResetType RawResetType
)
Brief: Converts the controller specific reset reason to AUTOSAR format.
Parameters:
RawResetType Reset Reason
Returns:
Returns Reset reason defined.
Return: Mcu_ResetType
Precondition: None
Postcondition: None
5.1.4.16. function Mcu_ClearReset
void Mcu_ClearReset(
Mcu_RawResetType RawResetType
)
Brief: Clears the Reset Cause register.
Parameters:
RawResetType Reset Reason
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.17. function Mcu_PerformControllerReset
void Mcu_PerformControllerReset(
void
)
Brief: Perform simulation of external reset.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.18. function Mcu_EnterLowPowerMode
void Mcu_EnterLowPowerMode(
Mcu_ModeConfigPtrType ModeConfigPtr
)
Brief: Set & enter the Low Power Mode.
Parameters:
ModeConfigPtr Pointer to Power mode configuration set. (Mcu_ModeConfigPtrType) configured in EB Tresos.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.19. function Mcu_IsMCDClockFailureDetected
static inline boolean Mcu_IsMCDClockFailureDetected(
void
)
Brief: Get the missing clock detection Failure Status.
A failure means the oscillator clock is missing
Returns:
TRUE if a failure is detected
FALSE if a failure isn’t detected
Return: boolean type
Precondition: None
Postcondition: None
5.1.4.20. function Mcu_ResetMCD
static inline void Mcu_ResetMCD(
void
)
Brief: Reset the missing clock detection logic after clock failure.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.21. function Mcu_SetPLLSysClk
static inline void Mcu_SetPLLSysClk(
uint16 divider
)
Brief: Sets up PLLSYSCLK divider.
This function sets up the PLLSYSCLK divider. There is only one divider that scales PLLSYSCLK to generate the system clock.
The divider parameter can have one value from the set below: 0x0 = /1 0x1 = /2 0x2 = /4 (default on reset) 0x3 = /6 0x4 = /8 …… 0x3F =/126
Parameters:
divider is the value that configures the divider.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.22. function Mcu_EnterIdleMode
static inline void Mcu_EnterIdleMode(
void
)
Brief: Enters IDLE mode.
This function puts the device into IDLE mode. The CPU clock is gated while all peripheral clocks are left running. Any enabled interrupt will wake the CPU up from IDLE mode.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.23. function Mcu_EnterStandbyMode
static inline void Mcu_EnterStandbyMode(
void
)
Brief: Enters STANDBY mode.
This function puts the device into STANDBY mode. This will gate both the CPU clock and any peripheral clocks derived from SYSCLK. The watchdog is left active, and an NMI or an optional watchdog interrupt will wake the CPU subsystem from STANDBY mode.
GPIOs may be configured to wake the CPU subsystem.
The CPU will receive an interrupt (WAKEINT) on wakeup.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.24. function Mcu_SetStandbyQualificationPeriod
static inline void Mcu_SetStandbyQualificationPeriod(
uint16 cycles
)
Brief: Sets the number of cycles to qualify an input on waking from STANDBY mode.
This function sets the number of OSCCLK clock cycles used to qualify the selected inputs when waking from STANDBY mode. The cycles parameter should be between 2 and 65 cycles inclusive.
Parameters:
cycles is the number of OSCCLK cycles.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.25. function Mcu_EnableWatchdogStandbyWakeup
static inline void Mcu_EnableWatchdogStandbyWakeup(
void
)
Brief: Enable the device to wake from STANDBY mode upon a watchdog interrupt.
In order to use this option, Need to configure the watchdog to generate an interrupt.
Returns:
None
Return: None
Precondition: None
Postcondition: None
5.1.4.26. function Mcu_DisableWatchdogStandbyWakeup
static inline void Mcu_DisableWatchdogStandbyWakeup(
void
)
Brief: Disable the device from waking from STANDBY mode upon a watchdog interrupt.
Returns:
None
Return: None
Precondition: None
Postcondition: None