]> begriffs open source - cmsis/blob - CMSIS/CoreValidation/Source/CV_GenTimer.c
Core: Fixed core instruction prototypes of __REV and __REV16.
[cmsis] / CMSIS / CoreValidation / Source / CV_GenTimer.c
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
8 #include "CV_Framework.h"
9 #include "cmsis_cv.h"
10
11 /*-----------------------------------------------------------------------------
12  *      Test implementation
13  *----------------------------------------------------------------------------*/
14
15 /*-----------------------------------------------------------------------------
16  *      Test cases
17  *----------------------------------------------------------------------------*/
18
19  
20 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
21 void TC_GenTimer_CNTFRQ(void) {
22   uint32_t cntfrq = __get_CNTFRQ();
23   __set_CNTFRQ(cntfrq);
24
25   ASSERT_TRUE(cntfrq == __get_CNTFRQ());
26 }
27
28 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
29 void TC_GenTimer_CNTP_TVAL(void) {
30   uint32_t cntp_tval = __get_CNTP_TVAL();
31   __set_CNTP_TVAL(cntp_tval);
32
33   ASSERT_TRUE(cntp_tval >= __get_CNTP_TVAL());
34 }
35
36 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
37 void TC_GenTimer_CNTP_CTL(void) {
38   uint32_t cntp_ctl = __get_CNTP_CTL();
39   __set_CNTP_CTL(cntp_ctl);
40
41   ASSERT_TRUE(cntp_ctl == __get_CNTP_CTL());
42 }