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.
|
binary & | operator= (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
-
source | source binary object |
index_start | inclusive index to start copy from |
index_end | inclusive 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
-
source | source binary object |
t_start | time to start copy from |
t_end | time 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
-
gr | pointer 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_start | first bit to read (inclusive). |
index_end | last 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_start | inclusive index to start looking for bad readings. |
index_end | inclusive index to stop looking for bad readings. |
- Returns
- bad reading number (number of HIGHR or ERR bits).
Initialize from an logic_input object data.
binary values are got from data at pin pin, when the specified transition occurs.
- Parameters
-
data | pointer to the logic_input object |
clk | pointer to the transition object |
pin | index 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
-
value | 2 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.
|
bit | index of the bit |
Member Data Documentation
number of pins used for acquisition
used to know the number of subplots
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: