CV_GenTimer.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*-----------------------------------------------------------------------------
  2. * Name: CV_GenTimer.c
  3. * Purpose: CMSIS CORE validation tests implementation
  4. *-----------------------------------------------------------------------------
  5. * Copyright (c) 2017 ARM Limited. All rights reserved.
  6. *----------------------------------------------------------------------------*/
  7. #include "CV_Framework.h"
  8. #include "cmsis_cv.h"
  9. /*-----------------------------------------------------------------------------
  10. * Test implementation
  11. *----------------------------------------------------------------------------*/
  12. /*-----------------------------------------------------------------------------
  13. * Test cases
  14. *----------------------------------------------------------------------------*/
  15. /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
  16. void TC_GenTimer_CNTFRQ(void) {
  17. uint32_t cntfrq = __get_CNTFRQ();
  18. __set_CNTFRQ(cntfrq);
  19. ASSERT_TRUE(cntfrq == __get_CNTFRQ());
  20. }
  21. /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
  22. void TC_GenTimer_CNTP_TVAL(void) {
  23. uint32_t cntp_tval = __get_CNTP_TVAL();
  24. __set_CNTP_TVAL(cntp_tval);
  25. ASSERT_TRUE(cntp_tval >= __get_CNTP_TVAL());
  26. }
  27. /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
  28. void TC_GenTimer_CNTP_CTL(void) {
  29. uint32_t cntp_ctl = __get_CNTP_CTL();
  30. __set_CNTP_CTL(cntp_ctl);
  31. ASSERT_TRUE(cntp_ctl == __get_CNTP_CTL());
  32. }