Other Parts Discussed in Thread: C2000WARE
Dear Champs,
I am asking this for our customer.
There are many useful functions defined in buck_lfu.h for LFU related registers.
That is,
#pragma FUNC_ALWAYS_INLINE(BUCK_LFU_getBackgroundTaskControlRegister); static inline uint16_t BUCK_LFU_getBackgroundTaskControlRegister(uint32_t base) { // // Return the background task control register value // return((HWREGH(base + CLA_O_MCTLBGRND) & (uint16_t)CLA_MCTLBGRND_BGSTART)); } #endif static inline void LFU_setLFUCPU(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set LFU_CPU bit // EALLOW; HWREGH(base + LFUConfig) |= LFU_CPU; EDIS; } static inline void LFU_setLFUCLA(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set LFU_CLA1 bit // EALLOW; HWREGH(base + LFUConfig) |= LFU_CLA1; EDIS; } static inline void LFU_setPieVectorSwap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set PieVectorSwap bit // EALLOW; HWREG(base + LFUConfig) |= PieVectorSwap; EDIS; } static inline void LFU_setLS01Swap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set LS01Swap bit // EALLOW; HWREG(base + LFUConfig) |= LS01Swap; EDIS; } static inline void LFU_setSwap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set PieVectorSwap and LS01Swap bits // EALLOW; HWREG(base + LFUConfig) |= SWAPS; EDIS; } static inline void LFU_clearSwap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Clear PieVectorSwap and LS01Swap bits // EALLOW; HWREG(base + LFUConfig) &= ~(SWAPS); EDIS; } static inline void LFU_clearLFUCPU(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set LFU_CPU bit // EALLOW; HWREGH(base + LFUConfig) &= ~(LFU_CPU); EDIS; } static inline void LFU_clearLFUCLA(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set LFU_CLA1 bit // EALLOW; HWREGH(base + LFUConfig) &= ~(LFU_CLA1); EDIS; } static inline void LFU_clearPieVectorSwap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Set PieVectorSwap bit // EALLOW; HWREG(base + LFUConfig) &= ~(PieVectorSwap); EDIS; } static inline void LFU_clearLS01Swap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Clear LS01Swap bit // EALLOW; HWREG(base + LFUConfig) &= ~(LS01Swap); EDIS; } static inline uint32_t LFU_getPieVectorSwap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Get PieVectorSwap bit // return((HWREG(base + LFUStatus)) & (uint32_t)PieVectorSwap); } static inline uint32_t LFU_getLS01Swap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Get LS01Swap bit // return((HWREG(base + LFUStatus)) & (uint32_t)LS01Swap); } static inline uint16_t LFU_getLFUCPU(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Get LFU_CPU bit // return((HWREGH(base + LFUConfig)) & (uint16_t)LFU_CPU); } static inline uint16_t LFU_getLFUCLA(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Get LFU_CLA1 bit // return((HWREGH(base + LFUConfig)) & (uint16_t)LFU_CLA1); } static inline uint32_t LFU_getSwap(uint32_t base) { // // Check the arguments. // //ASSERT(SCI_isBaseValid(base)); // // Get PieVectorSwap bit // return((HWREG(base + LFUStatus)) & (uint32_t)SWAPS); } // // Function to register an ISR into the Shadow PIE vector table (for LFU) // for registering into the main/normal PIE vector table, Interrupt_Register() can be used // static inline void Shadow_Interrupt_register(uint32_t interruptNumber, void (*handler)(void)) { uint32_t address; // // Calculate appropriate address for the interrupt number // address = (uint32_t)SHADOW_PIEVECTTABLE_BASE + (((interruptNumber & 0xFFFF0000U) >> 16U) * 2U); // // Copy ISR address into PIE table // EALLOW; HWREG(address) = (uint32_t)handler; EDIS; }
Questions:
1. Should the user copy all these functions? Are there equivalent driverlib APIs for these? If not, can we add them in the driverlib?