Version 0.2

This commit is contained in:
Tristan Krause 2019-04-03 11:59:15 +02:00
parent fd2cb56ef3
commit 490da9d724
6 changed files with 21 additions and 2 deletions

View file

@ -152,6 +152,15 @@ std::vector<std::string> B15F::getBoardInfo(void)
return info;
}
bool B15F::activateSelfTestMode()
{
usart.clearInputBuffer();
usart.writeByte(RQ_ST);
uint8_t aw = usart.readByte();
return aw == MSG_OK;
}
bool B15F::digitalWrite0(uint8_t port)
{
usart.clearInputBuffer();

View file

@ -97,6 +97,13 @@ public:
* Steuerbefehle für B15 *
*************************/
/**
* Versetzt das Board in den Selbsttest-Modus
* WICHTIG: Es darf dabei nichts an den Klemmen angeschlossen sein!
* \throws DriverException
*/
bool activateSelfTestMode(void);
/**
* Setzt den Wert des digitalen Ausgabeports 0
* \param port Wert für gesamten Port
@ -192,6 +199,7 @@ private:
constexpr static uint8_t RQ_TEST = 1;
constexpr static uint8_t RQ_INFO = 2;
constexpr static uint8_t RQ_INT = 3;
constexpr static uint8_t RQ_ST = 4;
constexpr static uint8_t RQ_BA0 = 5;
constexpr static uint8_t RQ_BA1 = 6;
constexpr static uint8_t RQ_BE0 = 7;

Binary file not shown.

Binary file not shown.

View file

@ -122,6 +122,8 @@ void kennlinieZweiterQuadrant()
void testFunktionen()
{
B15F& drv = B15F::getInstance();
drv.activateSelfTestMode();
return;
std::cout << "DIP-Switch: " << (int) drv.readDipSwitch() << std::endl;
@ -157,8 +159,8 @@ void testFunktionen()
int main()
{
testFunktionen();
kennlinieZweiterQuadrant();
kennlinieErsterQuadrant();
//kennlinieZweiterQuadrant();
//kennlinieErsterQuadrant();
std::cout << "Schluss." << std::endl;
}

Binary file not shown.