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

Class containing bits information obtained from logic_input and [transition](transition). More...

#include <binary.h>

Public Member Functions

 binary (uint32_t nbit=0)
 Constructor.
 binary (const binary &source, uint32_t index_start=0, uint32_t index_end=0)
 Default copy constructor, it allows to select a sub-range of the source object.
 binary (const binary &source, float t_start, float t_end=0)
 Copy constructor allowing to select a sub-range in time of the source object.
 ~binary ()
 Destructor.
void init (logic_input *data, transition *clk, uint8_t pin, char transition_direction='u')
 Initialize from an logic_input object data.
uint32_t Get_nbad (uint32_t index_start, uint32_t index_end=0)
 Return bad reading number on an interval.
uint32_t Get (uint32_t index_start, uint32_t index_end=0)
 Return an uint32_t the value between inclusive bits index_start and index_end (as most significant bit first).
void sprint (char value[2], uint32_t bit)
 Copy the logic value of a bit in string.
int Draw (mglGraph *gr)
 Display each bit value.
binaryoperator= (const binary source)
 Assignment operator.

Public Attributes

uint8_t * bits
 Array of bits.
mglData t
 mglData object containing the acquisition time of each bit
uint32_t nbit
 number of bits
uint8_t npin
 number of pins used for acquisition
uint8_t pin
 pin where the binary data has been captured

Detailed Description

Class containing bits information obtained from logic_input and [transition](transition).

Constructor & Destructor Documentation

binary::binary ( const binary source,
uint32_t  index_start = 0,
uint32_t  index_end = 0 
)

Default copy constructor, it allows to select a sub-range of the source object.

Parameters
sourcesource binary object
index_startinclusive index to start copy from
index_endinclusive index where to stop the copy. If index_end=0 or omitted, copy 1 bit only.
binary::binary ( const binary source,
float  t_start,
float  t_end = 0 
)

Copy constructor allowing to select a sub-range in time of the source object.

Parameters
sourcesource binary object
t_starttime to start copy from
t_endtime when to stop the copy. If t_end=0 or omitted, copy until the end.

Member Function Documentation

int binary::Draw ( mglGraph *  gr)

Display each bit value.

Parameters
grpointer to mglGraph object
Returns
execution status (0 if OK)
uint32_t binary::Get ( uint32_t  index_start,
uint32_t  index_end = 0 
)

Return an uint32_t the value between inclusive bits index_start and index_end (as most significant bit first).

Parameters
index_startfirst bit to read (inclusive).
index_endlast bit to read (inclusive). If index_end=0 or omitted, only 1 bit is read.
Returns
value between inclusive bits index_start and index_end (as most significant bit first).
uint32_t binary::Get_nbad ( uint32_t  index_start,
uint32_t  index_end = 0 
)

Return bad reading number on an interval.

Parameters
index_startinclusive index to start looking for bad readings.
index_endinclusive index to stop looking for bad readings.
Returns
bad reading number (number of HIGHR or ERR bits).
void binary::init ( logic_input data,
transition clk,
uint8_t  pin,
char  transition_direction = 'u' 
)

Initialize from an logic_input object data.

binary values are got from data at pin pin, when the specified transition occurs.

Parameters
datapointer to the logic_input object
clkpointer to the transition object
pinindex of the data where to find binary values
transition_direction'u' for low to high transitions, 'd' for the high to low transitions
void binary::sprint ( char  value[2],
uint32_t  bit 
)

Copy the logic value of a bit in string.

Parameters
value2 chars receiving the logic value:
  • "0" for low voltage (<1V when pull up and down used).
  • "1" for high voltage (>2V when pull up and down used).
  • " " for high resistance (<1V when pull down and >2V when pull up)
  • "E" for error (>2V when pull down and <1V when pull up). Abnormal state due to a transition between both measurements.
  • "?" error from the software, report if seen.
bitindex of the bit

Member Data Documentation

uint8_t binary::npin

number of pins used for acquisition

used to know the number of subplots

uint8_t binary::pin

pin where the binary data has been captured

it is the subplot where the binary data will be


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