![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
Data Structures | |
| struct | stc_backupreg |
Macros | |
| #define | PDL_u8BREG00 0u |
| #define | PDL_u8BREG01 1u |
| #define | PDL_u8BREG02 2u |
| #define | PDL_u8BREG03 3u |
| #define | PDL_u8BREG04 4u |
| #define | PDL_u8BREG05 5u |
| #define | PDL_u8BREG06 6u |
| #define | PDL_u8BREG07 7u |
| #define | PDL_u8BREG08 8u |
| #define | PDL_u8BREG09 9u |
| #define | PDL_u8BREG0A 10u |
| #define | PDL_u8BREG0B 11u |
| #define | PDL_u8BREG0C 12u |
| #define | PDL_u8BREG0D 13u |
| #define | PDL_u8BREG0E 14u |
| #define | PDL_u8BREG0F 15u |
| #define | PDL_u8BREG10 16u |
| #define | PDL_u8BREG11 17u |
| #define | PDL_u8BREG12 18u |
| #define | PDL_u8BREG13 19u |
| #define | PDL_u8BREG14 20u |
| #define | PDL_u8BREG15 21u |
| #define | PDL_u8BREG16 22u |
| #define | PDL_u8BREG17 23u |
| #define | PDL_u8BREG18 24u |
| #define | PDL_u8BREG19 25u |
| #define | PDL_u8BREG1A 26u |
| #define | PDL_u8BREG1B 27u |
| #define | PDL_u8BREG1C 28u |
| #define | PDL_u8BREG1D 29u |
| #define | PDL_u8BREG1E 30u |
| #define | PDL_u8BREG1F 31u |
| #define | PDL_u16BREG00 0u |
| #define | PDL_u16BREG02 2u |
| #define | PDL_u16BREG04 4u |
| #define | PDL_u16BREG06 6u |
| #define | PDL_u16BREG08 8u |
| #define | PDL_u16BREG0A 10u |
| #define | PDL_u16BREG0C 12u |
| #define | PDL_u16BREG0E 14u |
| #define | PDL_u16BREG10 16u |
| #define | PDL_u16BREG12 18u |
| #define | PDL_u16BREG14 20u |
| #define | PDL_u16BREG16 22u |
| #define | PDL_u16BREG18 24u |
| #define | PDL_u16BREG1A 26u |
| #define | PDL_u16BREG1C 28u |
| #define | PDL_u16BREG1E 30u |
| #define | PDL_u32BREG00 0u |
| #define | PDL_u32BREG04 4u |
| #define | PDL_u32BREG08 8u |
| #define | PDL_u32BREG0C 12u |
| #define | PDL_u32BREG10 16u |
| #define | PDL_u32BREG14 20u |
| #define | PDL_u32BREG18 24u |
| #define | PDL_u32BREG1C 28u |
Typedefs | |
| typedef struct stc_backupreg | stc_backupreg_t |
Functions | |
| static en_result_t | ReadBackupRegisters (stc_backupreg_t *stcBackUpReg) |
| Read Backup Registers. More... | |
| static en_result_t | WriteBackupRegisters (stc_backupreg_t *stcBackUpReg) |
| Write Backup Registers. More... | |
| en_result_t | Lpm_SetHsCrSleep (boolean_t bDisablePllMainClock, boolean_t bDisableSubClock) |
| Enter HS-CR Sleep Mode. More... | |
| en_result_t | Lpm_SetMainSleep (boolean_t bDisablePllClock, boolean_t bDisableSubClock) |
| Enter Main Sleep Mode. More... | |
| en_result_t | Lpm_SetPllSleep (boolean_t bDisableSubClock) |
| Enter PLL Sleep Mode. More... | |
| en_result_t | Lpm_SetLsCrSleep (boolean_t bDisablePllMainClock, boolean_t bDisableSubClock) |
| Enter LS-CR Sleep Mode. More... | |
| en_result_t | Lpm_SetSubSleep (boolean_t bDisablePllMainClock) |
| Enter Sub Sleep Mode. More... | |
| en_result_t | Lpm_SetPllTimer (boolean_t bDisableSubClock) |
| Enter PLL Timer Mode. More... | |
| en_result_t | Lpm_SetHsCrTimer (boolean_t bDisablePllMainClock, boolean_t bDisableSubClock) |
| Enter HS-CR Timer Mode. More... | |
| en_result_t | Lpm_SetMainTimer (boolean_t bDisablePllClock, boolean_t bDisableSubClock) |
| Enter Main Timer Mode. More... | |
| en_result_t | Lpm_SetLsCrTimer (boolean_t bDisablePllMainClock, boolean_t bDisableSubClock) |
| Enter LS-CR Timer Mode. More... | |
| en_result_t | Lpm_SetSubTimer (boolean_t bDisablePllMainClock) |
| Enter Sub Timer Mode. More... | |
| en_result_t | Lpm_SetRtcMode (void) |
| Enter RTC Mode. More... | |
| en_result_t | Lpm_SetStopMode (void) |
| Enter Stop Mode. More... | |
| en_result_t | Lpm_SetDeepRtcMode (void) |
| Enter Deep RTC Mode. More... | |
| en_result_t | Lpm_SetDeepStopMode (void) |
| Enter Deep Stop Mode. More... | |
| en_result_t | Lpm_ReadBackupRegisters (stc_backupreg_t *stcBackUpReg) |
| Read Backup Registers. More... | |
| en_result_t | Lpm_WriteBackupRegisters (stc_backupreg_t *stcBackUpReg) |
| Write Backup Registers. More... | |
| en_result_t | Lpm_Read_u8DataBackupRegister (uint8_t u8AddressOffset, uint8_t *u8Data) |
| Read Backup Register (Byte) More... | |
| en_result_t | Lpm_Write_u8DataBackupRegister (uint8_t u8AddressOffset, uint8_t u8Data) |
| Write Backup Registers (Byte) More... | |
| en_result_t | Lpm_Read_u16DataBackupRegister (uint8_t u8AddressOffset, uint16_t *u16Data) |
| Read Backup Register (16-Bit) More... | |
| en_result_t | Lpm_Write_u16DataBackupRegister (uint8_t u8AddressOffset, uint16_t u16Data) |
| Write Backup Registers (16-Bit) More... | |
| en_result_t | Lpm_Read_u32DataBackupRegister (uint8_t u8AddressOffset, uint32_t *u32Data) |
| Read Backup Register (32-Bit) More... | |
| en_result_t | Lpm_Write_u32DataBackupRegister (uint8_t u8AddressOffset, uint32_t u32Data) |
| Write Backup Registers (32-Bit) More... | |
Provided functions of LPM module:
Lpm_WriteBackupRegisters() writes a structure of the type of stc_backupreg_t to the back-up registers and Lpm_ReadBackupRegisters() reads them out to this structure.
Lpm_Read_u8DataBackupRegister() and Lpm_Write_u8DataBackupRegister() accesses a single byte of the back-up registers.
Lpm_Read_u16DataBackupRegister() and Lpm_Write_u16DataBackupRegister() accesses 16-Bit data of the back-up registers.
Lpm_Read_u32DataBackupRegister() and Lpm_Write_u32DataBackupRegister() accesses 32-Bit data of the back-up registers.
The following functions are only available, if CLK and EXINT modules are activated:
Sleep Mode Transition Functions:
| Lpm_SetHsCrSleep() | High-Speec CR Clock |
| Lpm_SetMainSleep() | Main Clock |
| Lpm_SetPllSleep() | PLL Clock |
| Lpm_SetLsCrSleep() | Low-Speed CR Clock |
| Lpm_SetSubSleep() | Sub Clock |
Timer Mode Transition Functions:
| Lpm_SetHsCrTimer() | High-Speec CR Clock |
| Lpm_SetMainTimer() | Main Clock |
| Lpm_SetPllTimer() | PLL Clock |
| Lpm_SetLsCrTimer() | Low-Speed CR Clock |
| Lpm_SetSubTimer() | Sub Clock |
Stop Mode Transition Functions:
| Lpm_SetRtcMode() | RTC Stop Mode |
| Lpm_SetStopMode() | Stop Mode |
Deep Standby Mode Transition Functions:
| Lpm_SetDeepRtcMode() | Deep RTC Stop Mode |
| Lpm_SetDeepStopMode() | Deep Stop Mode |
| typedef struct stc_backupreg stc_backupreg_t |
| en_result_t Lpm_Read_u16DataBackupRegister | ( | uint8_t | u8AddressOffset, |
| uint16_t * | u16Data | ||
| ) |
Read Backup Register (16-Bit)
| [in] | u8AddressOffset | Byte address offset to Back-up register |
| [out] | u16Data | Pointer to 16-Bit data to be read |
| Ok | Successfully written |
| ErrorInvalidParameter | Address offset out of range (highest priority) |
| ErrorAddressAlignment | Address not aligned to 16-bit |
Definition at line 664 of file lpm.c.
References ErrorAddressAlignment, ErrorInvalidParameter, Ok, PDL_BACK_UP_REGISTERS, ReadBackupRegisters(), and stc_backupreg::u8BREG00.

| en_result_t Lpm_Read_u32DataBackupRegister | ( | uint8_t | u8AddressOffset, |
| uint32_t * | u32Data | ||
| ) |
Read Backup Register (32-Bit)
| [in] | u8AddressOffset | Byte address offset to Back-up register |
| [out] | u32Data | Pointer to 32-Bit data to be read |
| Ok | Successfully written |
| ErrorInvalidParameter | Address offset out of range (highest priority) |
| ErrorAddressAlignment | Address not aligned to 32-bit |
Definition at line 728 of file lpm.c.
References ErrorAddressAlignment, ErrorInvalidParameter, Ok, PDL_BACK_UP_REGISTERS, ReadBackupRegisters(), and stc_backupreg::u8BREG00.

| en_result_t Lpm_Read_u8DataBackupRegister | ( | uint8_t | u8AddressOffset, |
| uint8_t * | u8Data | ||
| ) |
Read Backup Register (Byte)
| [in] | u8AddressOffset | Byte address offset to Back-up register |
| [out] | u8Data | Pointer to Byte data to be read |
| Ok | Successfully written |
| ErrorInvalidParameter | Address offset out of range |
Definition at line 611 of file lpm.c.
References ErrorInvalidParameter, Ok, PDL_BACK_UP_REGISTERS, ReadBackupRegisters(), and stc_backupreg::u8BREG00.

| en_result_t Lpm_ReadBackupRegisters | ( | stc_backupreg_t * | stcBackUpReg | ) |
Read Backup Registers.
| [out] | stcBackUpReg | Pointer to a data structure of backup registers to be read |
| Ok | Successfully read |
Definition at line 579 of file lpm.c.
References Ok, and ReadBackupRegisters().

| en_result_t Lpm_SetDeepRtcMode | ( | void | ) |
Enter Deep RTC Mode.
| Ok | Returned from Deep RTC Mode |
Definition at line 541 of file lpm.c.
References Clk_SetMode(), ClkDeepRtc, stc_clk_main_config::enMode, and Ok.

| en_result_t Lpm_SetDeepStopMode | ( | void | ) |
Enter Deep Stop Mode.
| Ok | Returned from Deep Stop Mode |
Definition at line 557 of file lpm.c.
References Clk_SetMode(), ClkDeepStop, stc_clk_main_config::enMode, and Ok.

| en_result_t Lpm_SetHsCrSleep | ( | boolean_t | bDisablePllMainClock, |
| boolean_t | bDisableSubClock | ||
| ) |
Enter HS-CR Sleep Mode.
| [in] | bDisablePllMainClock | TRUE: Disable PLL Clock and Main Clock |
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from HS-CR Sleep Mode |
Definition at line 158 of file lpm.c.
References Clk_DisableMainClock(), Clk_DisablePllClock(), Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToHsCrClock(), ClkSleep, stc_clk_main_config::enMode, Ok, and TRUE.

| en_result_t Lpm_SetHsCrTimer | ( | boolean_t | bDisablePllMainClock, |
| boolean_t | bDisableSubClock | ||
| ) |
Enter HS-CR Timer Mode.
| [in] | bDisablePllMainClock | TRUE: Disable PLL Clock and Main Clock |
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from HS-CR Timer Mode |
Definition at line 369 of file lpm.c.
References Clk_DisableMainClock(), Clk_DisablePllClock(), Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToHsCrClock(), ClkTimer, stc_clk_main_config::enMode, Ok, and TRUE.

| en_result_t Lpm_SetLsCrSleep | ( | boolean_t | bDisablePllMainClock, |
| boolean_t | bDisableSubClock | ||
| ) |
Enter LS-CR Sleep Mode.
| [in] | bDisablePllMainClock | TRUE: Disable PLL Clock and Main Clock |
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from LS-CR Sleep Mode |
Definition at line 264 of file lpm.c.
References Clk_DisableMainClock(), Clk_DisablePllClock(), Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToLsCrClock(), ClkSleep, stc_clk_main_config::enMode, Ok, and TRUE.

| en_result_t Lpm_SetLsCrTimer | ( | boolean_t | bDisablePllMainClock, |
| boolean_t | bDisableSubClock | ||
| ) |
Enter LS-CR Timer Mode.
| [in] | bDisablePllMainClock | TRUE: Disable PLL Clock and Main Clock |
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from LS-CR Timer Mode |
Definition at line 439 of file lpm.c.
References Clk_DisableMainClock(), Clk_DisablePllClock(), Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToLsCrClock(), ClkTimer, stc_clk_main_config::enMode, Ok, and TRUE.

| en_result_t Lpm_SetMainSleep | ( | boolean_t | bDisablePllClock, |
| boolean_t | bDisableSubClock | ||
| ) |
Enter Main Sleep Mode.
| [in] | bDisablePllClock | TRUE: Disable PLL Clock |
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from Main Sleep Mode |
Definition at line 193 of file lpm.c.
References Clk_DisablePllClock(), Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToMainClock(), ClkSleep, stc_clk_main_config::enMode, Ok, and TRUE.

| en_result_t Lpm_SetMainTimer | ( | boolean_t | bDisablePllClock, |
| boolean_t | bDisableSubClock | ||
| ) |
Enter Main Timer Mode.
| [in] | bDisablePllClock | TRUE: Disable PLL Clock |
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from Main Timer Mode |
Definition at line 404 of file lpm.c.
References Clk_DisablePllClock(), Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToMainClock(), ClkTimer, stc_clk_main_config::enMode, Ok, and TRUE.

| en_result_t Lpm_SetPllSleep | ( | boolean_t | bDisableSubClock | ) |
Enter PLL Sleep Mode.
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from PLL Sleep Mode |
| ErrorNotReady | PLL clock not available |
Definition at line 231 of file lpm.c.
References Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), ClkSleep, stc_clk_main_config::enMode, ErrorNotReady, Ok, and TRUE.

| en_result_t Lpm_SetPllTimer | ( | boolean_t | bDisableSubClock | ) |
Enter PLL Timer Mode.
| [in] | bDisableSubClock | TRUE: Disable Sub Clock |
| Ok | Returned from PLL Timer Mode |
| ErrorNotReady | PLL clock not available |
Definition at line 336 of file lpm.c.
References Clk_DisableSubClock(), Clk_MainGetParameters(), Clk_SetMode(), ClkTimer, stc_clk_main_config::enMode, ErrorNotReady, Ok, and TRUE.

| en_result_t Lpm_SetRtcMode | ( | void | ) |
Enter RTC Mode.
| Ok | Returned from RTC Mode |
Definition at line 507 of file lpm.c.
References Clk_SetMode(), ClkRtc, stc_clk_main_config::enMode, and Ok.

| en_result_t Lpm_SetStopMode | ( | void | ) |
Enter Stop Mode.
| Ok | Returned from Stop Mode |
Definition at line 523 of file lpm.c.
References Clk_SetMode(), ClkStop, stc_clk_main_config::enMode, and Ok.

| en_result_t Lpm_SetSubSleep | ( | boolean_t | bDisablePllMainClock | ) |
Enter Sub Sleep Mode.
| [in] | bDisablePllMainClock | TRUE: Disable PLL Clock and Main Clock |
| Ok | Returned from LS-CR Sleep Mode |
| ErrorNotReady | Sub clock not available |
Definition at line 299 of file lpm.c.
References Clk_DisableMainClock(), Clk_DisablePllClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToSubClock(), ClkSleep, stc_clk_main_config::enMode, ErrorNotReady, Ok, and TRUE.

