13 #include <epicsTypes.h> 14 #include <epicsMutex.h> 23 virtual ~SPIInterface();
26 virtual void select(
unsigned id) =0;
30 virtual epicsUInt8 cycle(epicsUInt8 in) =0;
38 virtual void cycles(
size_t nops,
42 double timeout()
const;
43 void setTimeout(
double t);
60 inline unsigned selector()
const {
return id; }
66 { dev.spi->
select(dev.id); }
71 static bool lookupDev(
const std::string& name,
SPIDevice*);
72 static void registerDev(
const std::string& name,
const SPIDevice& );
73 static void unregisterDev(
const std::string& name);
85 :total(total), factor(factor), initial(initial), accumulated(0.0), next(0.0)
87 bool ok()
const {
return accumulated<total; }
97 double sofar()
const {
return accumulated; }
unsigned selector() const
SPIDevice(SPIInterface *spi, unsigned id)
SPIInterface * interface() const
TimeoutCalculator(double total, double factor=2.0, double initial=0.01)
virtual void select(unsigned id)=0
Select numbered device. 0 clears selection.
Interface for SPI Master.