First implementation

This commit is contained in:
Yury Shuvakin
2024-07-03 19:11:29 +09:00
parent 25a3a8ac11
commit d708fc3499
153 changed files with 17687 additions and 0 deletions

37
cpp/driver/CanTiming.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef CANTIMING_H
#define CANTIMING_H
#include <QString>
class CanTiming
{
public:
/*!
* \brief CanTiming generic CAN timing description
* \param id internal id to identify this timing for the corresponding CAN driver
* \param bitrate bitrate in bits per second, e.g. 500000
* \param bitrate_fd bitrate for the FD part, or zero this is not a CanFD timing
* \param samplePoint sample point, e.g. 0.875
*/
CanTiming(unsigned id, unsigned bitrate, unsigned bitrate_fd, unsigned samplePoint);
unsigned getId();
unsigned getBitrate();
unsigned getBitrateFD();
bool isCanFD();
unsigned getSamplePoint();
static QString getSamplePointStr(unsigned samplePoint);
/*!
* \brief getTitle get a brief one-line description of this timing
* \return description, e.g. "500kBit/s, sample point 87.5%"
*/
QString getTitle();
private:
unsigned _id;
unsigned _bitrate;
unsigned _bitrate_fd;
unsigned _samplePoint;
};
#endif // CANTIMING_H