blob: 9d4aa5c1bc4c9ad7dc5f66cc5b6bfb73f55a4734 [file] [log] [blame]
Kévin Redon69b92d92019-01-24 16:39:20 +01001/**
2 * \file
3 *
4 * \brief HAL delay related functionality declaration.
5 *
6 * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
7 *
8 * \asf_license_start
9 *
10 * \page License
11 *
12 * Subject to your compliance with these terms, you may use Microchip
13 * software and any derivatives exclusively with Microchip products.
14 * It is your responsibility to comply with third party license terms applicable
15 * to your use of third party software (including open source software) that
16 * may accompany Microchip software.
17 *
18 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 *
30 * \asf_license_stop
31 *
32 */
33
34#include <hpl_irq.h>
35#include <hpl_reset.h>
36#include <hpl_sleep.h>
37
38#ifndef _HAL_DELAY_H_INCLUDED
39#define _HAL_DELAY_H_INCLUDED
40
41#include <compiler.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/**
48 * \addtogroup doc_driver_hal_delay Delay Driver
49 *
50 *@{
51 */
52
53/**
54 * \brief Initialize Delay driver
55 *
56 * \param[in] hw The pointer to hardware instance
57 */
58void delay_init(void *const hw);
59
60/**
61 * \brief Perform delay in us
62 *
63 * This function performs delay for the given amount of microseconds.
64 *
65 * \param[in] us The amount delay in us
66 */
67void delay_us(const uint16_t us);
68
69/**
70 * \brief Perform delay in ms
71 *
72 * This function performs delay for the given amount of milliseconds.
73 *
74 * \param[in] ms The amount delay in ms
75 */
76void delay_ms(const uint16_t ms);
77
78/**
79 * \brief Retrieve the current driver version
80 *
81 * \return Current driver version.
82 */
83uint32_t delay_get_version(void);
84
85/**@}*/
86#ifdef __cplusplus
87}
88#endif
89#endif /* _HAL_DELAY_H_INCLUDED */