USB : USB Classes    Packing and Unpacking  

HIDmaker FS's Packing and Unpacking Engine does all that stuff for you, completely automatically, at high speed, and always gets it right. All you need to do is to declare the data items that you want, their sizes and direction (i.e., Input, Output, or bidirectional Feature report items), and HIDmaker FS generates code that packs and unpacks the data at each end.

As we show in a later tutorial in this series, the custom code that HIDmaker FS generates for you declares convenient variables with the same names as the ones you defined with the Visual Data Designer. In the code that is generated for the Peripheral, HIDmaker FS will create variables of the most convenient size. For example, if you declare a USB data item whose size is anywhere from 2 to 8 bits, then HIDmaker FS will generate an 8 bit data item for you. A data item whose size ranges from 9 to 16 bits will produce a 16 bit variable, and so on.

All you need to do, in the code you add, is to just use those variables.

 
  

10 of 14
Copyright Notice and Author Information