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