Logic Analyzer RPi
Logic Analyzer for the Raspberry Pi
 All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
protocol Class Reference

protocol class, parent of all protocols. More...

#include <protocol.h>

Inheritance diagram for protocol:
microwire raw

Public Member Functions

 protocol (uint8_t pins[]=NULL, uint8_t npin=0)
 Example constructor.
virtual void init_acquisition (uint8_t pins[], uint8_t npin)
 Initialize acquisition. May not be redeclared.
virtual void acquire (uint32_t npoint=2000, float period=1.0)
 Start acquisition. May not be redeclared.
virtual void decode (void)=0
 Perform all the decoding. Need to be defined as it will depend on the protocol.
virtual void Save (const char *filename)
 Save acquisition data. May not be redeclared.
virtual void Load (const char *filename)
 Load acquisition data. May not be redeclared.
virtual int Draw (mglGraph *gr)=0
 Draw all. Need to be defined as it will depend on the protocol.

Public Attributes

logic_input capture
 Contain the raw capture of all pins.

Detailed Description

protocol class, parent of all protocols.

Member Function Documentation

void protocol::acquire ( uint32_t  npoint = 2000,
float  period = 1.0 
)
virtual

Start acquisition. May not be redeclared.

acquire() does not have to be reimplemented, this is the default behaviour:

Parameters
npointnumber of points to acquire.
periodwait time in ms between 2 measurements.
  1. Call binary::acquire()
virtual int protocol::Draw ( mglGraph *  gr)
pure virtual

Draw all. Need to be defined as it will depend on the protocol.

Parameters
grpointer to mglGraph object

Implemented in microwire, and raw.

void protocol::init_acquisition ( uint8_t  pins[],
uint8_t  npin 
)
virtual

Initialize acquisition. May not be redeclared.

init_acquisition() does not have to be reimplemented, this is the default behaviour:

Setup capture on the GPIO pins given.

Parameters
pinsarray of GPIO pin used in the capture such as:
  • pins[0] acquires CS (Chip Select)
  • pins[1] acquires CLK (the clock)
  • pins[2] acquires MOSI (Master Out Slave In)
  • pins[3] acquires MISO (Master In Slave Out)
  • any pin>3 will not be decoded but will be acquired and displayed.
npinnumber of pin to acquire (must be smaller or equal to the size of pins)
  1. Clean everything
  1. Call binary::init_acquisition() if paramaters are given
void protocol::Load ( const char *  filename)
virtual

Load acquisition data. May not be redeclared.

Load() does not have to be reimplemented, this is the default behaviour:

Parameters
filenamestring contenaning filename to be saved.
void protocol::Save ( const char *  filename)
virtual

Save acquisition data. May not be redeclared.

Save() does not have to be reimplemented, this is the default behaviour:

Parameters
filenamestring contenaning filename to be saved.

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