1、功能说明
    USB 主机 HID mouse & HID keyboard & CDC

2、使用环境

    软件开发环境：KEIL MDK-ARM 5.34
                  IAR EWARM 8.50.1

    芯片支持：
        N32H760
        N32H762
        N32H765
        N32H765EC
        N32H785
        N32H785EC
        N32H787
    开发板支持：
        N32H787_EVB--USB1_HOST/USB2_HOST
        N32H787_HMI--USB2_HOST
        N32H787_EVB_PRO--USB2_HOST


3、使用说明
    描述相关模块配置方法；例如:时钟，I/O等 
    1. SystemClock：HSE_PLL 600MHz
    2. USBHS Clock: HSE 25MHz
    3. GPIO: 确定-KEY1 下-KEY2 上KEY3 WAKEUP（PA0）VBUS驱动引脚
    4. 串口配置：
            - 串口为USART1（TX：PA9  RX：PB7）:
            - 数据位：8
            - 停止位：1
            - 奇偶校验：无
            - 波特率： 115200 

    描述Demo的测试步骤和现象 
    1. 编译后下载程序复位运行；
    2. 打开串口调试助手，设置波特率为115200bps
    3. 连接OTG转接线，再接上CDC设备或者鼠标或键盘，等待枚举完成
    4. 枚举完成后，开始与CDC设备或者鼠标或键盘进行数据通信
    5. 与CDC设备连接时，根据打印信息，按KEY2和KEY3可以选择发送或接收数据或串口配置，KEY1按键确认选项；


4、注意事项
    1. 可通过修改宏定义 USE_USB_HS_IN_FS 或 USE_USB_HS_IN_HS 切换设备为全速模式或者高速模式；
       另外需要使用10MHz、12MHz、19.2MHz、24MHz、25MHz、27MHz、30MHz、或40MHz外部晶体。
    2. 使用H78x工程时需保证CM4有代码运行，建议跑LED点灯Demo(examples_m4\GPIO\LedBlink)。

1. Function description
    USB host HID mouse & HID keyboard & CDC

2. Development environment
    Software development environment: KEIL MDK-ARM V5.34
                                      IAR EWARM 8.50.1

    MCU support:
        N32H760
        N32H762
        N32H765
        N32H765EC
        N32H785
        N32H785EC
        N32H787
    Development board support：
        N32H787_EVB--USB1_HOST/USB2_HOST
        N32H787_HMI--USB2_HOST
        N32H787_EVB_PRO--USB2_HOST

3. How to use
    Describe the configuration method of related modules; for example: clock, I/O, etc. 
    1. SystemClock：HSE_PLL 600MHz
    2. USBHS Clock: HSE 25MHz
    3. GPIO: SEL_OK-KEY1 DOWN-KEY2 UP-KEY1 WAKEUP(PA0) VBUS driver pin
    4. Serial port configuration:
            - Serial port: USART1 (TX: PA9 RX: PB7) :
            - Data bit: 8
            - Stop bit: 1
            - Parity check: None
            - Baud rate: 115200
    
    Describe the testing steps and phenomena of the Demo
    1. Compile the program and download it for reset and execution.
    2. Open the serial port debugging Assistant and set the baud rate to 115200bps.
    3. Connect the OTG adapter, then connect the CDC device or  mouse or keyboard and wait for enumeration to complete.
    4. After enumeration is completed, press the WKUP button to start data communication with the CDC device or  mouse or keyboard device.
    5. When connected to a CDC device, based on the print information, pressing KEY2 and KEY3 can select to send or receive data or configure the serial port, and the KEY1 button confirms the selected option; 

       
4. Attention
    1. The device can be switched to Full-Speed mode or High-Speed mode by modify the macro definition USE_USB_HS_IN_FS or USE_USB_HS_IN_HS;
       In addition, external crystal of 10MHz, 12MHz, 19.2MHz, 24MHz, 25MHz, 27MHz, 30MHz or 40MHz is required.
    2. When using the H78x project, it is necessary to ensure that the CM4 has code to run, and it is recommended to run the LED lighting demo(examples_m4\GPIO\LedBlink). 