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

Class doing acquisition from RPI's GPIO. More...

#include <logic_input.h>

Public Member Functions

 logic_input (uint8_t npin=0, uint8_t *pins=NULL, uint32_t npoint=0, float delay=0)
 Constructor.
void init_acquisition (uint8_t *pins, uint8_t npin=0)
 Initialisation of the object for the capture.
void acquire (uint32_t npoint=0, float delay=0)
 Start the acquisition.
 ~logic_input ()
 Destructor.
int Draw (mglGraph *gr, const char *label[]=NULL, uint8_t pin_stats=0)
 Plot logic values acquired.
const void Save (const char *filename)
 Save the object into a file.
void Load (const char *filename)
 Load the object into a file.
void Clean ()
 Clean the object.

Public Attributes

uint32_t npoint
 Number of logic values acquired.
uint8_t npin
 Number of pin used in acquisition.
uint8_t * pins
 Array of GPIO number, each one is used during acquisition.
mglData * rawdata
 Array of mglData vector.
mglData t
 mglData vector of the time of each acquisition.

Detailed Description

Class doing acquisition from RPI's GPIO.

Constructor & Destructor Documentation

logic_input::logic_input ( uint8_t  npin = 0,
uint8_t *  pins = NULL,
uint32_t  npoint = 0,
float  delay = 0 
)

Constructor.

Call init_acquisition and acquire if the corresponding parameters are set.

Member Function Documentation

void logic_input::acquire ( uint32_t  npoint = 0,
float  delay = 0 
)

Start the acquisition.

Parameters
npointnumber of logic values to acquire (1 point is 2 GPIO measurements: one with pull up and one with pull down).
delaytime in ms to wait between 2 point acquisition.
int logic_input::Draw ( mglGraph *  gr,
const char *  label[] = NULL,
uint8_t  pin_stats = 0 
)

Plot logic values acquired.

Parameters
grpointer to a mglGraph object
labelarray of strings giving label of each pin.
pin_statssubplot where to print stats about acquisition.
void logic_input::init_acquisition ( uint8_t *  pins,
uint8_t  npin = 0 
)

Initialisation of the object for the capture.

Parameters
pinsarray of the GPIO pin numbers (ex {9,10} for GPIO9 and GPIO10) to be used during acquisition.
npinnumber of pins to be used during acquisition. Max value is pins array size.
void logic_input::Load ( const char *  filename)

Load the object into a file.

Parameters
filenamestring contenaning filename to be loaded.
const void logic_input::Save ( const char *  filename)

Save the object into a file.

Parameters
filenamestring contenaning filename to be saved.

Member Data Documentation

mglData* logic_input::rawdata

Array of mglData vector.

Size of the array is npin, each vector contains the npoint logic value measurements for the co responding pin

mglData logic_input::t

mglData vector of the time of each acquisition.

contains npoint acquisition time in s.


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