documentation checked and edit

for all files in lib folder
This commit is contained in:
2023-10-12 18:45:12 +02:00
parent 61a95e4601
commit db74898b72
41 changed files with 1030 additions and 569 deletions
+45 -1
View File
@@ -1,21 +1,65 @@
/**
* @file counter.h
* @author Alexander Klein (alex@kleiax.de)
* @brief Contains a class that abstract the hardware counter from the esp32
* @version 0.1
* @date 2023-10-12
*
* @copyright Copyright (c) 2023
*
*/
#pragma once
#include <Arduino.h>
#include <driver/pcnt.h>
#include <cinttypes>
/**
* @brief A class that abstract the hardware counter from the esp32
*/
class Counter
{
public:
/**
* @brief Construct a new Counter object
*
* @param pin with incoming pulses
*/
Counter(uint8_t pin);
/**
* @brief Pause the pulse counting
*/
void pause();
/**
* @brief Resume the pulse counting
*/
void resume();
/**
* @brief Start counting by zero again
*/
void clear();
/**
* @brief Get the counted pulses
*
* @return int16_t
*/
int16_t getValue() const;
/**
* @brief Set the filter value
*
* The filter skip all pulses after a pulse for the filter time.
* The filter time depends on the frequency of the processor. The time
* for a whole tact multiplied with the filter value results the filter time.
*
* @param value max 1023
*/
void setFilterValue(uint16_t value);
void filterEnable();
void filterDisable();
@@ -26,7 +70,7 @@ private:
static uint8_t amountOfCounter;
bool initalised = false;
bool initalized = false;
uint8_t pulsePin;
pcnt_unit_t unit;