fsl_src.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #include "fsl_src.h"
  9. /* Component ID definition, used by tools. */
  10. #ifndef FSL_COMPONENT_ID
  11. #define FSL_COMPONENT_ID "platform.drivers.src"
  12. #endif
  13. /*******************************************************************************
  14. * Prototypes
  15. ******************************************************************************/
  16. /*******************************************************************************
  17. * Variables
  18. ******************************************************************************/
  19. /*******************************************************************************
  20. * Code
  21. ******************************************************************************/
  22. /*!
  23. * brief Clear the status flags of SRC.
  24. *
  25. * param base SRC peripheral base address.
  26. * param Mask value of status flags to be cleared, see to #_src_reset_status_flags.
  27. */
  28. void SRC_ClearResetStatusFlags(SRC_Type *base, uint32_t flags)
  29. {
  30. uint32_t tmp32 = base->SRSR;
  31. if (0U != (SRC_SRSR_TSR_MASK & flags))
  32. {
  33. tmp32 &= ~SRC_SRSR_TSR_MASK; /* Write 0 to clear. */
  34. }
  35. if (0U != (SRC_SRSR_W1C_BITS_MASK & flags))
  36. {
  37. tmp32 |= (SRC_SRSR_W1C_BITS_MASK & flags); /* Write 1 to clear. */
  38. }
  39. base->SRSR = tmp32;
  40. }