Lines Matching refs:Base

187 static inline boolean Swt_Ip_IsEnable(const Swt_Ip_Type * const Base)  in Swt_Ip_IsEnable()  argument
190 return ((Base->CR & SWT_CR_WEN_MASK) != 0U); in Swt_Ip_IsEnable()
193 static inline void Swt_Ip_Enable(Swt_Ip_Type * const Base) in Swt_Ip_Enable() argument
196 Base->CR |= SWT_CR_WEN_MASK; in Swt_Ip_Enable()
199 static inline void Swt_Ip_Disable(Swt_Ip_Type * const Base) in Swt_Ip_Disable() argument
202 Base->CR &= ~SWT_CR_WEN_MASK; in Swt_Ip_Disable()
205 static Swt_Ip_ServiceModeType Swt_Ip_GetServiceMode(const Swt_Ip_Type * const Base) in Swt_Ip_GetServiceMode() argument
210 switch ((Base->CR & SWT_CR_SMD_MASK) >> SWT_CR_SMD_SHIFT) in Swt_Ip_GetServiceMode()
229 static Swt_Ip_LockType Swt_Ip_GetLock(const Swt_Ip_Type * const Base) in Swt_Ip_GetLock() argument
234 switch ((Base->CR & (SWT_CR_SLK_MASK | SWT_CR_HLK_MASK)) >> SWT_CR_SLK_SHIFT) in Swt_Ip_GetLock()
253 static void Swt_Ip_Lock(Swt_Ip_Type * const Base, in Swt_Ip_Lock() argument
261 Base->CR |= SWT_CR_HLK(1U); in Swt_Ip_Lock()
265 Base->CR |= SWT_CR_SLK(1U); in Swt_Ip_Lock()
274 static Swt_Ip_StatusType Swt_Ip_Unlock(Swt_Ip_Type * const Base) in Swt_Ip_Unlock() argument
283 if ((Base->CR & SWT_CR_HLK_MASK) != 0U) in Swt_Ip_Unlock()
290 if ((Base->CR & SWT_CR_SLK_MASK) != 0U) in Swt_Ip_Unlock()
293 Base->SR = SWT_SR_WSC(SWT_IP_UNLOCK_VALUE1_U16); in Swt_Ip_Unlock()
294 Base->SR = SWT_SR_WSC(SWT_IP_UNLOCK_VALUE2_U16); in Swt_Ip_Unlock()
299 while (((Base->CR & SWT_CR_SLK_MASK) != 0U) && (ElapsedTicks < TimeoutTicks)) in Swt_Ip_Unlock()
307 Swt_Ip_Lock(Base, SWT_IP_SOFTLOCK); in Swt_Ip_Unlock()
322 static void Swt_Ip_RegisterConfig(Swt_Ip_Type * const Base, in Swt_Ip_RegisterConfig() argument
340 Base->CR = TempCr; in Swt_Ip_RegisterConfig()
344 Base->IR = SWT_IR_TIF_MASK; in Swt_Ip_RegisterConfig()
347 Base->TO = ConfigPtr->u32TimeoutValue; in Swt_Ip_RegisterConfig()
352 Base->WN = ConfigPtr->u32WindowValue; in Swt_Ip_RegisterConfig()
357 Base->SK = SWT_SK_SK(ConfigPtr->u16InitialKey); in Swt_Ip_RegisterConfig()
379 static inline void Swt_Ip_ServiceCmd(Swt_Ip_Type * const Base, in Swt_Ip_ServiceCmd() argument
383 Base->SR = (Base->SR & ~SWT_SR_WSC_MASK) | SWT_SR_WSC(ServiceKey); in Swt_Ip_ServiceCmd()
386 static inline uint16 Swt_Ip_ServiceKeyGen(const Swt_Ip_Type * const Base) in Swt_Ip_ServiceKeyGen() argument
389 return ((uint16)((((Base->SK & SWT_SK_SK_MASK) >> SWT_SK_SK_SHIFT) * 17U) + 3U)); in Swt_Ip_ServiceKeyGen()
394 static inline boolean Swt_Ip_RequestedReset(const Swt_Ip_Type * const Base) in Swt_Ip_RequestedReset() argument
397 return (((Base->RRR & SWT_RRR_RRF_MASK)>> SWT_RRR_RRF_SHIFT) == 1U); in Swt_Ip_RequestedReset()
404 static inline void Swt_Ip_ClearRequest(Swt_Ip_Type * const Base) in Swt_Ip_ClearRequest() argument
407 Base->RRR = SWT_RRR_RRF(1U); in Swt_Ip_ClearRequest()
412 static inline boolean Swt_Ip_GetIntFlag(const Swt_Ip_Type * const Base) in Swt_Ip_GetIntFlag() argument
415 return ((Base->IR & SWT_IR_TIF_MASK) != 0U); in Swt_Ip_GetIntFlag()
418 static inline boolean Swt_Ip_IsIntEnabled(const Swt_Ip_Type * const Base) in Swt_Ip_IsIntEnabled() argument
421 return ((Base->CR & SWT_CR_ITR_MASK ) != 0U); in Swt_Ip_IsIntEnabled()
424 static inline void Swt_Ip_ClearIntFlag(Swt_Ip_Type * const Base) in Swt_Ip_ClearIntFlag() argument
427 Base->IR &= SWT_IR_TIF_MASK; in Swt_Ip_ClearIntFlag()
447 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_Init() local
455 if (Swt_Ip_Unlock(Base) == SWT_IP_STATUS_ERROR) in Swt_Ip_Init()
461 boolean bSwtEnabled = Swt_Ip_IsEnable(Base); in Swt_Ip_Init()
465 Swt_Ip_Disable(Base); in Swt_Ip_Init()
474 Swt_Ip_RegisterConfig(Base, ConfigPtr); in Swt_Ip_Init()
483 Swt_Ip_Enable(Base); in Swt_Ip_Init()
486 Swt_Ip_Lock(Base, ConfigPtr->lockConfig); in Swt_Ip_Init()
504 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_Deinit() local
512 Ret = Swt_Ip_Unlock(Base); in Swt_Ip_Deinit()
517 Swt_Ip_Disable(Base); in Swt_Ip_Deinit()
520 Base->IR = SWT_IR_TIF_MASK; in Swt_Ip_Deinit()
523 Base->TO = SWT_IP_TO_RESET_VALUE_U32(Instance); in Swt_Ip_Deinit()
525 Base->TO = SWT_IP_TO_RESET_VALUE_U32; in Swt_Ip_Deinit()
528 Base->WN = SWT_IP_WN_RESET_VALUE_U32; in Swt_Ip_Deinit()
530 Base->SK = SWT_IP_SK_RESET_VALUE_U16; in Swt_Ip_Deinit()
533Base->CR = (SWT_IP_CR_RESET_VALUE_U32(Instance)) & (~SWT_CR_WEN_MASK); /* make sure the SWT is dis… in Swt_Ip_Deinit()
535Base->CR = SWT_IP_CR_RESET_VALUE_U32 & (~SWT_CR_WEN_MASK); /* make sure the SWT is disabled after … in Swt_Ip_Deinit()
541 Swt_Ip_ClearRequest(Base); in Swt_Ip_Deinit()
559 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_Service() local
568 Swt_Ip_ServiceModeType ServiceMode = Swt_Ip_GetServiceMode(Base); in Swt_Ip_Service()
574 if (Swt_Ip_ServiceKeyGen(Base) == SWT_IP_UNLOCK_VALUE1_U16) in Swt_Ip_Service()
579 Swt_Ip_ServiceCmd(Base, Swt_Ip_ServiceKeyGen(Base)); in Swt_Ip_Service()
581 if (Swt_Ip_ServiceKeyGen(Base) == SWT_IP_UNLOCK_VALUE1_U16) in Swt_Ip_Service()
586 Swt_Ip_ServiceCmd(Base, Swt_Ip_ServiceKeyGen(Base)); in Swt_Ip_Service()
588 if ((SWT_IP_SOFTLOCK == Swt_Ip_GetLock(Base)) && (TRUE == BUnlockSequence)) in Swt_Ip_Service()
591 Swt_Ip_ServiceCmd(Base, SWT_IP_UNLOCK_VALUE2_U16); in Swt_Ip_Service()
592 Swt_Ip_Lock(Base, SWT_IP_SOFTLOCK); in Swt_Ip_Service()
597 Swt_Ip_ServiceCmd(Base, SWT_IP_FIXED_SERVICE_VALUE1_U16); in Swt_Ip_Service()
598 Swt_Ip_ServiceCmd(Base, SWT_IP_FIXED_SERVICE_VALUE2_U16); in Swt_Ip_Service()
617 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_Config() local
629 if (SWT_IP_STATUS_ERROR == Swt_Ip_Unlock(Base)) in Swt_Ip_Config()
635 boolean bSwtEnabled = Swt_Ip_IsEnable(Base); in Swt_Ip_Config()
639 Swt_Ip_Disable(Base); in Swt_Ip_Config()
643 Swt_Ip_RegisterConfig(Base, ConfigPtr); in Swt_Ip_Config()
648 Swt_Ip_Enable(Base); in Swt_Ip_Config()
651 Swt_Ip_Lock(Base, ConfigPtr->lockConfig); in Swt_Ip_Config()
666 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_SetTimeout() local
674 LockConfig = Swt_Ip_GetLock(Base); in Swt_Ip_SetTimeout()
679 if (SWT_IP_STATUS_ERROR == Swt_Ip_Unlock(Base)) in Swt_Ip_SetTimeout()
686 Swt_Ip_Disable(Base); in Swt_Ip_SetTimeout()
689 Base->TO = TimeoutValue; in Swt_Ip_SetTimeout()
694 Base->WN = WindowValue; in Swt_Ip_SetTimeout()
696 Base->CR |= SWT_CR_WND_MASK; in Swt_Ip_SetTimeout()
700 Base->CR &= ~SWT_CR_WND_MASK; in Swt_Ip_SetTimeout()
704 Swt_Ip_Enable(Base); in Swt_Ip_SetTimeout()
707 Swt_Ip_Lock(Base, LockConfig); in Swt_Ip_SetTimeout()
721 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_StartTimer() local
729 LockConfig = Swt_Ip_GetLock(Base); in Swt_Ip_StartTimer()
732 Ret = Swt_Ip_Unlock(Base); in Swt_Ip_StartTimer()
737 Swt_Ip_Enable(Base); in Swt_Ip_StartTimer()
739 Swt_Ip_Lock(Base, LockConfig); in Swt_Ip_StartTimer()
753 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_StopTimer() local
761 LockConfig = Swt_Ip_GetLock(Base); in Swt_Ip_StopTimer()
764 Ret = Swt_Ip_Unlock(Base); in Swt_Ip_StopTimer()
769 Swt_Ip_Disable(Base); in Swt_Ip_StopTimer()
771 Swt_Ip_Lock(Base, LockConfig); in Swt_Ip_StopTimer()
791 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_ClearResetRequest() local
805 if (Swt_Ip_RequestedReset(Base)) in Swt_Ip_ClearResetRequest()
807 Swt_Ip_ClearRequest(Base); in Swt_Ip_ClearResetRequest()
812 while ((Swt_Ip_RequestedReset(Base)) && (ElapsedTicks < TimeoutTicks)) in Swt_Ip_ClearResetRequest()
817 if ((ElapsedTicks >= TimeoutTicks) && (Swt_Ip_RequestedReset(Base))) in Swt_Ip_ClearResetRequest()
841 Swt_Ip_Type * const Base = Swt_Ip_sBase[Instance]; in Swt_Ip_IrqHandler() local
848 if (Swt_Ip_GetIntFlag(Base) && Swt_Ip_IsIntEnabled(Base)) in Swt_Ip_IrqHandler()
850 Swt_Ip_ClearIntFlag(Base); in Swt_Ip_IrqHandler()
860 Swt_Ip_ClearIntFlag(Base); in Swt_Ip_IrqHandler()