Daniel Hellstrom | f2879f5 | 2010-01-21 16:09:37 +0100 | [diff] [blame] | 1 | /* GRLIB GPTIMER (General Purpose Timer) definitions |
| 2 | * |
| 3 | * (C) Copyright 2010, 2015 |
| 4 | * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #ifndef __GRLIB_GPTIMER_H__ |
| 10 | #define __GRLIB_GPTIMER_H__ |
| 11 | |
| 12 | typedef struct { |
| 13 | volatile unsigned int val; |
| 14 | volatile unsigned int rld; |
| 15 | volatile unsigned int ctrl; |
| 16 | volatile unsigned int unused; |
| 17 | } ambapp_dev_gptimer_element; |
| 18 | |
| 19 | #define GPTIMER_CTRL_EN 0x1 /* Timer enable */ |
| 20 | #define GPTIMER_CTRL_RS 0x2 /* Timer reStart */ |
| 21 | #define GPTIMER_CTRL_LD 0x4 /* Timer reLoad */ |
| 22 | #define GPTIMER_CTRL_IE 0x8 /* interrupt enable */ |
| 23 | #define GPTIMER_CTRL_IP 0x10 /* interrupt flag/pending */ |
| 24 | #define GPTIMER_CTRL_CH 0x20 /* Chain with previous timer */ |
| 25 | |
| 26 | typedef struct { |
| 27 | volatile unsigned int scalar; |
| 28 | volatile unsigned int scalar_reload; |
| 29 | volatile unsigned int config; |
| 30 | volatile unsigned int unused; |
| 31 | volatile ambapp_dev_gptimer_element e[8]; |
| 32 | } ambapp_dev_gptimer; |
| 33 | |
| 34 | #endif |