| en_result_t Lpm_SetSubTimer | ( | boolean_t | bDisablePllMainClock | ) |
Enter Sub Timer Mode.
| [in] | bDisablePllMainClock | TRUE: Disable PLL Clock and Main Clock |
| Ok | Returned from LS-CR Timer Mode |
| ErrorNotReady | Sub clock not available |
Definition at line 474 of file lpm.c.
References Clk_DisableMainClock(), Clk_DisablePllClock(), Clk_MainGetParameters(), Clk_SetMode(), Clk_SwitchToSubClock(), ClkTimer, stc_clk_main_config::enMode, ErrorNotReady, Ok, and TRUE.

| en_result_t Lpm_Write_u16DataBackupRegister | ( | uint8_t | u8AddressOffset, |
| uint16_t | u16Data | ||
| ) |
Write Backup Registers (16-Bit)
| [in] | u8AddressOffset | Byte address offset to Back-up register |
| [in] | u16Data | 16-Bit data to be written |
| Ok | Successfully written |
| ErrorInvalidParameter | Address offset out of range (highest priority) |
| ErrorAddressAlignment | Address not aligned to 16-bit |
Definition at line 696 of file lpm.c.
References ErrorAddressAlignment, ErrorInvalidParameter, Ok, PDL_BACK_UP_REGISTERS, ReadBackupRegisters(), stc_backupreg::u8BREG00, and WriteBackupRegisters().

