Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of X_NUCLEO_IDB0XA1 by
x-nucleo-idb0xa1/BlueNRG_HCI/includes/clock.h@131:e09947216ccb, 2015-10-06 (annotated)
- Committer:
- Wolfgang Betz
- Date:
- Tue Oct 06 15:19:19 2015 +0200
- Revision:
- 131:e09947216ccb
- Parent:
- 130:770ce14d3d15
Get a first compilation thru
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Wolfgang Betz |
130:770ce14d3d15 | 1 | /******************** (C) COPYRIGHT 2012 STMicroelectronics ******************** |
| Wolfgang Betz |
130:770ce14d3d15 | 2 | * File Name : clock.h |
| Wolfgang Betz |
130:770ce14d3d15 | 3 | * Author : AMS - HEA&RF BU |
| Wolfgang Betz |
130:770ce14d3d15 | 4 | * Version : V1.0.1 |
| Wolfgang Betz |
130:770ce14d3d15 | 5 | * Date : 19-July-2012 |
| Wolfgang Betz |
130:770ce14d3d15 | 6 | * Description : Header file for clock library, that gives a simple time |
| Wolfgang Betz |
130:770ce14d3d15 | 7 | * reference to the BLE Stack. |
| Wolfgang Betz |
130:770ce14d3d15 | 8 | ******************************************************************************** |
| Wolfgang Betz |
130:770ce14d3d15 | 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
| Wolfgang Betz |
130:770ce14d3d15 | 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
| Wolfgang Betz |
130:770ce14d3d15 | 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
| Wolfgang Betz |
130:770ce14d3d15 | 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
| Wolfgang Betz |
130:770ce14d3d15 | 13 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
| Wolfgang Betz |
130:770ce14d3d15 | 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
| Wolfgang Betz |
130:770ce14d3d15 | 15 | *******************************************************************************/ |
| Wolfgang Betz |
130:770ce14d3d15 | 16 | |
| Wolfgang Betz |
130:770ce14d3d15 | 17 | #ifndef __CLOCK_H__ |
| Wolfgang Betz |
130:770ce14d3d15 | 18 | #define __CLOCK_H__ |
| Wolfgang Betz |
130:770ce14d3d15 | 19 | |
| Wolfgang Betz |
130:770ce14d3d15 | 20 | #include <hal_types.h> |
| Wolfgang Betz |
130:770ce14d3d15 | 21 | |
| Wolfgang Betz |
130:770ce14d3d15 | 22 | /** |
| Wolfgang Betz |
130:770ce14d3d15 | 23 | * Number of clocks in one seconds. |
| Wolfgang Betz |
130:770ce14d3d15 | 24 | * This value must be set by each platorm implementation, basing on its needs. |
| Wolfgang Betz |
130:770ce14d3d15 | 25 | */ |
| Wolfgang Betz |
130:770ce14d3d15 | 26 | extern const uint32_t CLOCK_SECOND; |
| Wolfgang Betz |
130:770ce14d3d15 | 27 | |
| Wolfgang Betz |
130:770ce14d3d15 | 28 | typedef uint32_t tClockTime; |
| Wolfgang Betz |
130:770ce14d3d15 | 29 | |
| Wolfgang Betz |
130:770ce14d3d15 | 30 | /** |
| Wolfgang Betz |
130:770ce14d3d15 | 31 | * This function initializes the clock library and should be called before |
| Wolfgang Betz |
130:770ce14d3d15 | 32 | * any other Stack functions. |
| Wolfgang Betz |
130:770ce14d3d15 | 33 | * |
| Wolfgang Betz |
130:770ce14d3d15 | 34 | */ |
| Wolfgang Betz |
130:770ce14d3d15 | 35 | void Clock_Init(void); |
| Wolfgang Betz |
130:770ce14d3d15 | 36 | |
| Wolfgang Betz |
130:770ce14d3d15 | 37 | /** |
| Wolfgang Betz |
130:770ce14d3d15 | 38 | * This function returns the current system clock time. it is used by |
| Wolfgang Betz |
130:770ce14d3d15 | 39 | * the host stack and has to be implemented. |
| Wolfgang Betz |
130:770ce14d3d15 | 40 | * |
| Wolfgang Betz |
130:770ce14d3d15 | 41 | * @return The current clock time, measured in system ticks. |
| Wolfgang Betz |
130:770ce14d3d15 | 42 | */ |
| Wolfgang Betz |
130:770ce14d3d15 | 43 | tClockTime Clock_Time(void); |
| Wolfgang Betz |
130:770ce14d3d15 | 44 | |
| Wolfgang Betz |
130:770ce14d3d15 | 45 | /** |
| Wolfgang Betz |
130:770ce14d3d15 | 46 | * This function waits for a given number of milliseconds. |
| Wolfgang Betz |
130:770ce14d3d15 | 47 | * |
| Wolfgang Betz |
130:770ce14d3d15 | 48 | */ |
| Wolfgang Betz |
130:770ce14d3d15 | 49 | void Clock_Wait(uint32_t i); |
| Wolfgang Betz |
130:770ce14d3d15 | 50 | |
| Wolfgang Betz |
130:770ce14d3d15 | 51 | /** |
| Wolfgang Betz |
130:770ce14d3d15 | 52 | * It suspends system clock. |
| Wolfgang Betz |
130:770ce14d3d15 | 53 | * |
| Wolfgang Betz |
130:770ce14d3d15 | 54 | */ |
| Wolfgang Betz |
130:770ce14d3d15 | 55 | void Clock_Suspend(void); |
| Wolfgang Betz |
130:770ce14d3d15 | 56 | |
| Wolfgang Betz |
130:770ce14d3d15 | 57 | |
| Wolfgang Betz |
130:770ce14d3d15 | 58 | #endif /* __CLOCK_H__ */ |
| Wolfgang Betz |
130:770ce14d3d15 | 59 |
