#include <mrmspi.h>
Definition at line 20 of file mrmspi.h.
◆ MRMSPI()
MRMSPI::MRMSPI |
( |
volatile unsigned char * |
base | ) |
|
◆ ~MRMSPI()
◆ cycle()
epicsUInt8 MRMSPI::cycle |
( |
epicsUInt8 |
in | ) |
|
|
virtual |
Perform a single SPI transaction
- Exceptions
-
std::runtime_error | on timeout |
Implements mrf::SPIInterface.
Definition at line 65 of file mrmspi.cpp.
70 printf(
"SPI %02x ",
int(in));
76 epicsThreadSleep(
T.inc());
78 throw std::runtime_error(
"SPI cycle timeout2");
81 printf(
"(%f) ",
T.sofar());
93 epicsThreadSleep(
T.inc());
95 throw std::runtime_error(
"SPI cycle timeout2");
98 printf(
"(%f) ",
T.sofar());
101 epicsUInt8 ret =
READ32(base, SPIDData)&0xff;
104 printf(
"%02x\n",
int(ret));
#define READ32(base, offset)
double timeout() const
timeout in seconds for an individual cycle()
#define WRITE32(base, offset, value)
◆ select()
void MRMSPI::select |
( |
unsigned |
id | ) |
|
|
virtual |
Select numbered device. 0 clears selection.
Implements mrf::SPIInterface.
Definition at line 43 of file mrmspi.cpp.
46 printf(
"SPI: select %u\n",
id);
52 epicsThreadSleep(0.001);
59 epicsThreadSleep(0.001);
#define WRITE32(base, offset, value)
The documentation for this class was generated from the following files: