ChibiOS/HAL  6.1.0
hal_st.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 /**
18  * @file hal_st.h
19  * @brief ST Driver macros and structures.
20  * @details This header is designed to be include-able without having to
21  * include other files from the HAL.
22  *
23  * @addtogroup ST
24  * @{
25  */
26 
27 #ifndef HAL_ST_H
28 #define HAL_ST_H
29 
30 /*===========================================================================*/
31 /* Driver constants. */
32 /*===========================================================================*/
33 
34 /*===========================================================================*/
35 /* Driver pre-compile time settings. */
36 /*===========================================================================*/
37 
38 /*===========================================================================*/
39 /* Derived constants and error checks. */
40 /*===========================================================================*/
41 
42 /*===========================================================================*/
43 /* Driver data structures and types. */
44 /*===========================================================================*/
45 
46 #include "hal_st_lld.h"
47 
48 /*===========================================================================*/
49 /* Driver macros. */
50 /*===========================================================================*/
51 
52 /**
53  * @name Macro Functions
54  * @{
55  */
56 /**
57  * @brief Returns the time counter value.
58  * @note This functionality is only available in free running mode, the
59  * behaviour in periodic mode is undefined.
60  *
61  * @return The counter value.
62  *
63  * @api
64  */
65 #define stGetCounter() st_lld_get_counter()
66 
67 /**
68  * @brief Determines if the alarm is active.
69  *
70  * @return The alarm status.
71  * @retval false if the alarm is not active.
72  * @retval true is the alarm is active
73  *
74  * @api
75  */
76 #define stIsAlarmActive() st_lld_is_alarm_active()
77 /** @} */
78 
79 /*===========================================================================*/
80 /* External declarations. */
81 /*===========================================================================*/
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86  void stInit(void);
87  void stStartAlarm(systime_t abstime);
88  void stStopAlarm(void);
89  void stSetAlarm(systime_t abstime);
90  systime_t stGetAlarm(void);
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* HAL_ST_H */
96 
97 /** @} */
systime_t stGetAlarm(void)
Returns the current alarm time.
Definition: hal_st.c:120
void stStartAlarm(systime_t abstime)
Starts the alarm.
Definition: hal_st.c:76
uint32_t systime_t
Type of system time counter.
Definition: osal.h:165
PLATFORM ST subsystem low level driver header.
void stInit(void)
ST Driver initialization.
Definition: hal_st.c:60
void stSetAlarm(systime_t abstime)
Sets the alarm time.
Definition: hal_st.c:104
void stStopAlarm(void)
Stops the alarm interrupt.
Definition: hal_st.c:90