C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
rtosHC_SR04 Class Reference

class for the ultrasonic ranging module HC-SR04 compliant with FreeRTOS More...

#include <rtos_hc_sr04.h>

Collaboration diagram for rtosHC_SR04:
Collaboration graph

Public Member Functions

 rtosHC_SR04 (uint trig_pin, uint echo_pin, QueueHandle_t input_timer_queue, QueueHandle_t output_range_queue, gpio_irq_callback_t echo_irq_call_back, uint32_t event_mask_config=GPIO_IRQ_EDGE_FALL|GPIO_IRQ_EDGE_RISE)
 Construct a new rtosHC_SR04 object.
 
void get_distance ()
 request a measure from HC_SR04
 

Detailed Description

class for the ultrasonic ranging module HC-SR04 compliant with FreeRTOS

Constructor & Destructor Documentation

◆ rtosHC_SR04()

rtosHC_SR04::rtosHC_SR04 ( uint trig_pin,
uint echo_pin,
QueueHandle_t input_timer_queue,
QueueHandle_t output_range_queue,
gpio_irq_callback_t echo_irq_call_back,
uint32_t event_mask_config = GPIO_IRQ_EDGE_FALL | GPIO_IRQ_EDGE_RISE )

Construct a new rtosHC_SR04 object.

Parameters
trig_pinthe pin attached to the triggering signal
echo_pinthe pin used to measure round-trip time of ultrasonic pulses
input_timer_queuethe input queue that receives data from IRQ
output_range_queuethe output queue that receives computed range
echo_irq_call_backThe ISR (interrupt Service Routine) that process IRQ event
event_mask_configthe rising/falling edge configuratio of the irq

The documentation for this class was generated from the following files: