13#include "pico/stdlib.h"
58 gpio_irq_callback_t echo_irq_call_back, uint32_t event_mask_config = GPIO_IRQ_EDGE_FALL | GPIO_IRQ_EDGE_RISE);
uint32_t echo_irq_mask_config
A memory slot reserved to store the irq_event_mask.
Definition rtos_hc_sr04.h:39
uint trig_pin
the GPIO pin that send trigger signal to the HC-SR04 module
Definition rtos_hc_sr04.h:35
QueueHandle_t input_timer_queue
the queue from which echo time measurement are received
Definition rtos_hc_sr04.h:41
uint echo_pin
the GPIO pin where the HC-SR04 return echo signal
Definition rtos_hc_sr04.h:37
QueueHandle_t output_range_queue
the queue to which the resulting range is sent
Definition rtos_hc_sr04.h:43
bool measure_completed
Flag indicating if the measurement is completed.
Definition rtos_hc_sr04.h:45
void get_distance()
request a measure from HCSR04
Definition rtos_hc_sr04.cpp:26
rtos_HCSR04(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 rtos_HCSR04 object.
Definition rtos_hc_sr04.cpp:8
data structure used by ISR to capture, mask, time.
Definition rtos_hc_sr04.h:20
uint32_t current_time_us
the current time at wich the IRQ occurred
Definition rtos_hc_sr04.h:22
uint32_t event_mask
the IRQ mask given by the IRQ harware
Definition rtos_hc_sr04.h:24