logic-analyzer
config_pico.h
1 
9 #pragma once
10 
11 #ifdef ARDUINO_ARCH_RP2040
12 #include "Arduino.h"
13 #include <stdarg.h> /* va_list, va_start, va_arg, va_end */
14 
15 // processor specific settings
16 #define MAX_CAPTURE_SIZE 65535
17 #define SERIAL_SPEED 921600
18 #define SERIAL_TIMEOUT 50
19 #define MAX_FREQ 2203225
20 #define MAX_FREQ_THRESHOLD 661400
21 #define START_PIN 6
22 #define PIN_COUNT sizeof(PinBitArray)*8
23 #define DESCRIPTION "Arduino-Pico"
24 
25 namespace logic_analyzer {
26 
28 typedef uint8_t PinBitArray;
29 
35 class PinReader {
36  public:
37  PinReader(int startPin){
38  this->start_pin = startPin;
39  }
40 
42  inline PinBitArray readAll() {
43  return gpio_get_all()>>start_pin;
44  }
45 
46  private:
47  int start_pin;
48 };
49 
50 }
51 
52 #endif
PinBitArray readAll()
reads all pins and provides the result as bitmask
Definition: config_pico.h:42