| en_result_t Lpm_Write_u32DataBackupRegister | ( | uint8_t | u8AddressOffset, |
| uint32_t | u32Data | ||
| ) |
Write Backup Registers (32-Bit)
| [in] | u8AddressOffset | Byte address offset to Back-up register |
| [in] | u32Data | Pointer to 32-Bit data |
| Ok | Successfully written |
| ErrorInvalidParameter | Address offset out of range (highest priority) |
| ErrorAddressAlignment | Address not aligned to 32-bit |
Definition at line 760 of file lpm.c.
References ErrorAddressAlignment, ErrorInvalidParameter, Ok, PDL_BACK_UP_REGISTERS, ReadBackupRegisters(), stc_backupreg::u8BREG00, and WriteBackupRegisters().

| en_result_t Lpm_Write_u8DataBackupRegister | ( | uint8_t | u8AddressOffset, |
| uint8_t | u8Data | ||
| ) |
Write Backup Registers (Byte)
| [in] | u8AddressOffset | Byte address offset to Back-up register |
| [in] | u8Data | Byte data to be written |
| Ok | Successfully written |
| ErrorInvalidParameter | Address offset out of range |
Definition at line 637 of file lpm.c.
References ErrorInvalidParameter, Ok, PDL_BACK_UP_REGISTERS, ReadBackupRegisters(), stc_backupreg::u8BREG00, and WriteBackupRegisters().

| en_result_t Lpm_WriteBackupRegisters | ( | stc_backupreg_t * | stcBackUpReg | ) |
Write Backup Registers.
| [in] | stcBackUpReg | structure of backup registers |
| Ok | Successfully written |
Definition at line 594 of file lpm.c.
References Ok, and WriteBackupRegisters().

|
static |
Read Backup Registers.
| [out] | stcBackUpReg | double pointer to user backup register structure |
| Ok | Successfully read |
Definition at line 98 of file lpm.c.
References Ok, PDL_BACK_UP_REGISTERS, and stc_backupreg::u8BREG00.
Referenced by Lpm_Read_u16DataBackupRegister(), Lpm_Read_u32DataBackupRegister(), Lpm_Read_u8DataBackupRegister(), Lpm_ReadBackupRegisters(), Lpm_Write_u16DataBackupRegister(), Lpm_Write_u32DataBackupRegister(), and Lpm_Write_u8DataBackupRegister().

|
static |
Write Backup Registers.
| [out] | stcBackUpReg | structure of backup registers |
| Ok | Successfully written |
Definition at line 126 of file lpm.c.
References Ok, PDL_BACK_UP_REGISTERS, and stc_backupreg::u8BREG00.
Referenced by Lpm_Write_u16DataBackupRegister(), Lpm_Write_u32DataBackupRegister(), Lpm_Write_u8DataBackupRegister(), and Lpm_WriteBackupRegisters().
