#include <b15f.h>
|
const std::string | PRE = "[B15F] " |
| B15F stdout prefix.
|
|
|
constexpr static uint8_t | MSG_OK = 0xFF |
| Value to acknowledge a received command.
|
|
constexpr static uint8_t | MSG_FAIL = 0xFE |
| Value to reject a received command.
|
|
constexpr static uint16_t | RECONNECT_TIMEOUT = 64 |
| Time in ms after which a reconnect attempt aborts.
|
|
constexpr static uint16_t | WDT_TIMEOUT = 15 |
| Time in ms after which the watch dog timer resets the MCU.
|
|
constexpr static uint8_t | RECONNECT_TRIES = 3 |
| Maximum count of reconnect attempts after which the driver stops.
|
|
constexpr static uint32_t | BAUDRATE = 57600 |
| USART baudrate for communication with the MCU.
|
|
main driver class
Definition at line 26 of file b15f.h.
◆ abort() [1/2]
void B15F::abort |
( |
std::exception & |
ex | ) |
|
|
static |
Multithread sicherer Abbruch des B15F-Treibers
- Parameters
-
ex | Exception als Abbruchursache |
Definition at line 373 of file b15f.cpp.
◆ abort() [2/2]
void B15F::abort |
( |
std::string |
msg | ) |
|
|
static |
Multithread sicherer Abbruch des B15F-Treibers
- Parameters
-
msg | Beschreibung der Abbruchursache |
Definition at line 368 of file b15f.cpp.
◆ activateSelfTestMode()
bool B15F::activateSelfTestMode |
( |
void |
| ) |
|
Versetzt das Board in den Selbsttest-Modus WICHTIG: Es darf dabei nichts an den Klemmen angeschlossen sein!
- Exceptions
-
Definition at line 145 of file b15f.cpp.
◆ analogRead()
uint16_t B15F::analogRead |
( |
uint8_t |
channel | ) |
|
Liest den Wert des Analog-Digital-Converters (ADC / ADU)
- Parameters
-
channel | Kanalwahl von 0 - 7 |
- Exceptions
-
Definition at line 220 of file b15f.cpp.
◆ analogSequence()
void B15F::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 |
|
) |
| |
DAC 0 wird auf den Startwert gesetzt und dann schrittweise um Delta inkrementiert. Für jeden eingestelleten DAC-Wert werden zwei ADCs (channel_a und channel_b) angesprochen und die Werte übermittelt. Die Werte werden in buffer_a für Kanal a und buffer_b für Kanal b gespeichert.
- Parameters
-
channel_a | Auswahl des ADC a, von 0 - 7 |
buffer_a | Speichertort für Werte des Kanals a |
offset_a | Anzahl an Werten des Kanals a, die im Speicher übersprungen werden sollen |
channel_b | Auswahl des ADC b, von 0 - 7 |
buffer_b | Speichertort für Werte des Kanals b |
offset_b | Anzahl an Werten des Kanals b, die im Speicher übersprungen werden |
start | Startwert des DACs |
delta | Schrittweite, mit welcher der DAC inkrementiert wird |
count | Anzahl an Inkrementierungen |
- Exceptions
-
Definition at line 243 of file b15f.cpp.
◆ analogWrite0()
bool B15F::analogWrite0 |
( |
uint16_t |
port | ) |
|
Setzt den Wert des Digital-Analog-Converters (DAC / DAU) 0
- Parameters
-
- Exceptions
-
Definition at line 200 of file b15f.cpp.
◆ analogWrite1()
bool B15F::analogWrite1 |
( |
uint16_t |
port | ) |
|
Setzt den Wert des Digital-Analog-Converters (DAC / DAU) 1
- Parameters
-
- Exceptions
-
Definition at line 210 of file b15f.cpp.
◆ delay_ms()
void B15F::delay_ms |
( |
uint16_t |
ms | ) |
|
Lässt den Treiber für eine angegebene Zeit pausieren
- Parameters
-
ms | Verzögerung in Millisekunden |
Definition at line 333 of file b15f.cpp.
◆ delay_us()
void B15F::delay_us |
( |
uint16_t |
us | ) |
|
Lässt den Treiber für eine angegebene Zeit pausieren
- Parameters
-
us | Verzögerung in Microsekunden |
Definition at line 338 of file b15f.cpp.
◆ digitalRead0()
uint8_t B15F::digitalRead0 |
( |
void |
| ) |
|
Liest den Wert des digitalen Eingabeports 0
- Returns
- Wert für gesamten Port
- Exceptions
-
Definition at line 173 of file b15f.cpp.
◆ digitalRead1()
uint8_t B15F::digitalRead1 |
( |
void |
| ) |
|
Liest den Wert des digitalen Eingabeports 1
- Returns
- Wert für gesamten Port
- Exceptions
-
Definition at line 182 of file b15f.cpp.
◆ digitalWrite0()
bool B15F::digitalWrite0 |
( |
uint8_t |
port | ) |
|
Setzt den Wert des digitalen Ausgabeports 0
- Parameters
-
port | Wert für gesamten Port |
- Exceptions
-
Definition at line 153 of file b15f.cpp.
◆ digitalWrite1()
bool B15F::digitalWrite1 |
( |
uint8_t |
port | ) |
|
Setzt den Wert des digitalen Ausgabeports 1
- Parameters
-
port | Wert für gesamten Port |
- Exceptions
-
Definition at line 163 of file b15f.cpp.
◆ discard()
void B15F::discard |
( |
void |
| ) |
|
Verwirft Daten im USART Puffer auf dieser Maschine und B15
- Exceptions
-
Definition at line 72 of file b15f.cpp.
◆ exec()
std::string B15F::exec |
( |
std::string |
cmd | ) |
|
|
static |
Führt ein Befehl auf dieser Maschine aus und liefert stdout zurück
- Parameters
-
Definition at line 352 of file b15f.cpp.
◆ getBoardInfo()
std::vector< std::string > B15F::getBoardInfo |
( |
void |
| ) |
|
Liefert Informationen zur aktuellen Firmware des B15
- Exceptions
-
Definition at line 118 of file b15f.cpp.
◆ getInstance()
B15F & B15F::getInstance |
( |
void |
| ) |
|
|
static |
Liefert eine Referenz zur aktuellen Treiber-Instanz
- Exceptions
-
Definition at line 343 of file b15f.cpp.
◆ pwmSetFrequency()
uint8_t B15F::pwmSetFrequency |
( |
uint32_t |
freq | ) |
|
Setzt die Register so, dass näherungsweise die gewünschte Frequenz erzeugt wird. Ist freq == 0 wird PWM deaktiviert.
- Parameters
-
- Returns
- Top Wert des PWM Value für die gesetzte Frequenz
- Exceptions
-
Definition at line 292 of file b15f.cpp.
◆ pwmSetValue()
bool B15F::pwmSetValue |
( |
uint8_t |
value | ) |
|
Setzt den PWM Wert.
- Parameters
-
- Exceptions
-
Definition at line 314 of file b15f.cpp.
◆ readDipSwitch()
uint8_t B15F::readDipSwitch |
( |
void |
| ) |
|
Liest den Wert des digitalen Eingabeports, an dem der DIP-switch angeschlossen ist (S7)
- Returns
- Wert für gesamten Port
- Exceptions
-
Definition at line 191 of file b15f.cpp.
◆ reconnect()
void B15F::reconnect |
( |
void |
| ) |
|
Versucht die Verbindung zum B15 wiederherzustellen
- Exceptions
-
Definition at line 57 of file b15f.cpp.
◆ setAbortHandler()
void B15F::setAbortHandler |
( |
errorhandler_t |
func | ) |
|
|
static |
Setzt eine Fehlerbehandlungsroutine für den Treiberabbruch (abort)
- Parameters
-
func | Funktion, die Exception als Parameter bekommt |
Definition at line 385 of file b15f.cpp.
◆ testConnection()
bool B15F::testConnection |
( |
void |
| ) |
|
Testet die USART Verbindung auf Funktion
- Exceptions
-
Definition at line 90 of file b15f.cpp.
◆ testIntConv()
bool B15F::testIntConv |
( |
void |
| ) |
|
Testet die Integer Konvertierung der USART Verbindung
- Exceptions
-
Definition at line 105 of file b15f.cpp.
The documentation for this class was generated from the following files: