2015-03-17 14:50:05 +00:00
|
|
|
/*
|
2018-02-12 12:36:17 +00:00
|
|
|
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
|
2015-03-17 14:50:05 +00:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2015-03-17 14:50:05 +00:00
|
|
|
*/
|
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#ifndef DELAY_TIMER_H
|
|
|
|
#define DELAY_TIMER_H
|
2015-03-17 14:50:05 +00:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* A simple timer driver providing synchronous delay functionality.
|
|
|
|
* The driver must be initialized with a structure that provides a
|
|
|
|
* function pointer to return the timer value and a clock
|
|
|
|
* multiplier/divider. The ratio of the multiplier and the divider is
|
2015-12-01 16:10:15 +00:00
|
|
|
* the clock period in microseconds.
|
2015-03-17 14:50:05 +00:00
|
|
|
********************************************************************/
|
|
|
|
|
|
|
|
typedef struct timer_ops {
|
|
|
|
uint32_t (*get_timer_value)(void);
|
|
|
|
uint32_t clk_mult;
|
|
|
|
uint32_t clk_div;
|
|
|
|
} timer_ops_t;
|
|
|
|
|
|
|
|
void mdelay(uint32_t msec);
|
|
|
|
void udelay(uint32_t usec);
|
2018-02-12 12:36:17 +00:00
|
|
|
void timer_init(const timer_ops_t *ops_ptr);
|
2015-03-17 14:50:05 +00:00
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#endif /* DELAY_TIMER_H */
|