1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#pragma once 14 15#include <stdint.h> 16#include <stdbool.h> 17 18/* Properties of a single timer device */ 19typedef struct { 20 /* Timers are up counters or down counters. 21 * 22 * Up counters count up from 0, down counters count down from 23 * a set value (set when a timeout is set up). 24 * 25 */ 26 uint32_t upcounter: 1; 27 28 /* True if this timer supports setting timeouts at all */ 29 uint32_t timeouts: 1; 30 31 /* what sort of timeouts does this timer support? */ 32 uint32_t absolute_timeouts: 1; 33 uint32_t relative_timeouts: 1; 34 uint32_t periodic_timeouts: 1; 35 36 /* when does this timer roll over? This will be 0 for down-counters (max valueue 64) */ 37 uint32_t bit_width: 7; 38 39 /* Number of unique irqs this timer issues */ 40 uint32_t irqs; 41} timer_properties_t; 42