]>
git.gir.st - tmk_keyboard.git/blob - protocol/usb_hid/USB_Host_Shield_2.0/examples/HID/scale/scale_rptparser.h
1 #if !defined(__SCALERPTPARSER_H__)
2 #define __SCALERPTPARSER_H__
7 /* Scale status constants */
8 #define REPORT_FAULT 0x01
11 #define WEIGHT_VALID 0x04
12 #define WEIGHT_NEGATIVE 0x05
13 #define OVERWEIGHT 0x06
14 #define CALIBRATE_ME 0x07
17 /* input data report */
20 uint8_t reportID
; //must be 3
23 int8_t exp
; //scale factor for the weight
32 void LcdPrint( const char* str
);
36 ScaleEvents( Max_LCD
* pLCD
);
38 virtual void OnScaleChanged(const ScaleEventData
*evt
);
41 #define RPT_SCALE_LEN sizeof(ScaleEventData)/sizeof(uint8_t)
43 class ScaleReportParser
: public HIDReportParser
45 ScaleEvents
*scaleEvents
;
47 uint8_t oldScale
[RPT_SCALE_LEN
];
50 ScaleReportParser(ScaleEvents
*evt
);
52 virtual void Parse(HID
*hid
, bool is_rpt_id
, uint8_t len
, uint8_t *buf
);
55 #endif // __SCALERPTPARSER_H__