logic-analyzer
config_esp8266.h
1 #pragma once
2 #ifdef ESP8266
3 #include "Arduino.h"
4 #include <ets_sys.h>
5 #include <osapi.h>
6 #include <os_type.h>
7 #include <gpio.h>
8 
9 // processor specific settings
10 #define MAX_CAPTURE_SIZE 50000
11 #define SERIAL_SPEED 921600
12 #define SERIAL_TIMEOUT 50
13 #define MAX_FREQ 1038680
14 #define MAX_FREQ_THRESHOLD 533200
15 #define START_PIN 12
16 #define PIN_COUNT 4
17 #define DESCRIPTION "Arduino-ESP8266"
18 
19 
20 namespace logic_analyzer {
21 
23 typedef uint8_t PinBitArray;
24 
25 
32 class PinReader {
33  public:
34  PinReader(int startPin){
35  this->start_pin = startPin;
36  }
37 
39  inline PinBitArray readAll() {
40  uint32_t input = (GPIO_REG_READ(GPIO_OUT_ADDRESS) & (uint32)(0b1111111111111111)) >> start_pin;
41  return input;
42  }
43 
44  private:
45  int start_pin;
46 };
47 
48 
49 } // namespace
50 
51 #endif
52 
PinBitArray readAll()
reads all pins and provides the result as bitmask
Definition: config_esp8266.h:39