3 posts / 0 new
Last post
drumste
Offline
Last seen:3年5个月前
Joined:2015-05-22 14:58
HID Mouse

Hi everybody.
I'm building a joystick that, besides other utilization, I'd like to use as a mouse for PC.
The problem is that it use a DA14580 interfaced with an ext. microcontroller that communicate with it through UART, so i have to modify the Dialog HID mouse profile to adapt it for the Joy.
In which files and function can I set and initiate the uart ? (I want to use it on pins 04 and 05).
Can I use directly the callback functions and the mouse_motion_report function for report the event from UART?
With "use directly the functions" I mean set directly, inside the mouse_motion_report function, the "normal_key_report_st" variables with the value from the UART and inside the "press_button_callback" functions, comment all the code lines about GPIO and leave only the button_report_trigger, the inactivity counter and the record_key(), all without modify all the rest of the code.
Thanks.

Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi drumste,

Hi drumste,

你应该设置UARTyou want to use in the user_periph_setup.c in order to exchange message with the external MCU. If i undestand correctly you want a fully hosted solution where the da will take commands from the external MCU's UART and according to the command the application in the da will act accordingly. In that case i suppose that you could trigger an interrupt in every uart receive and log it as the button callback functions do without the GPIO settings for debounce etc.

Thanks MT_dialog

drumste
Offline
Last seen:3年5个月前
Joined:2015-05-22 14:58
Perfect. Exactly as I thought

Perfect. Exactly as I thought.
I'll try it and than I'll let you know if it works.

Topic locked