int receive geht
This commit is contained in:
parent
987f5590ce
commit
25f313fbf2
|
@ -49,6 +49,7 @@ void B15F::init()
|
||||||
|
|
||||||
if(!testConnection())
|
if(!testConnection())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
if(!testIntConv())
|
if(!testIntConv())
|
||||||
continue;
|
continue;
|
||||||
|
@ -106,7 +107,6 @@ bool B15F::testConnection()
|
||||||
|
|
||||||
usart.writeByte(RQ_TEST);
|
usart.writeByte(RQ_TEST);
|
||||||
usart.writeByte(dummy);
|
usart.writeByte(dummy);
|
||||||
usart.writeByte(0x80);
|
|
||||||
|
|
||||||
uint8_t aw = usart.readByte();
|
uint8_t aw = usart.readByte();
|
||||||
uint8_t mirror = usart.readByte();
|
uint8_t mirror = usart.readByte();
|
||||||
|
@ -121,7 +121,6 @@ bool B15F::testIntConv()
|
||||||
|
|
||||||
usart.writeByte(RQ_INT);
|
usart.writeByte(RQ_INT);
|
||||||
usart.writeInt(dummy);
|
usart.writeInt(dummy);
|
||||||
usart.writeByte(0x80);
|
|
||||||
|
|
||||||
uint16_t aw = usart.readInt();
|
uint16_t aw = usart.readInt();
|
||||||
return aw == dummy * 3;
|
return aw == dummy * 3;
|
||||||
|
@ -133,7 +132,6 @@ std::vector<std::string> B15F::getBoardInfo(void)
|
||||||
std::vector<std::string> info;
|
std::vector<std::string> info;
|
||||||
|
|
||||||
usart.writeByte(RQ_INFO);
|
usart.writeByte(RQ_INFO);
|
||||||
usart.writeByte(0x80);
|
|
||||||
|
|
||||||
uint8_t n = usart.readByte();
|
uint8_t n = usart.readByte();
|
||||||
while(n--)
|
while(n--)
|
||||||
|
@ -228,10 +226,13 @@ bool B15F::analogSequence(uint8_t channel_a, uint16_t* buffer_a, uint32_t offset
|
||||||
usart.writeInt(start);
|
usart.writeInt(start);
|
||||||
usart.writeInt(static_cast<uint16_t>(delta));
|
usart.writeInt(static_cast<uint16_t>(delta));
|
||||||
usart.writeInt(count);
|
usart.writeInt(count);
|
||||||
|
|
||||||
|
/*
|
||||||
uint8_t aw = usart.readByte();
|
uint8_t aw = usart.readByte();
|
||||||
|
|
||||||
if(aw != MSG_OK)
|
if(aw != MSG_OK)
|
||||||
throw DriverException("Mikrocontroller nicht synchron");
|
throw DriverException("Mikrocontroller nicht synchron");
|
||||||
|
*/
|
||||||
|
|
||||||
for(uint16_t i = 0; i < count; i++)
|
for(uint16_t i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
@ -239,7 +240,7 @@ bool B15F::analogSequence(uint8_t channel_a, uint16_t* buffer_a, uint32_t offset
|
||||||
buffer_b[i] = usart.readInt();
|
buffer_b[i] = usart.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
aw = usart.readByte();
|
uint8_t aw = usart.readByte();
|
||||||
if(aw == MSG_OK)
|
if(aw == MSG_OK)
|
||||||
return aw;
|
return aw;
|
||||||
|
|
||||||
|
|
Binary file not shown.
BIN
driver/main
BIN
driver/main
Binary file not shown.
|
@ -129,17 +129,21 @@ void testFunktionen()
|
||||||
std::cout << "adc: " << (int) drv.analogRead(4) << std::endl;
|
std::cout << "adc: " << (int) drv.analogRead(4) << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "Kennlinie..." << std::endl;
|
||||||
uint16_t a[1024];
|
uint16_t a[1024];
|
||||||
uint16_t b[1024];
|
uint16_t b[1024];
|
||||||
drv.analogSequence(0, &a[0], 0, 1, &b[0], 0, 0, 1, 1024);
|
drv.analogSequence(0, &a[0], 0, 1, &b[0], 0, 0, 1, 1024);
|
||||||
|
for(uint16_t i= 0; i < sizeof(a) / sizeof(uint16_t); i++)
|
||||||
|
{
|
||||||
|
std::cout << (int) i << " : " << a[i] << " " << b[i] << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
||||||
kennlinieZweiterQuadrant();
|
testFunktionen();
|
||||||
|
|
||||||
std::cout << "Schluss." << std::endl;
|
std::cout << "Schluss." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
BIN
driver/main.o
BIN
driver/main.o
Binary file not shown.
Loading…
Reference in a new issue