RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
Namespaces | Macros | Variables
RBControl_encoder.cpp File Reference
#include <driver/gpio.h>
#include <driver/pcnt.h>
#include <driver/periph_ctrl.h>
#include <esp_log.h>
#include "RBControl_encoder.hpp"
#include "RBControl_manager.hpp"
#include "RBControl_pinout.hpp"

Namespaces

 rb
 The base namespace. Contains some logging functions, too.
 

Macros

#define TAG   "RbEncoder"
 
#define ENC_COUNT   static_cast<int>(MotorId::MAX)
 
#define PCNT_H_LIM_VAL   32767
 
#define PCNT_L_LIM_VAL   (-32768)
 
#define INC_PER_REVOLUTION   2
 
#define ESP_INTR_FLAG_DEFAULT   0
 
#define ENC_DEBOUNCE_US   20
 
#define MAX_ENGINE_PERIOD_US   100000
 
#define MIN_ENGINE_PERIOD_US   1000
 

Variables

static const pcnt_unit_t rb::PCNT_UNITS [ENC_COUNT]
 
const gpio_num_t rb::ENCODER_PINS [ENC_COUNT *2]
 

Macro Definition Documentation

◆ ENC_COUNT

#define ENC_COUNT   static_cast<int>(MotorId::MAX)

◆ ENC_DEBOUNCE_US

#define ENC_DEBOUNCE_US   20

◆ ESP_INTR_FLAG_DEFAULT

#define ESP_INTR_FLAG_DEFAULT   0

◆ INC_PER_REVOLUTION

#define INC_PER_REVOLUTION   2

◆ MAX_ENGINE_PERIOD_US

#define MAX_ENGINE_PERIOD_US   100000

◆ MIN_ENGINE_PERIOD_US

#define MIN_ENGINE_PERIOD_US   1000

◆ PCNT_H_LIM_VAL

#define PCNT_H_LIM_VAL   32767

◆ PCNT_L_LIM_VAL

#define PCNT_L_LIM_VAL   (-32768)

◆ TAG

#define TAG   "RbEncoder"