logic-analyzer
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
logic_analyzer::PicoCapturePIO Class Reference

First version of Capture implementation for Raspberry Pico using the PIO. Based on https://github.com/raspberrypi/pico-examples/blob/master/pio/logic_analyser/logic_analyser.c. More...

#include <capture_raspberry_pico.h>

Inheritance diagram for logic_analyzer::PicoCapturePIO:
logic_analyzer::AbstractCapture

Public Member Functions

 PicoCapturePIO ()
 Default Constructor.
 
virtual void capture ()
 starts the capturing of the data
 
void cancel ()
 cancels the capturing which is ccurrently in progress
 
virtual void captureAll ()
 Used to test the speed.
 
unsigned long runtimeUs ()
 provides the runtime in microseconds from the capturing start to when the data is available
 
float frequencyMeasured ()
 Provides the measured capturing frequency.
 
float maxFrequency (int warmup=1, int repeat=2)
 
float divider ()
 
- Public Member Functions inherited from logic_analyzer::AbstractCapture
 AbstractCapture ()
 Default Constructor.
 
 ~AbstractCapture ()
 Destructor.
 
LogicAnalyzerlogicAnalyzer ()
 Provides access to the LogicAnalyzer.
 
virtual PinReaderpinReader ()
 Provides access to the PinReader.
 
virtual void setStatus (Status status)
 Sets the status.
 

Protected Member Functions

void start ()
 starts the processing
 
float calculateDivider (uint32_t frequecy_value_hz)
 determines the divider value
 
void arm ()
 intitialize the PIO More...
 
void dump ()
 Dumps the result to PuleView (SUMP software)
 
void waitForResult ()
 Wait for result and update run_time_us and buffer available.
 
- Protected Member Functions inherited from logic_analyzer::AbstractCapture
virtual void setLogicAnalyzer (LogicAnalyzer &la)
 

Protected Attributes

PIO pio = pio0
 
uint sm = 0
 
uint dma_chan = 0
 
uint pin_base
 
uint pin_count
 
uint32_t n_samples
 
uint32_t n_transfers
 
size_t capture_size_words
 
uint trigger_pin
 
bool trigger_level
 
float divider_value
 
uint64_t frequecy_value
 
float max_frequecy_value = -1.0
 
bool abort = false
 
unsigned long start_time
 
unsigned long run_time_us
 
float test_duty_cycle
 
int test_pin =-1
 
- Protected Attributes inherited from logic_analyzer::AbstractCapture
LogicAnalyzerlogic_analyzer_ptr = nullptr
 

Detailed Description

First version of Capture implementation for Raspberry Pico using the PIO. Based on https://github.com/raspberrypi/pico-examples/blob/master/pio/logic_analyser/logic_analyser.c.

Author
Phil Schatzmann

Member Function Documentation

◆ arm()

void logic_analyzer::PicoCapturePIO::arm ( )
inlineprotected

intitialize the PIO

arms the logic analyzer

TODO proper trigger support pio_sm_exec(pio, sm, pio_encode_wait_gpio(trigger_level, trigger_pin));


The documentation for this class was generated from the following file: