OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [drivers/] [src/] [include/] [counter.h] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 jlechner
/**
2
 * \brief Driver for simple counter module.
3
 * \author Jakob Lechner
4
 */
5
 
6
#ifndef __counter_h__
7
#define __counter_h__
8
 
9
#include "drivers.h"
10
 
11
#define COUNTER_CONFIG_C_BOFF      3
12
#define COUNTER_PRESCALER_BOFF     4
13
#define COUNTER_COUNT_BIT          0
14
#define COUNTER_CLEAR_BIT          1
15
#define COUNTER_VALUE_BOFF         8
16
/**
17
 * \brief Initilizes a new handle for a memory mapped module.
18
 * \param h The handle which is initialized.
19
 * \param baseAddress The base addresse where the module is mapped.
20
 */
21
void counter_initHandle(module_handle_t *h, scarts_addr_t baseAddress);
22
 
23
/**
24
 * \brief Free dynamically allocated resources.
25
 * \param h Handle.
26
 */
27
void counter_releaseHandle(module_handle_t *h);
28
 
29
/**
30
 * \brief Set prescaler.
31
 * \param h Handle.
32
 * \param prescaler Counter increments every "prescaler+1" clock ticks.
33
 */
34
void counter_setPrescaler(module_handle_t *h, uint8_t prescaler);
35
 
36
/**
37
 * \brief Start counter.
38
 * \param h Handle.
39
 */
40
void counter_start(module_handle_t *h);
41
 
42
/**
43
 * \brief Stop counter.
44
 * \param h Handle.
45
 */
46
void counter_stop(module_handle_t *h);
47
 
48
/**
49
 * \brief Resume stopped counter.
50
 * \param h Handle.
51
 */
52
void counter_resume(module_handle_t *h);
53
 
54
/**
55
 * \brief Reset counter value to zero.
56
 * \param h Handle.
57
 */
58
void counter_reset(module_handle_t *h);
59
 
60
/**
61
 * \brief Get current counter value.
62
 * \param h Handle.
63
 */
64
uint32_t counter_getValue(module_handle_t *h);
65
 
66
#endif // __counter_h__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.