You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
412 B
C
30 lines
412 B
C
1 year ago
|
#ifndef _SPIPORT_H_
|
||
|
#define _SPIPORT_H_
|
||
|
|
||
|
#include <string>
|
||
|
|
||
|
class SpiPort
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
SpiPort(const std::string& path);
|
||
|
~SpiPort();
|
||
|
|
||
|
bool Open();
|
||
|
int Write(unsigned char *buf, int len);
|
||
|
int Read(unsigned char *buf, int len);
|
||
|
|
||
|
bool Close();
|
||
|
|
||
|
std::string GetLog() const
|
||
|
{
|
||
|
return m_log;
|
||
|
}
|
||
|
|
||
|
protected:
|
||
|
std::string m_path;
|
||
|
std::string m_log;
|
||
|
int m_fd;
|
||
|
};
|
||
|
|
||
|
#endif
|