Previous version which works for my stm32f401 Nucleo board
Fork of X_NUCLEO_IDB0XA1 by
BlueNRG_HCI/includes/clock.h@70:d20d30f59b1c, 2015-06-08 (annotated)
- Committer:
- Silvio Lucio Oliva
- Date:
- Mon Jun 08 17:08:01 2015 +0200
- Revision:
- 70:d20d30f59b1c
Initial commit for mbed support
Signed-off-by: Silvio Lucio Oliva <silvio.oliva@st.com>
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Silvio Lucio Oliva |
70:d20d30f59b1c | 1 | /******************** (C) COPYRIGHT 2012 STMicroelectronics ******************** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 2 | * File Name : clock.h |
Silvio Lucio Oliva |
70:d20d30f59b1c | 3 | * Author : AMS - HEA&RF BU |
Silvio Lucio Oliva |
70:d20d30f59b1c | 4 | * Version : V1.0.1 |
Silvio Lucio Oliva |
70:d20d30f59b1c | 5 | * Date : 19-July-2012 |
Silvio Lucio Oliva |
70:d20d30f59b1c | 6 | * Description : Header file for clock library, that gives a simple time |
Silvio Lucio Oliva |
70:d20d30f59b1c | 7 | * reference to the BLE Stack. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 8 | ******************************************************************************** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
Silvio Lucio Oliva |
70:d20d30f59b1c | 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
Silvio Lucio Oliva |
70:d20d30f59b1c | 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
Silvio Lucio Oliva |
70:d20d30f59b1c | 13 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
Silvio Lucio Oliva |
70:d20d30f59b1c | 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 15 | *******************************************************************************/ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 16 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 17 | #ifndef __CLOCK_H__ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 18 | #define __CLOCK_H__ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 19 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 20 | #include <hal_types.h> |
Silvio Lucio Oliva |
70:d20d30f59b1c | 21 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 22 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 23 | * Number of clocks in one seconds. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 24 | * This value must be set by each platorm implementation, basing on its needs. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 25 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 26 | extern const uint32_t CLOCK_SECOND; |
Silvio Lucio Oliva |
70:d20d30f59b1c | 27 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 28 | typedef uint32_t tClockTime; |
Silvio Lucio Oliva |
70:d20d30f59b1c | 29 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 30 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 31 | * This function initializes the clock library and should be called before |
Silvio Lucio Oliva |
70:d20d30f59b1c | 32 | * any other Stack functions. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 33 | * |
Silvio Lucio Oliva |
70:d20d30f59b1c | 34 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 35 | void Clock_Init(void); |
Silvio Lucio Oliva |
70:d20d30f59b1c | 36 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 37 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 38 | * This function returns the current system clock time. it is used by |
Silvio Lucio Oliva |
70:d20d30f59b1c | 39 | * the host stack and has to be implemented. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 40 | * |
Silvio Lucio Oliva |
70:d20d30f59b1c | 41 | * @return The current clock time, measured in system ticks. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 42 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 43 | tClockTime Clock_Time(void); |
Silvio Lucio Oliva |
70:d20d30f59b1c | 44 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 45 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 46 | * This function waits for a given number of milliseconds. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 47 | * |
Silvio Lucio Oliva |
70:d20d30f59b1c | 48 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 49 | void Clock_Wait(uint32_t i); |
Silvio Lucio Oliva |
70:d20d30f59b1c | 50 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 51 | /** |
Silvio Lucio Oliva |
70:d20d30f59b1c | 52 | * It suspends system clock. |
Silvio Lucio Oliva |
70:d20d30f59b1c | 53 | * |
Silvio Lucio Oliva |
70:d20d30f59b1c | 54 | */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 55 | void Clock_Suspend(void); |
Silvio Lucio Oliva |
70:d20d30f59b1c | 56 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 57 | |
Silvio Lucio Oliva |
70:d20d30f59b1c | 58 | #endif /* __CLOCK_H__ */ |
Silvio Lucio Oliva |
70:d20d30f59b1c | 59 |