From 9efbd110528ec2dcad0640a71e322675d8014ad9 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Mon, 20 Nov 2023 18:40:22 -0800 Subject: [PATCH] Add docs To be honest, there isn't a lot that needs to be customized here, but there is a lot that could/shold be done for handling the other axises. But drashna doesn't want to do it, at this time --- docs/features/pointing_device.md | 21 +++++++++++++++++++++ drivers/sensors/spacemouse_module.h | 4 +--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/features/pointing_device.md b/docs/features/pointing_device.md index a6bf521a184..caef376ddf2 100644 --- a/docs/features/pointing_device.md +++ b/docs/features/pointing_device.md @@ -368,6 +368,27 @@ report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { ``` +### SpaceMouse Module (UART) + +To use the SpaceMouse module to control the pointer, add this to your `rules.mk` + +```make +POINTING_DEVICE_DRIVER = spacemouse_module +``` + +The SpaceMouse Module is a UART driven sensor, with 6 axises of motion. + +While there isn't a whole lot to configure here, only the X and Y movement is enabled by default. The Z axis and the twist and turn axises are not supported out of box. These can be handled with a custom function: + +```c +void spacemouse_module_handle_axises(spacemouse_data_t *spacemouse_data, report_mouse_t* mouse_report) { + mouse_report->x = CONSTRAIN_HID_XY(spacemouse_data->x); + mouse_report->y = CONSTRAIN_HID_XY(spacemouse_data->y); + mouse_report->h = CONSTRAIN_HID(spacemouse_data->b); + mouse_report->v = CONSTRAIN_HID(spacemouse_data->c); +} +``` + ### Custom Driver If you have a sensor type that isn't supported above, a custom option is available by adding the following to your `rules.mk` diff --git a/drivers/sensors/spacemouse_module.h b/drivers/sensors/spacemouse_module.h index f46125678d9..4d389fa8cc8 100644 --- a/drivers/sensors/spacemouse_module.h +++ b/drivers/sensors/spacemouse_module.h @@ -13,9 +13,7 @@ // - no parity // - 100/s data rate -#ifndef SPACEMOUSE_BAUD_RATE -# define SPACEMOUSE_BAUD_RATE 38400 -#endif +#define SPACEMOUSE_BAUD_RATE 38400 #define SPACEMOUSE_AXIS_COUNT 6