EE445M RTOS
Taken at the University of Texas Spring 2015
|
#include <pingpp.hpp>
Public Member Functions | |
ping () | |
ping (memory_address_t port_base, memory_address_t port_pin, timer_t timer_id, subtimer_t timer_subtimer) | |
void | sample (void) |
virtual void | start (void) |
virtual void | stop (void) |
uint32_t | handle_gpio (void) |
uint32_t | handle_timer (void) |
semaphore * | get_sem (void) |
uint32_t | notify (void) |
int32_t | average (void) |
int32_t | distance (void) |
![]() | |
uint32_t | StartCritical (void) |
void | EndCritical (uint32_t primask) |
Public Attributes | |
circularbuffer< int32_t, 5 > | buf |
Private Attributes | |
semaphore | sem |
blinker | sig |
ping_status_t | status |
timer | tim |
uint32_t | timer_interrupt |
memory_address_t | base |
memory_address_t | pin |
uint32_t | timer_signal_value |
uint32_t | timer_response_value |
Additional Inherited Members | |
![]() | |
static uint32_t | static_StartCritical (void) |
static void | static_EndCritical (uint32_t primask) |
Definition at line 28 of file pingpp.hpp.
ping::ping | ( | ) |
Definition at line 11 of file pingpp.cpp.
ping::ping | ( | memory_address_t | port_base, |
memory_address_t | port_pin, | ||
timer_t | timer_id, | ||
subtimer_t | timer_subtimer | ||
) |
Definition at line 13 of file pingpp.cpp.
References base, buf, ctlsys::enable_periph(), pin, ping_not_active, sem, sig, status, tim, and timer_interrupt.
int32_t ping::average | ( | void | ) |
Definition at line 135 of file pingpp.cpp.
References buf, buffer< T, N >::buf, and buffer< T, N >::len.
Referenced by distance(), and ping_handler().
int32_t ping::distance | ( | void | ) |
Definition at line 146 of file pingpp.cpp.
References average().
Referenced by can_transmitter().
semaphore * ping::get_sem | ( | void | ) |
The ping sensor's semaphore
Definition at line 130 of file pingpp.cpp.
References sem.
Referenced by main().
uint32_t ping::handle_gpio | ( | void | ) |
Acknowledge isr for sig.
Definition at line 107 of file pingpp.cpp.
References circularbuffer< T, N >::add(), base, buf, timer::get(), timer::load(), pin, ping_response, ping_sample_delay, ping_signal, timer::reload(), timer::start(), status, tim, timer_response_value, and timer_signal_value.
Referenced by GPIOPortD_Handler().
uint32_t ping::handle_timer | ( | void | ) |
Definition at line 85 of file pingpp.cpp.
References timer::ack(), ping_not_active, ping_response, ping_sample_delay, ping_signal, semaphore::post(), sem, status, and tim.
Referenced by Timer1A_Handler().
uint32_t ping::notify | ( | void | ) |
Alert object that the isr watching both edges of sig has been triggered.
void ping::sample | ( | void | ) |
Definition at line 45 of file pingpp.cpp.
References base, delay::count(), critical::EndCritical(), ctlsys::gpio_int_disable(), ctlsys::gpio_int_enable(), ctlsys::periph_to_int(), pin, ping_not_active, sig, critical::StartCritical(), status, blinker::turn_off(), and blinker::turn_on().
Referenced by ping_handler().
|
virtual |
Start the timer monitoring sig.
Definition at line 74 of file pingpp.cpp.
References semaphore::post(), and sem.
Referenced by ping_handler().
|
virtual |
Stop the timer monitoring sig.
Definition at line 80 of file pingpp.cpp.
References semaphore::reset(), and sem.
|
private |
Definition at line 35 of file pingpp.hpp.
Referenced by handle_gpio(), ping(), and sample().
circularbuffer< int32_t , 5 > ping::buf |
Definition at line 66 of file pingpp.hpp.
Referenced by average(), handle_gpio(), and ping().
|
private |
Definition at line 36 of file pingpp.hpp.
Referenced by handle_gpio(), ping(), and sample().
|
private |
Definition at line 30 of file pingpp.hpp.
Referenced by get_sem(), handle_timer(), ping(), start(), and stop().
|
private |
Definition at line 31 of file pingpp.hpp.
|
private |
Definition at line 32 of file pingpp.hpp.
Referenced by handle_gpio(), handle_timer(), ping(), and sample().
|
private |
Definition at line 33 of file pingpp.hpp.
Referenced by handle_gpio(), handle_timer(), and ping().
|
private |
Definition at line 34 of file pingpp.hpp.
Referenced by ping().
|
private |
Definition at line 39 of file pingpp.hpp.
Referenced by handle_gpio().
|
private |
Definition at line 38 of file pingpp.hpp.
Referenced by handle_gpio().