EtherCAT slave that reads 3 Xsens IMU's connected to a Xbus Master
Dependencies: MODSERIAL mbed KL25Z_ClockControl
Fork of EtherCAT by
Diff: xbus.cpp
- Revision:
- 26:c7959f1fd09a
- Parent:
- 18:6629e8c5d59e
- Child:
- 27:93c0e4ae943e
diff -r 829af6f3429f -r c7959f1fd09a xbus.cpp --- a/xbus.cpp Sun Mar 08 21:15:47 2015 +0000 +++ b/xbus.cpp Sun Mar 08 21:53:00 2015 +0000 @@ -120,6 +120,23 @@ wait_ms(10); } + +//uses baudrate values in Xbus Master documentation +void XbusSetBaudRate(uint8_t baud) +{ + uint8_t msg[10]; + XbusCreateMessage(0xFF,0x18,1,&baud,msg); + XbusSendArray(msg); +} + +void XbusReset() +{ + uint8_t msg[10]; + XbusCreateMessage(0xFF,0x40,0,msg,msg);//Reset + XbusSendArray(msg); + wait_ms(1000); +} + void XbusInitializeXbusMaster(void) { uint8_t msg[30];