usb_audio_class_example

Source code path: example\cherryusb\device\hid_mouse

Supported Platforms

  • sf32lb52-lcd_n16r8

Overview

This example demonstrates enumerating a mouse device based on cherryusb USB-HID, including:

  • Press the KEY2 button on sf32lb52-lcd_n16r8 to sequentially trigger left button press, right button press, middle button press, wheel scroll, mouse circle, left button press and move right.

Usage of the Example

Hardware Requirements

Before running this example, prepare:

  • A development board supported by this example (Supported Platforms).

  • Two USB-typec data cables with data transmission capability, one for burning and log viewing, one for connecting to the host.

  • A host device that supports mouse input.

Compilation and Burning

Switch to the example project directory, run the scons command to compile:

scons --board=sf32lb52-lcd_n16r8 -j32

Switch to the example project/build_xx directory, run uart_download.bat, and select the port as prompted to download:

$ ./uart_download.bat

     Uart Download

please input the serial port num:

For detailed steps on compilation and download, please refer to the introduction in Quick Start.

Expected Results of the Example

After the example starts: The host connects to the board via data cable, and a new mouse device will appear in the Mouse and other pointing devices section of the host’s device manager. Press the KEY2 button to sequentially trigger left button press, right button press, middle button press, wheel scroll, mouse circle, left button press and move right.

Exception Diagnosis

Reference Documents

Update History

Version

Date

Release Notes

0.0.1

08/2025

Initial version