RTEMS
5.0.0
|
Timer controller for the mbed lpc1768 board. More...
#include <stdio.h>
#include <rtems/status-checks.h>
#include <bsp.h>
#include <bsp/irq.h>
#include <bsp/io.h>
#include <bsp/timer.h>
Functions | |
rtems_status_code | lpc176x_timer_reset (const lpc176x_timer_number tnumber) |
resets timer counter and stops it. More... | |
rtems_status_code | lpc176x_timer_set_mode (const lpc176x_timer_number tnumber, const lpc176x_timer_mode mode) |
Sets mode of the timer (timer, counter rising, counter falling or counter both edges) More... | |
rtems_status_code | lpc176x_timer_start (const lpc176x_timer_number tnumber) |
Starts the timer counter. More... | |
rtems_status_code | lpc176x_timer_is_started (const lpc176x_timer_number tnumber, bool *is_started) |
true if timer is started. More... | |
rtems_status_code | lpc176x_timer_set_resolution (const lpc176x_timer_number tnumber, const lpc176x_microseconds resolution) |
sets the resolution in microseconds of the timer More... | |
rtems_status_code | lpc176x_timer_match_config (const lpc176x_timer_number tnumber, const lpc176x_match_port match_port, const lpc176x_match_function function, const uint32_t match_value) |
Configures the timer match. More... | |
rtems_status_code | lpc176x_timer_capture_config (const lpc176x_timer_number tnumber, const lpc176x_capture_port capture_port, const lpc176x_capture_function function) |
Configures the capture ports. More... | |
rtems_status_code | lpc176x_timer_external_match_config (const lpc176x_timer_number number, const lpc176x_match_port match_port, const lpc176x_ext_match_function function) |
Configures the external match ports. More... | |
uint32_t | lpc176x_timer_get_capvalue (const lpc176x_timer_number number, const lpc176x_capture_port capture_port) |
Gets the captured value. More... | |
uint32_t | lpc176x_timer_get_timer_value (const lpc176x_timer_number tnumber) |
Gets the timer value. More... | |
rtems_status_code | lpc176x_timer_set_timer_value (const lpc176x_timer_number tnumber, const uint32_t timer_value) |
Sets the timer value. More... | |
void | lpc176x_timer_isr (void *arg) |
Timer generic isroutine. More... | |
rtems_status_code | lpc176x_timer_init (const lpc176x_timer_number tnumber) |
Initializes timer in timer mode and resets counter but without starting it, and without any capture or match function. More... | |
rtems_status_code | lpc176x_timer_init_with_interrupt (const lpc176x_timer_number tnumber, const lpc176x_isr_funct_vector *const vector) |
Initializes timer in timer mode and resets counter but without starting it, and without any capture or match function. More... | |
Variables | |
const lpc176x_timer | timers [LPC176X_TIMER_COUNT] |
Represents all the timers. More... | |
lpc176x_timer_functions | functions_vector [LPC176X_TIMER_COUNT] |
Represents all the functions according to the timers. More... | |
Timer controller for the mbed lpc1768 board.
|
inline |
Configures the capture ports.
tnumber | the device to be modified |
capture_port | which port of this timer will be setted |
function | At which edge/s will the capture work, and if it will interrupt |
|
inline |
Configures the external match ports.
tnumber | the device to be modified |
match_port | which match for this timer |
function | what should do when match: set, clear toggle or nothing |
|
inline |
Gets the captured value.
tnumber | the device to be modified |
capnumber | which capture port for this timer |
|
inline |
Gets the timer value.
tnumber | the device |
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 or match function.
tnumber | which timer |
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 or match function.
tnumber | which timer to init |
vector | the functions to be used by the isr. |
|
inline |
true if timer is started.
tnumber | the timer number to check. |
is_started | TRUE if the timer is running. |
void lpc176x_timer_isr | ( | void * | lpc176x_timer_number | ) |
Timer generic isroutine.
timernumber | the number of timer. |
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.
tnumber | the device to be modified |
match_port | which port of this timer will be setted |
function | what the timer should do when match: stop timer, clear, and/or interrupt |
match_value | the value that the timer should match. |
|
inline |
resets timer counter and stops it.
tnumber | the device to be reseted |
|
inline |
Sets mode of the timer (timer, counter rising, counter falling or counter both edges)
tnumber | the device to be setted |
mode | the desired mode |
|
inline |
sets the resolution in microseconds of the timer
tnumber | the device to be modified. |
resolution | how many microseconds will mean each timer counter unit. |
|
inline |
Sets the timer value.
tnumber | the timer to modify. |
timer_value | the value to set. |
|
inline |
Starts the timer counter.
tnumber | the device to be started |
lpc176x_timer_functions functions_vector[LPC176X_TIMER_COUNT] |
const lpc176x_timer timers[LPC176X_TIMER_COUNT] |
Represents all the timers.