User manual

GHI Electronics,LLC Embedded Master User Manual
Hardware and Software Library
Example
// Initialize CAN channel, set bit rate
CAN canChannel = new CAN(CAN.CANChannel.Channel_1, 0x001C000B);
// make new CAN message
CAN.CANMessage message = new CAN.CANMessage();
// make a message of 8 bytes
for (int i = 0; i < 8; i++)
message.data[i] = (byte) i;
message.DLC = 8; // 8 bytes
message.ArbID = 0xAB; // ID
message.isEID = false; // not extended ID
message.isRTR = false; // not remote
// send the message
canChannel.PostMessage(message);
// wait for a message and get it.
while (canChannel.GetRxQueueCount() == 0) ;
// get the message using the same message object
canChannel.GetMessage(message);
// Now "message" contains the data, ID, flags of the received message.
Reference
GHIElectronics.Hardware.CAN
11.12. USB Device (Client)
Note: USB Device and USB Host are completely different tasks. A USB device is straight
forward, for example, making Embedded Master a USB Mouse or Storage Device and can
be plugged to your PC. On the other hand, USB Hosting is much more complicated. This
is where Embedded Master plays the PC role and you can connect USB mice, thumb
drives and other devices to Embedded Master.
Usually, devices support USB host or device. Embedded Master Module contains both of
them and it is up to the final application to have both or one of them. USB host and device
on Embedded Master are 2 separate peripherals, so there would be no conflict when using
them both simultaneously.
Rev. 2.06 TFT Page 72 of 102 www.ghielectronics.com