SDG+USBHost(Mouse) Sample

Dependencies:   Sound_Generator USBHost_custom

Fork of SDG_Mouse_Sample by GR-PEACH_producer_meeting

Information

Japanese version is available in lower part of this page.
このページの後半に日本語版が用意されています.

What is this?

This program is a demonstration that sounds the sound by mouse operation by using USBHost(Mouse) and Sound Generator.

Settings

Close JP3 of GR-PEACH.
/media/uploads/RyoheiHagimoto/sdg-mouse.jpg

Operation

operationeffect
Right clickSounds
Left clickReset to base tone (C)
Moves the mouse to the rightLower the sound
Moves the mouse to the leftHigher the sound
Center cursorAdjust the sensitivity.
Reset the reference value in the click.

Others

The default setting of serial communication (baud rate etc.) in mbed is shown the following link.
Please refer to the link and change the settings of your PC terminal software.
The default value of baud rate in mbed is 9600, and this application uses baud rate 9600.
https://developer.mbed.org/teams/Renesas/wiki/GR-PEACH-Getting-Started#install-the-usb-serial-communication


概要

このプログラムは、USBHost(Mouse) + Sound Generatorで、マウス操作による擬似笛デモです。

設定

GR-PEACHのJP3をショートする必要があります。
/media/uploads/RyoheiHagimoto/sdg-mouse.jpg

操作方法

操作内容
右クリック音出力開始
左クリック基準音(ド)にリセット
マウス右移動高音になります
マウス左移動低音になります
センターカーソル音高低の変化量調整(クリックで基準値にリセット)

Others

mbedのシリアル通信(ボーレート等)のデフォルト設定は以下のリンクに示しています。
リンクを参考に、お使いのPCターミナルソフトの設定を変更して下さい。
mbedでのボーレートのデフォルト値は9600で、このサンプルではボーレート9600を使います。
https://developer.mbed.org/teams/Renesas/wiki/GR-PEACH-Getting-Started#install-the-usb-serial-communication

Committer:
mbed_official
Date:
Mon Jan 19 14:30:37 2015 +0000
Revision:
27:4206883f4cb7
Synchronized with git revision 0ab8d2e6b3d884137dcb5c62d29a07abe132bac7

Full URL: https://github.com/mbedmicro/mbed/commit/0ab8d2e6b3d884137dcb5c62d29a07abe132bac7/

