うおーるぼっとをWiiリモコンでコントロールする新しいプログラムです。 以前のものより、Wiiリモコンが早く繋がる様になりました。 It is a program which controls A with the Wii remote. ※ A Bluetooth dongle and a Wii remote control are needed.
Dependencies: USBHost mbed FATFileSystem mbed-rtos
btstack/bt_control.h@0:fccb789424fc, 2013-06-10 (annotated)
- Committer:
- jksoft
- Date:
- Mon Jun 10 16:01:50 2013 +0000
- Revision:
- 0:fccb789424fc
1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:fccb789424fc | 1 | /* |
jksoft | 0:fccb789424fc | 2 | * Copyright (C) 2009-2012 by Matthias Ringwald |
jksoft | 0:fccb789424fc | 3 | * |
jksoft | 0:fccb789424fc | 4 | * Redistribution and use in source and binary forms, with or without |
jksoft | 0:fccb789424fc | 5 | * modification, are permitted provided that the following conditions |
jksoft | 0:fccb789424fc | 6 | * are met: |
jksoft | 0:fccb789424fc | 7 | * |
jksoft | 0:fccb789424fc | 8 | * 1. Redistributions of source code must retain the above copyright |
jksoft | 0:fccb789424fc | 9 | * notice, this list of conditions and the following disclaimer. |
jksoft | 0:fccb789424fc | 10 | * 2. Redistributions in binary form must reproduce the above copyright |
jksoft | 0:fccb789424fc | 11 | * notice, this list of conditions and the following disclaimer in the |
jksoft | 0:fccb789424fc | 12 | * documentation and/or other materials provided with the distribution. |
jksoft | 0:fccb789424fc | 13 | * 3. Neither the name of the copyright holders nor the names of |
jksoft | 0:fccb789424fc | 14 | * contributors may be used to endorse or promote products derived |
jksoft | 0:fccb789424fc | 15 | * from this software without specific prior written permission. |
jksoft | 0:fccb789424fc | 16 | * 4. Any redistribution, use, or modification is done solely for |
jksoft | 0:fccb789424fc | 17 | * personal benefit and not for any commercial purpose or for |
jksoft | 0:fccb789424fc | 18 | * monetary gain. |
jksoft | 0:fccb789424fc | 19 | * |
jksoft | 0:fccb789424fc | 20 | * THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS |
jksoft | 0:fccb789424fc | 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
jksoft | 0:fccb789424fc | 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
jksoft | 0:fccb789424fc | 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS |
jksoft | 0:fccb789424fc | 24 | * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
jksoft | 0:fccb789424fc | 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
jksoft | 0:fccb789424fc | 26 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
jksoft | 0:fccb789424fc | 27 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
jksoft | 0:fccb789424fc | 28 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
jksoft | 0:fccb789424fc | 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
jksoft | 0:fccb789424fc | 30 | * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
jksoft | 0:fccb789424fc | 31 | * SUCH DAMAGE. |
jksoft | 0:fccb789424fc | 32 | * |
jksoft | 0:fccb789424fc | 33 | * Please inquire about commercial licensing options at btstack@ringwald.ch |
jksoft | 0:fccb789424fc | 34 | * |
jksoft | 0:fccb789424fc | 35 | */ |
jksoft | 0:fccb789424fc | 36 | |
jksoft | 0:fccb789424fc | 37 | /* |
jksoft | 0:fccb789424fc | 38 | * bt_control.h |
jksoft | 0:fccb789424fc | 39 | * |
jksoft | 0:fccb789424fc | 40 | * BT Control API -- allows BT Daemon to initialize and control differnt hardware |
jksoft | 0:fccb789424fc | 41 | * |
jksoft | 0:fccb789424fc | 42 | * Created by Matthias Ringwald on 5/19/09. |
jksoft | 0:fccb789424fc | 43 | * |
jksoft | 0:fccb789424fc | 44 | */ |
jksoft | 0:fccb789424fc | 45 | |
jksoft | 0:fccb789424fc | 46 | #pragma once |
jksoft | 0:fccb789424fc | 47 | |
jksoft | 0:fccb789424fc | 48 | #include <stdint.h> |
jksoft | 0:fccb789424fc | 49 | |
jksoft | 0:fccb789424fc | 50 | typedef enum { |
jksoft | 0:fccb789424fc | 51 | POWER_WILL_SLEEP = 1, |
jksoft | 0:fccb789424fc | 52 | POWER_WILL_WAKE_UP |
jksoft | 0:fccb789424fc | 53 | } POWER_NOTIFICATION_t; |
jksoft | 0:fccb789424fc | 54 | |
jksoft | 0:fccb789424fc | 55 | typedef struct { |
jksoft | 0:fccb789424fc | 56 | int (*on) (void *config); // <-- turn BT module on and configure |
jksoft | 0:fccb789424fc | 57 | int (*off) (void *config); // <-- turn BT module off |
jksoft | 0:fccb789424fc | 58 | int (*sleep)(void *config); // <-- put BT module to sleep - only to be called after ON |
jksoft | 0:fccb789424fc | 59 | int (*wake) (void *config); // <-- wake BT module from sleep - only to be called after SLEEP |
jksoft | 0:fccb789424fc | 60 | int (*valid)(void *config); // <-- test if hardware can be supported |
jksoft | 0:fccb789424fc | 61 | const char * (*name) (void *config); // <-- return hardware name |
jksoft | 0:fccb789424fc | 62 | |
jksoft | 0:fccb789424fc | 63 | /** support for UART baud rate changes - cmd has to be stored in hci_cmd_buffer |
jksoft | 0:fccb789424fc | 64 | * @return have command |
jksoft | 0:fccb789424fc | 65 | */ |
jksoft | 0:fccb789424fc | 66 | int (*baudrate_cmd)(void * config, uint32_t baudrate, uint8_t *hci_cmd_buffer); |
jksoft | 0:fccb789424fc | 67 | |
jksoft | 0:fccb789424fc | 68 | /** support custom init sequences after RESET command - cmd has to be stored in hci_cmd_buffer |
jksoft | 0:fccb789424fc | 69 | * @return have command |
jksoft | 0:fccb789424fc | 70 | */ |
jksoft | 0:fccb789424fc | 71 | int (*next_cmd)(void *config, uint8_t * hci_cmd_buffer); |
jksoft | 0:fccb789424fc | 72 | |
jksoft | 0:fccb789424fc | 73 | void (*register_for_power_notifications)(void (*cb)(POWER_NOTIFICATION_t event)); |
jksoft | 0:fccb789424fc | 74 | |
jksoft | 0:fccb789424fc | 75 | void (*hw_error)(void); |
jksoft | 0:fccb789424fc | 76 | } bt_control_t; |