USBDevice for STM support

Dependents:   DISCO-F429ZI_LCDTS_demo_richard

Fork of USBDEVICE by ST

Committer:
pierrebizouard
Date:
Tue Jun 27 13:11:46 2017 +0000
Revision:
6:5a6efd08d588
Parent:
1:2a3ae13b45ef
fixup in definition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 2 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 4 * and associated documentation files (the "Software"), to deal in the Software without
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 7 * Software is furnished to do so, subject to the following conditions:
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 8 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 9 * The above copyright notice and this permission notice shall be included in all copies or
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 10 * substantial portions of the Software.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 11 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 17 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 18
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 19 #ifndef USBMOUSEKEYBOARD_H
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 20 #define USBMOUSEKEYBOARD_H
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 21
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 22 #define REPORT_ID_KEYBOARD 1
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 23 #define REPORT_ID_MOUSE 2
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 24 #define REPORT_ID_VOLUME 3
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 25
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 26 #include "USBMouse.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 27 #include "USBKeyboard.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 28 #include "Stream.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 29 #include "USBHID.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 30
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 31 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 32 * USBMouseKeyboard example
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 33 * @code
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 34 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 35 * #include "mbed.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 36 * #include "USBMouseKeyboard.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 37 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 38 * USBMouseKeyboard key_mouse;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 39 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 40 * int main(void)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 41 * {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 42 * while(1)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 43 * {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 44 * key_mouse.move(20, 0);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 45 * key_mouse.printf("Hello From MBED\r\n");
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 46 * wait(1);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 47 * }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 48 * }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 49 * @endcode
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 50 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 51 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 52 * @code
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 53 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 54 * #include "mbed.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 55 * #include "USBMouseKeyboard.h"
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 56 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 57 * USBMouseKeyboard key_mouse(ABS_MOUSE);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 58 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 59 * int main(void)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 60 * {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 61 * while(1)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 62 * {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 63 * key_mouse.move(X_MAX_ABS/2, Y_MAX_ABS/2);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 64 * key_mouse.printf("Hello from MBED\r\n");
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 65 * wait(1);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 66 * }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 67 * }
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 68 * @endcode
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 69 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 70 class USBMouseKeyboard: public USBHID, public Stream
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 71 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 72 public:
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 73
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 74 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 75 * Constructor
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 76 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 77 * @param mouse_type Mouse type: ABS_MOUSE (absolute mouse) or REL_MOUSE (relative mouse) (default: REL_MOUSE)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 78 * @param leds Leds bus: first: NUM_LOCK, second: CAPS_LOCK, third: SCROLL_LOCK
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 79 * @param vendor_id Your vendor_id (default: 0x1234)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 80 * @param product_id Your product_id (default: 0x0001)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 81 * @param product_release Your preoduct_release (default: 0x0001)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 82 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 83 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 84 USBMouseKeyboard(MOUSE_TYPE mouse_type = REL_MOUSE, uint16_t vendor_id = 0x0021, uint16_t product_id = 0x0011, uint16_t product_release = 0x0001):
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 85 USBHID(0, 0, vendor_id, product_id, product_release, false)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 86 {
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 87 lock_status = 0;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 88 button = 0;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 89 this->mouse_type = mouse_type;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 90 connect();
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 91 };
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 92
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 93 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 94 * Write a state of the mouse
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 95 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 96 * @param x x-axis position
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 97 * @param y y-axis position
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 98 * @param buttons buttons state (first bit represents MOUSE_LEFT, second bit MOUSE_RIGHT and third bit MOUSE_MIDDLE)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 99 * @param z wheel state (>0 to scroll down, <0 to scroll up)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 100 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 101 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 102 bool update(int16_t x, int16_t y, uint8_t buttons, int8_t z);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 103
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 104
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 105 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 106 * Move the cursor to (x, y)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 107 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 108 * @param x x-axis position
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 109 * @param y y-axis position
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 110 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 111 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 112 bool move(int16_t x, int16_t y);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 113
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 114 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 115 * Press one or several buttons
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 116 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 117 * @param button button state (ex: press(MOUSE_LEFT))
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 118 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 119 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 120 bool press(uint8_t button);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 121
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 122 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 123 * Release one or several buttons
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 124 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 125 * @param button button state (ex: release(MOUSE_LEFT))
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 126 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 127 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 128 bool release(uint8_t button);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 129
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 130 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 131 * Double click (MOUSE_LEFT)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 132 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 133 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 134 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 135 bool doubleClick();
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 136
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 137 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 138 * Click
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 139 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 140 * @param button state of the buttons ( ex: clic(MOUSE_LEFT))
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 141 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 142 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 143 bool click(uint8_t button);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 144
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 145 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 146 * Scrolling
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 147 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 148 * @param z value of the wheel (>0 to go down, <0 to go up)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 149 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 150 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 151 bool scroll(int8_t z);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 152
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 153 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 154 * To send a character defined by a modifier(CTRL, SHIFT, ALT) and the key
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 155 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 156 * @code
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 157 * //To send CTRL + s (save)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 158 * keyboard.keyCode('s', KEY_CTRL);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 159 * @endcode
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 160 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 161 * @param modifier bit 0: KEY_CTRL, bit 1: KEY_SHIFT, bit 2: KEY_ALT (default: 0)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 162 * @param key character to send
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 163 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 164 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 165 bool keyCode(uint8_t key, uint8_t modifier = 0);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 166
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 167 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 168 * Send a character
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 169 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 170 * @param c character to be sent
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 171 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 172 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 173 virtual int _putc(int c);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 174
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 175 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 176 * Control media keys
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 177 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 178 * @param key media key pressed (KEY_NEXT_TRACK, KEY_PREVIOUS_TRACK, KEY_STOP, KEY_PLAY_PAUSE, KEY_MUTE, KEY_VOLUME_UP, KEY_VOLUME_DOWN)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 179 * @returns true if there is no error, false otherwise
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 180 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 181 bool mediaControl(MEDIA_KEY key);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 182
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 183 /**
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 184 * Read status of lock keys. Useful to switch-on/off leds according to key pressed. Only the first three bits of the result is important:
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 185 * - First bit: NUM_LOCK
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 186 * - Second bit: CAPS_LOCK
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 187 * - Third bit: SCROLL_LOCK
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 188 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 189 * @returns status of lock keys
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 190 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 191 uint8_t lockStatus();
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 192
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 193 /*
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 194 * To define the report descriptor. Warning: this method has to store the length of the report descriptor in reportLength.
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 195 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 196 * @returns pointer to the report descriptor
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 197 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 198 virtual uint8_t * reportDesc();
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 199
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 200 /*
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 201 * Called when a data is received on the OUT endpoint. Useful to switch on LED of LOCK keys
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 202 *
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 203 * @returns if handle by subclass, return true
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 204 */
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 205 virtual bool EPINT_OUT_callback();
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 206
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 207
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 208 private:
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 209 bool mouseWrite(int8_t x, int8_t y, uint8_t buttons, int8_t z);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 210 MOUSE_TYPE mouse_type;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 211 uint8_t button;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 212 bool mouseSend(int8_t x, int8_t y, uint8_t buttons, int8_t z);
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 213
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 214 uint8_t lock_status;
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 215
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 216 //dummy otherwise it doesn't compile (we must define all methods of an abstract class)
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 217 virtual int _getc() { return -1;}
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 218 };
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 219
frq08711@LMECWL0871.LME.ST.COM 1:2a3ae13b45ef 220 #endif