RZ_A1H - Implement some USB functions and fix some bugs about USBHost common codes.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 27:4206883f4cb7 1 /*******************************************************************************
mbed_official 27:4206883f4cb7 2 * DISCLAIMER
mbed_official 27:4206883f4cb7 3 * This software is supplied by Renesas Electronics Corporation and is only
mbed_official 27:4206883f4cb7 4 * intended for use with Renesas products. No other uses are authorized. This
mbed_official 27:4206883f4cb7 5 * software is owned by Renesas Electronics Corporation and is protected under
mbed_official 27:4206883f4cb7 6 * all applicable laws, including copyright laws.
mbed_official 27:4206883f4cb7 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
mbed_official 27:4206883f4cb7 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
mbed_official 27:4206883f4cb7 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
mbed_official 27:4206883f4cb7 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
mbed_official 27:4206883f4cb7 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
mbed_official 27:4206883f4cb7 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
mbed_official 27:4206883f4cb7 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
mbed_official 27:4206883f4cb7 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
mbed_official 27:4206883f4cb7 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
mbed_official 27:4206883f4cb7 16 * Renesas reserves the right, without notice, to make changes to this software
mbed_official 27:4206883f4cb7 17 * and to discontinue the availability of this software. By using this software,
mbed_official 27:4206883f4cb7 18 * you agree to the additional terms and conditions found by accessing the
mbed_official 27:4206883f4cb7 19 * following link:
mbed_official 27:4206883f4cb7 20 * http://www.renesas.com/disclaimer
mbed_official 27:4206883f4cb7 21 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
mbed_official 27:4206883f4cb7 22 *******************************************************************************/
mbed_official 27:4206883f4cb7 23
mbed_official 27:4206883f4cb7 24 /*******************************************************************************
mbed_official 27:4206883f4cb7 25 Includes <System Includes> , "Project Includes"
mbed_official 27:4206883f4cb7 26 *******************************************************************************/
mbed_official 27:4206883f4cb7 27 #include "devdrv_usb_host_api.h"
mbed_official 27:4206883f4cb7 28
mbed_official 27:4206883f4cb7 29
mbed_official 27:4206883f4cb7 30 /*******************************************************************************
mbed_official 27:4206883f4cb7 31 Typedef definitions
mbed_official 27:4206883f4cb7 32 *******************************************************************************/
mbed_official 27:4206883f4cb7 33
mbed_official 27:4206883f4cb7 34
mbed_official 27:4206883f4cb7 35 /*******************************************************************************
mbed_official 27:4206883f4cb7 36 Macro definitions
mbed_official 27:4206883f4cb7 37 *******************************************************************************/
mbed_official 27:4206883f4cb7 38
mbed_official 27:4206883f4cb7 39
mbed_official 27:4206883f4cb7 40 /*******************************************************************************
mbed_official 27:4206883f4cb7 41 Imported global variables and functions (from other files)
mbed_official 27:4206883f4cb7 42 *******************************************************************************/
mbed_official 27:4206883f4cb7 43
mbed_official 27:4206883f4cb7 44
mbed_official 27:4206883f4cb7 45 /*******************************************************************************
mbed_official 27:4206883f4cb7 46 Exported global variables and functions (to be accessed by other files)
mbed_official 27:4206883f4cb7 47 *******************************************************************************/
mbed_official 27:4206883f4cb7 48
mbed_official 27:4206883f4cb7 49
mbed_official 27:4206883f4cb7 50 /********************************************************************************************************/
mbed_official 27:4206883f4cb7 51 /* Endpoint Configuration Data Format */
mbed_official 27:4206883f4cb7 52 /********************************************************************************************************/
mbed_official 27:4206883f4cb7 53 /* LINE1: Pipe Window Select Register */
mbed_official 27:4206883f4cb7 54 /* CPU Access PIPE : PIPE1 to PIPE9 [ ### SET ### ] */
mbed_official 27:4206883f4cb7 55 /* LINE2: Pipe Configuration Register */
mbed_official 27:4206883f4cb7 56 /* Transfer Type : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 57 /* Buffer Ready interrupt : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 58 /* Double Buffer Mode : USB_HOST_CNT_ON / USB_HOST_CNT_OFF [ ### SET ### ] */
mbed_official 27:4206883f4cb7 59 /* Continuous Transmit: : USB_HOST_CNT_ON / USB_HOST_CNT_OFF [ ### SET ### ] */
mbed_official 27:4206883f4cb7 60 /* Short NAK : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 61 /* Transfer Direction : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 62 /* Endpoint Number : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 63 /* LINE3: Pipe Buffer Configuration Register */
mbed_official 27:4206883f4cb7 64 /* Buffer Size : (uint16_t)((uint16_t)(((x) / 64) - 1) << 10) */
mbed_official 27:4206883f4cb7 65 /* [ ### SET ### ] */
mbed_official 27:4206883f4cb7 66 /* Buffer Top Number : (uint16_t)(x) [ ### SET ### ] */
mbed_official 27:4206883f4cb7 67 /* LINE4: Pipe Maxpacket Size Register */
mbed_official 27:4206883f4cb7 68 /* Max Packet Size : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 69 /* LINE5: Pipe Cycle Configuration Register (0x6C) */
mbed_official 27:4206883f4cb7 70 /* ISO Buffer Flush Mode : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 71 /* ISO Interval Value : USB_HOST_NONE [ USB_HOST_NONE ] */
mbed_official 27:4206883f4cb7 72 /* LINE6: use FIFO port */
mbed_official 27:4206883f4cb7 73 /* : USB_HOST_CUSE [ ### SET ### ] */
mbed_official 27:4206883f4cb7 74 /* : USB_HOST_D0USE / USB_HOST_D1USE */
mbed_official 27:4206883f4cb7 75 /* : USB_HOST_D0DMA / USB_HOST_D0DMA */
mbed_official 27:4206883f4cb7 76 /* LINE7: use FIFO port Endian : USB_HOST_FIFO_BIG / USB_HOST_FIFO_LITTLE [ #SET# ] */
mbed_official 27:4206883f4cb7 77 /********************************************************************************************************/
mbed_official 27:4206883f4cb7 78
mbed_official 27:4206883f4cb7 79 /* Device Address 1 */
mbed_official 27:4206883f4cb7 80 USB_HOST_CFG_PIPETBL_t usb0_host_blk_ep_tbl1[ ] =
mbed_official 27:4206883f4cb7 81 {
mbed_official 27:4206883f4cb7 82 {
mbed_official 27:4206883f4cb7 83 USB_HOST_PIPE1,
mbed_official 27:4206883f4cb7 84 /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */
mbed_official 27:4206883f4cb7 85 USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDON | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE,
mbed_official 27:4206883f4cb7 86 (uint16_t)((uint16_t)(((1024) / 64) - 1) << 10) | (uint16_t)(8),
mbed_official 27:4206883f4cb7 87 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 88 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 89 USB_HOST_D0USE
mbed_official 27:4206883f4cb7 90 },
mbed_official 27:4206883f4cb7 91
mbed_official 27:4206883f4cb7 92 {
mbed_official 27:4206883f4cb7 93 /* Pipe end */
mbed_official 27:4206883f4cb7 94 0xFFFF,
mbed_official 27:4206883f4cb7 95 0xFFFF,
mbed_official 27:4206883f4cb7 96 0xFFFF,
mbed_official 27:4206883f4cb7 97 0xFFFF,
mbed_official 27:4206883f4cb7 98 0xFFFF,
mbed_official 27:4206883f4cb7 99 0xFFFF
mbed_official 27:4206883f4cb7 100 }
mbed_official 27:4206883f4cb7 101 };
mbed_official 27:4206883f4cb7 102
mbed_official 27:4206883f4cb7 103 USB_HOST_CFG_PIPETBL_t usb0_host_int_ep_tbl1[ ] =
mbed_official 27:4206883f4cb7 104 {
mbed_official 27:4206883f4cb7 105 {
mbed_official 27:4206883f4cb7 106 USB_HOST_PIPE6,
mbed_official 27:4206883f4cb7 107 /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */
mbed_official 27:4206883f4cb7 108 USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDON | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE,
mbed_official 27:4206883f4cb7 109 (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(40),
mbed_official 27:4206883f4cb7 110 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 111 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 112 USB_HOST_D1USE
mbed_official 27:4206883f4cb7 113 },
mbed_official 27:4206883f4cb7 114
mbed_official 27:4206883f4cb7 115 {
mbed_official 27:4206883f4cb7 116 USB_HOST_PIPE7,
mbed_official 27:4206883f4cb7 117 /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */
mbed_official 27:4206883f4cb7 118 USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDON | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE,
mbed_official 27:4206883f4cb7 119 (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(41),
mbed_official 27:4206883f4cb7 120 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 121 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 122 USB_HOST_D1USE
mbed_official 27:4206883f4cb7 123 },
mbed_official 27:4206883f4cb7 124
mbed_official 27:4206883f4cb7 125 {
mbed_official 27:4206883f4cb7 126 USB_HOST_PIPE8,
mbed_official 27:4206883f4cb7 127 /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */
mbed_official 27:4206883f4cb7 128 USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDON | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE,
mbed_official 27:4206883f4cb7 129 (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(42),
mbed_official 27:4206883f4cb7 130 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 131 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 132 USB_HOST_D1USE
mbed_official 27:4206883f4cb7 133 },
mbed_official 27:4206883f4cb7 134
mbed_official 27:4206883f4cb7 135 {
mbed_official 27:4206883f4cb7 136 USB_HOST_PIPE9,
mbed_official 27:4206883f4cb7 137 /* TYPE / BFRE / DBLB / CNTMD / SHTNAK / DIR / EPNUM */
mbed_official 27:4206883f4cb7 138 USB_HOST_NONE | USB_HOST_NONE | USB_HOST_DBLBON | USB_HOST_CNTMDON | USB_HOST_NONE | USB_HOST_NONE | USB_HOST_NONE,
mbed_official 27:4206883f4cb7 139 (uint16_t)((uint16_t)(((64) / 64) - 1) << 10) | (uint16_t)(43),
mbed_official 27:4206883f4cb7 140 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 141 USB_HOST_NONE,
mbed_official 27:4206883f4cb7 142 USB_HOST_D1USE
mbed_official 27:4206883f4cb7 143 },
mbed_official 27:4206883f4cb7 144
mbed_official 27:4206883f4cb7 145 {
mbed_official 27:4206883f4cb7 146 /* Pipe end */
mbed_official 27:4206883f4cb7 147 0xFFFF,
mbed_official 27:4206883f4cb7 148 0xFFFF,
mbed_official 27:4206883f4cb7 149 0xFFFF,
mbed_official 27:4206883f4cb7 150 0xFFFF,
mbed_official 27:4206883f4cb7 151 0xFFFF,
mbed_official 27:4206883f4cb7 152 0xFFFF
mbed_official 27:4206883f4cb7 153 }
mbed_official 27:4206883f4cb7 154 };
mbed_official 27:4206883f4cb7 155
mbed_official 27:4206883f4cb7 156 /* End of File */