blob: b28f619b1a0b01b5848669c9dbc316e53f35bee9 [file] [log] [blame]
Ryan Harkin32539fc2015-03-17 14:50:05 +00001/*
Roberto Vargas777dd432018-02-12 12:36:17 +00002 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
Ryan Harkin32539fc2015-03-17 14:50:05 +00003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Ryan Harkin32539fc2015-03-17 14:50:05 +00005 */
6
7#ifndef __DELAY_TIMER_H__
8#define __DELAY_TIMER_H__
9
10#include <stdint.h>
11
12/********************************************************************
13 * A simple timer driver providing synchronous delay functionality.
14 * The driver must be initialized with a structure that provides a
15 * function pointer to return the timer value and a clock
16 * multiplier/divider. The ratio of the multiplier and the divider is
Juan Castillofd383b42015-12-01 16:10:15 +000017 * the clock period in microseconds.
Ryan Harkin32539fc2015-03-17 14:50:05 +000018 ********************************************************************/
19
20typedef struct timer_ops {
21 uint32_t (*get_timer_value)(void);
22 uint32_t clk_mult;
23 uint32_t clk_div;
24} timer_ops_t;
25
26void mdelay(uint32_t msec);
27void udelay(uint32_t usec);
Roberto Vargas777dd432018-02-12 12:36:17 +000028void timer_init(const timer_ops_t *ops_ptr);
Ryan Harkin32539fc2015-03-17 14:50:05 +000029
30
31#endif /* __DELAY_TIMER_H__ */