RTEMS  5.0.0
Functions
timer.h File Reference

Timer API for the lpc176x bsp. More...

#include <bsp/timer-defs.h>

Go to the source code of this file.

Functions

rtems_status_code lpc176x_timer_reset (lpc176x_timer_number tnumber)
 resets timer counter and stops it. More...
 
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) More...
 
rtems_status_code lpc176x_timer_start (lpc176x_timer_number tnumber)
 Starts the timer counter. More...
 
rtems_status_code lpc176x_timer_is_started (lpc176x_timer_number tnumber, bool *is_started)
 true if timer is started. More...
 
rtems_status_code lpc176x_timer_set_resolution (lpc176x_timer_number tnumber, lpc176x_microseconds resolution)
 sets the resolution in microseconds of the timer More...
 
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. More...
 
rtems_status_code lpc176x_timer_capture_config (lpc176x_timer_number tnumber, lpc176x_capture_port capture_port, lpc176x_capture_function function)
 Configures the capture ports. More...
 
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. More...
 
uint32_t lpc176x_timer_get_capvalue (lpc176x_timer_number tnumber, lpc176x_capture_port capnumber)
 Gets the captured value. More...
 
uint32_t lpc176x_timer_get_timer_value (lpc176x_timer_number tnumber)
 Gets the timer value. More...
 
rtems_status_code lpc176x_timer_set_timer_value (lpc176x_timer_number tnumber, uint32_t lpc176x_timer_value)
 Sets the timer value. More...
 
void lpc176x_timer_isr (void *lpc176x_timer_number)
 Timer generic isroutine. More...
 
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. More...
 
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. More...
 

Detailed Description

Timer API for the lpc176x bsp.

Function Documentation

◆ lpc176x_timer_capture_config()

rtems_status_code lpc176x_timer_capture_config ( lpc176x_timer_number  tnumber,
lpc176x_capture_port  capture_port,
lpc176x_capture_function  function 
)
inline

Configures the capture ports.

Parameters
tnumberthe device to be modified
capture_portwhich port of this timer will be setted
functionAt which edge/s will the capture work, and if it will interrupt

◆ 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 
)
inline

Configures the external match ports.

Parameters
tnumberthe device to be modified
match_portwhich match for this timer
functionwhat should do when match: set, clear toggle or nothing

◆ lpc176x_timer_get_capvalue()

uint32_t lpc176x_timer_get_capvalue ( lpc176x_timer_number  tnumber,
lpc176x_capture_port  capnumber 
)
inline

Gets the captured value.

Parameters
tnumberthe device to be modified
capnumberwhich capture port for this timer
Returns
the captured value

◆ lpc176x_timer_get_timer_value()

uint32_t lpc176x_timer_get_timer_value ( lpc176x_timer_number  tnumber)
inline

Gets the timer value.

Parameters
tnumberthe device
Returns
the timer value

◆ 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 or match function.

Parameters
tnumberwhich timer
Returns
RTEMS_SUCCESSFUL when everything ok.

◆ 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 or match function.

Parameters
tnumberwhich timer to init
vectorthe functions to be used by the isr.
Returns
RTEMS_SUCCESSFUL when everything ok.

◆ lpc176x_timer_is_started()

rtems_status_code lpc176x_timer_is_started ( lpc176x_timer_number  tnumber,
bool *  is_started 
)
inline

true if timer is started.

Parameters
tnumberthe timer number to check.
is_startedTRUE if the timer is running.
Returns
RTEMS_SUCCESSFUL if the started timer check was successfuly.

◆ lpc176x_timer_isr()

void lpc176x_timer_isr ( void *  lpc176x_timer_number)

Timer generic isroutine.

Parameters
timernumberthe number of timer.

◆ 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.

Parameters
tnumberthe device to be modified
match_portwhich port of this timer will be setted
functionwhat the timer should do when match: stop timer, clear, and/or interrupt
match_valuethe value that the timer should match.
Returns
RTEMS_SUCCESSFUL if the timer was configured successfuly.

◆ lpc176x_timer_reset()

rtems_status_code lpc176x_timer_reset ( lpc176x_timer_number  tnumber)
inline

resets timer counter and stops it.

Parameters
tnumberthe device to be reseted
Returns
RTEMS_SUCCESSFUL if the timer was reseted successfuly.

◆ lpc176x_timer_set_mode()

rtems_status_code lpc176x_timer_set_mode ( lpc176x_timer_number  tnumber,
lpc176x_timer_mode  mode 
)
inline

Sets mode of the timer (timer, counter rising, counter falling or counter both edges)

Parameters
tnumberthe device to be setted
modethe desired mode
Returns
RTEMS_SUCCESSFUL if the timer's mode was setted successfuly.

◆ lpc176x_timer_set_resolution()

rtems_status_code lpc176x_timer_set_resolution ( lpc176x_timer_number  tnumber,
lpc176x_microseconds  resolution 
)
inline

sets the resolution in microseconds of the timer

Parameters
tnumberthe device to be modified.
resolutionhow many microseconds will mean each timer counter unit.
Returns
RTEMS_SUCCESSFUL if the timer resolution was setted successfuly.

◆ lpc176x_timer_set_timer_value()

rtems_status_code lpc176x_timer_set_timer_value ( lpc176x_timer_number  tnumber,
uint32_t  lpc176x_timer_value 
)
inline

Sets the timer value.

Parameters
tnumberthe timer to modify.
timer_valuethe value to set.

◆ lpc176x_timer_start()

rtems_status_code lpc176x_timer_start ( lpc176x_timer_number  tnumber)
inline

Starts the timer counter.

Parameters
tnumberthe device to be started
Returns
RTEMS_SUCCESSFUL if the timer's was started successfuly.