protocol class, parent of all protocols.
More...
#include <protocol.h>
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.
|
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
-
npoint | number of points to acquire. |
period | wait time in ms between 2 measurements. |
- 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
-
gr | pointer 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
-
pins | array 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.
|
npin | number of pin to acquire (must be smaller or equal to the size of pins) |
- Clean everything
- 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
-
filename | string 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
-
filename | string contenaning filename to be saved. |
The documentation for this class was generated from the following files: