logic-analyzer
config_esp32.h
1 #pragma once
2 #ifdef ESP32
3 #include "Arduino.h"
4 
5 // processor specific settings
6 #define MAX_CAPTURE_SIZE 65535 // Max number supported by SUMP
7 #define SERIAL_SPEED 921600
8 #define SERIAL_TIMEOUT 50
9 #define MAX_FREQ 2940052
10 #define MAX_FREQ_THRESHOLD 869900
11 #define START_PIN 19
12 #define PIN_COUNT sizeof(PinBitArray)*8
13 #define DESCRIPTION "Arduino-ESP32"
14 
15 
16 namespace logic_analyzer {
17 
18 
20 typedef uint8_t PinBitArray;
21 
28 class PinReader {
29  public:
30  PinReader(int startPin){
31  this->start_pin = startPin;
32  }
33 
35  inline PinBitArray readAll() {
36  uint32_t input = REG_READ(GPIO_IN_REG) >> start_pin;
37  return input;
38  }
39 
40  private:
41  int start_pin;
42 };
43 
44 
45 } // namespace
46 
47 #endif
48 
PinBitArray readAll()
reads all pins and provides the result as bitmask
Definition: config_esp32.h:35