1 /* 2 * Copyright (c) 2016, Freescale Semiconductor, Inc. 3 * Copyright 2016-2017 NXP 4 * All rights reserved. 5 * 6 * SPDX-License-Identifier: BSD-3-Clause 7 */ 8 9 #include "fsl_src.h" 10 11 /* Component ID definition, used by tools. */ 12 #ifndef FSL_COMPONENT_ID 13 #define FSL_COMPONENT_ID "platform.drivers.src" 14 #endif 15 16 /******************************************************************************* 17 * Prototypes 18 ******************************************************************************/ 19 20 /******************************************************************************* 21 * Variables 22 ******************************************************************************/ 23 24 /******************************************************************************* 25 * Code 26 ******************************************************************************/ 27 28 /*! 29 * brief Clear the status flags of SRC. 30 * 31 * param base SRC peripheral base address. 32 * param Mask value of status flags to be cleared, see to #_src_reset_status_flags. 33 */ SRC_ClearResetStatusFlags(SRC_Type * base,uint32_t flags)34void SRC_ClearResetStatusFlags(SRC_Type *base, uint32_t flags) 35 { 36 uint32_t tmp32 = base->SRSR; 37 38 if (0U != (SRC_SRSR_TSR_MASK & flags)) 39 { 40 tmp32 &= ~SRC_SRSR_TSR_MASK; /* Write 0 to clear. */ 41 } 42 43 if (0U != (SRC_SRSR_W1C_BITS_MASK & flags)) 44 { 45 tmp32 |= (SRC_SRSR_W1C_BITS_MASK & flags); /* Write 1 to clear. */ 46 } 47 48 base->SRSR = tmp32; 49 } 50