RTEMS: bsps/arm/lpc176x/include/bsp/timer.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
timer.h
Go to the documentation of this file.
1
9/*
10 * Copyright (c) 2014 Taller Technologies.
11 *
12 * @author Boretto Martin (martin.boretto@tallertechnologies.com)
13 * @author Diaz Marcos (marcos.diaz@tallertechnologies.com)
14 * @author Lenarduzzi Federico (federico.lenarduzzi@tallertechnologies.com)
15 * @author Daniel Chicco (daniel.chicco@tallertechnologies.com)
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.org/license/LICENSE.
20 */
21
22#ifndef LIBBSP_ARM_LPC176X_TIMER_H
23#define LIBBSP_ARM_LPC176X_TIMER_H
24
25#include <bsp/timer-defs.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif /* __cplusplus */
30
37 rtems_status_code lpc176x_timer_reset( lpc176x_timer_number tnumber );
38
47 rtems_status_code lpc176x_timer_set_mode(
48 lpc176x_timer_number tnumber,
49 lpc176x_timer_mode mode
50);
51
58 rtems_status_code lpc176x_timer_start( lpc176x_timer_number tnumber );
59
67 rtems_status_code lpc176x_timer_is_started(
68 lpc176x_timer_number tnumber,
69 bool *is_started
70);
71
80 rtems_status_code lpc176x_timer_set_resolution(
81 lpc176x_timer_number tnumber,
82 lpc176x_microseconds resolution
83);
84
95 rtems_status_code lpc176x_timer_match_config(
96 lpc176x_timer_number tnumber,
97 lpc176x_match_port match_port,
98 lpc176x_match_function function,
99 uint32_t match_value
100);
101
110 rtems_status_code lpc176x_timer_capture_config(
111 lpc176x_timer_number tnumber,
112 lpc176x_capture_port capture_port,
113 lpc176x_capture_function function
114);
115
123 rtems_status_code lpc176x_timer_external_match_config(
124 lpc176x_timer_number tnumber,
125 lpc176x_match_port match_port,
126 lpc176x_ext_match_function function
127);
128
136uint32_t lpc176x_timer_get_capvalue(
137 lpc176x_timer_number tnumber,
138 lpc176x_capture_port capnumber
139);
140
147uint32_t lpc176x_timer_get_timer_value( lpc176x_timer_number tnumber );
148
155 rtems_status_code lpc176x_timer_set_timer_value(
156 lpc176x_timer_number tnumber,
157 uint32_t lpc176x_timer_value
158);
159
165void lpc176x_timer_isr( void *lpc176x_timer_number );
166
175 rtems_status_code lpc176x_timer_init( lpc176x_timer_number tnumber );
176
186 rtems_status_code lpc176x_timer_init_with_interrupt(
187 lpc176x_timer_number tnumber,
188 const lpc176x_isr_funct_vector *vector
189);
190
191#ifdef __cplusplus
192}
193#endif /* __cplusplus */
194
195#endif /* LIBBSP_ARM_LPC176X_TIMER_H */
lpc176x_timer_match_config
rtems_status_code lpc176x_timer_match_config(lpc176x_timer_number tnumber, lpc176x_match_port match_port, lpc176x_match_function function, uint32_t match_value)
Configures the timer match.
Definition: timer.c:225
lpc176x_timer_set_mode
rtems_status_code lpc176x_timer_set_mode(lpc176x_timer_number tnumber, lpc176x_timer_mode mode)
Sets mode of the timer (timer, counter rising, counter falling or counter both edges)
Definition: timer.c:152
lpc176x_timer_start
rtems_status_code lpc176x_timer_start(lpc176x_timer_number tnumber)
Starts the timer counter.
Definition: timer.c:170
lpc176x_timer_isr
void lpc176x_timer_isr(void *lpc176x_timer_number)
Timer generic isroutine.
Definition: timer.c:335
lpc176x_timer_is_started
rtems_status_code lpc176x_timer_is_started(lpc176x_timer_number tnumber, bool *is_started)
true if timer is started.
Definition: timer.c:186
lpc176x_timer_capture_config
rtems_status_code lpc176x_timer_capture_config(lpc176x_timer_number tnumber, lpc176x_capture_port capture_port, lpc176x_capture_function function)
Configures the capture ports.
Definition: timer.c:250
lpc176x_timer_get_timer_value
uint32_t lpc176x_timer_get_timer_value(lpc176x_timer_number tnumber)
Gets the timer value.
Definition: timer.c:309
lpc176x_timer_set_resolution
rtems_status_code lpc176x_timer_set_resolution(lpc176x_timer_number tnumber, lpc176x_microseconds resolution)
sets the resolution in microseconds of the timer
Definition: timer.c:205
lpc176x_timer_set_timer_value
rtems_status_code lpc176x_timer_set_timer_value(lpc176x_timer_number tnumber, uint32_t lpc176x_timer_value)
Sets the timer value.
Definition: timer.c:317
lpc176x_timer_get_capvalue
uint32_t lpc176x_timer_get_capvalue(lpc176x_timer_number tnumber, lpc176x_capture_port capnumber)
Gets the captured value.
Definition: timer.c:298
lpc176x_timer_external_match_config
rtems_status_code lpc176x_timer_external_match_config(lpc176x_timer_number tnumber, lpc176x_match_port match_port, lpc176x_ext_match_function function)
Configures the external match ports.
Definition: timer.c:274
lpc176x_timer_init_with_interrupt
rtems_status_code lpc176x_timer_init_with_interrupt(lpc176x_timer_number tnumber, const lpc176x_isr_funct_vector *vector)
Initializes timer in timer mode and resets counter but without starting it, and without any capture o...
Definition: timer.c:383
lpc176x_timer_reset
rtems_status_code lpc176x_timer_reset(lpc176x_timer_number tnumber)
resets timer counter and stops it.
Definition: timer.c:136
lpc176x_timer_init
rtems_status_code lpc176x_timer_init(lpc176x_timer_number tnumber)
Initializes timer in timer mode and resets counter but without starting it, and without any capture o...
Definition: timer.c:357
lpc176x_microseconds
uint32_t lpc176x_microseconds
Microseconds representation.
Definition: common-types.h:37
rtems_status_code
rtems_status_code
Classic API Status.
Definition: status.h:43
timer-defs.h
API definitions of the for the timer of the lpc176x bsp.
lpc176x_ext_match_function
lpc176x_ext_match_function
The possible functions at match, for the external ports.
Definition: timer-defs.h:391
lpc176x_timer_number
lpc176x_timer_number
The timer devices in the board.
Definition: timer-defs.h:333
lpc176x_isr_funct_vector
lpc176x_isr_funct const lpc176x_isr_funct_vector[LPC176X_ISR_FUNCTIONS_COUNT]
The vector of functions that attends each possible interrupt source for a timer.
Definition: timer-defs.h:411
lpc176x_match_port
lpc176x_match_port
Match ports of a timer.
Definition: timer-defs.h:305
lpc176x_match_function
lpc176x_match_function
The possible functions at match. This options could be used together.
Definition: timer-defs.h:364
lpc176x_capture_function
lpc176x_capture_function
The possible functions at capture. This options could be used together.
Definition: timer-defs.h:378
lpc176x_timer_mode
lpc176x_timer_mode
Timer modes of a timer.
Definition: timer-defs.h:318
lpc176x_capture_port
lpc176x_capture_port
Capture ports of a timer.
Definition: timer-defs.h:294