B15F
Board 15 Famulus Edition
|
5 #include <bits/stdc++.h> 15 #include <sys/ioctl.h> 18 #include "driverexception.h" 19 #include "timeoutexception.h" 21 typedef std::function<void(std::exception&)> errorhandler_t;
93 static std::string
exec(std::string cmd);
99 static void abort(std::string msg);
105 static void abort(std::exception& ex);
200 void analogSequence(uint8_t channel_a, uint16_t* buffer_a, uint32_t offset_a, uint8_t channel_b, uint16_t* buffer_b, uint32_t offset_b, uint16_t start, int16_t delta, uint16_t count);
206 const std::string PRE =
"[B15F] ";
207 constexpr
static uint8_t MSG_OK = 0xFF;
208 constexpr
static uint8_t MSG_FAIL = 0xFE;
209 constexpr
static uint16_t RECONNECT_TIMEOUT = 64;
210 constexpr
static uint16_t WDT_TIMEOUT = 15;
211 constexpr
static uint8_t RECONNECT_TRIES = 3;
212 constexpr
static uint32_t BAUDRATE = 57600;
217 static B15F* instance;
218 static errorhandler_t errorhandler;
221 constexpr
static uint8_t RQ_DISC = 0;
222 constexpr
static uint8_t RQ_TEST = 1;
223 constexpr
static uint8_t RQ_INFO = 2;
224 constexpr
static uint8_t RQ_INT = 3;
225 constexpr
static uint8_t RQ_ST = 4;
226 constexpr
static uint8_t RQ_BA0 = 5;
227 constexpr
static uint8_t RQ_BA1 = 6;
228 constexpr
static uint8_t RQ_BE0 = 7;
229 constexpr
static uint8_t RQ_BE1 = 8;
230 constexpr
static uint8_t RQ_DSW = 9;
231 constexpr
static uint8_t RQ_AA0 = 10;
232 constexpr
static uint8_t RQ_AA1 = 11;
233 constexpr
static uint8_t RQ_ADC = 12;
234 constexpr
static uint8_t RQ_ADC_DAC_STROKE = 13;
static std::string exec(std::string cmd)
void delay_us(uint16_t us)
uint8_t digitalRead0(void)
void analogSequence(uint8_t channel_a, uint16_t *buffer_a, uint32_t offset_a, uint8_t channel_b, uint16_t *buffer_b, uint32_t offset_b, uint16_t start, int16_t delta, uint16_t count)
Komplexe Analoge Sequenz DAC 0 wird auf den Startwert gesetzt und dann schrittweise um Delta inkremen...
bool testConnection(void)
uint8_t readDipSwitch(void)
void delay_ms(uint16_t ms)
bool analogWrite1(uint16_t)
static B15F & getInstance(void)
static void abort(std::string msg)
uint16_t analogRead(uint8_t channel)
bool digitalWrite0(uint8_t)
bool activateSelfTestMode(void)
std::vector< std::string > getBoardInfo(void)
bool digitalWrite1(uint8_t)
bool analogWrite0(uint16_t)
uint8_t digitalRead1(void)
static void setAbortHandler(errorhandler_t func)