Add support of iWRAP5
- mouse virtical wheel - consumer page
This commit is contained in:
@@ -29,8 +29,6 @@ OPT_DEFS = -DDEBUG_LEVEL=0
|
||||
# MCU name, you MUST set this to match the board you are using
|
||||
# type "make clean" after changing this, so all files will be rebuilt
|
||||
MCU = atmega328p
|
||||
# avrdude doesn't know atmega168p
|
||||
AVRDUDE_MCU = $(MCU)
|
||||
|
||||
|
||||
# Processor frequency.
|
||||
@@ -41,6 +39,15 @@ AVRDUDE_MCU = $(MCU)
|
||||
F_CPU = 12000000
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=2048
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
@@ -75,8 +82,8 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
#AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -c $(AVRDUDE_PROGRAMMER)
|
||||
#AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
@@ -89,9 +96,8 @@ PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE
|
||||
VPATH += $(TARGET_DIR)
|
||||
VPATH += $(TOP_DIR)
|
||||
|
||||
#include $(TOP_DIR)/protocol/iwrap.mk
|
||||
# To be swatchable btween Bluetooth and USB. Comment out if you don't need USB.
|
||||
include $(TOP_DIR)/protocol/vusb.mk
|
||||
#include $(TOP_DIR)/protocol.mk
|
||||
include $(TOP_DIR)/protocol/iwrap.mk
|
||||
# TODO: to be selectable: V-USB, LUFA or PJRC
|
||||
#include $(TOP_DIR)/protocol/vusb.mk
|
||||
include $(TOP_DIR)/common.mk
|
||||
include $(TOP_DIR)/rules.mk
|
||||
|
@@ -2,10 +2,22 @@ IWRAP_DIR = protocol/iwrap
|
||||
|
||||
OPT_DEFS += -DPROTOCOL_IWRAP
|
||||
|
||||
SRC += $(IWRAP_DIR)/iwrap.c \
|
||||
SRC += $(IWRAP_DIR)/main.c \
|
||||
$(IWRAP_DIR)/iwrap.c \
|
||||
$(IWRAP_DIR)/suart.S \
|
||||
$(IWRAP_DIR)/sendchar_uart.c \
|
||||
$(IWRAP_DIR)/uart.c
|
||||
$(COMMON_DIR)/sendchar_uart.c \
|
||||
$(COMMON_DIR)/uart.c
|
||||
|
||||
# TODO: compatible with LUFA and PJRC
|
||||
# V-USB
|
||||
#
|
||||
#VUSB_DIR = protocol/vusb
|
||||
#OPT_DEFS += -DPROTOCOL_VUSB
|
||||
#SRC += $(VUSB_DIR)/vusb.c \
|
||||
# $(VUSB_DIR)/usbdrv/usbdrv.c \
|
||||
# $(VUSB_DIR)/usbdrv/usbdrvasm.S \
|
||||
# $(VUSB_DIR)/usbdrv/oddebug.c
|
||||
#VPATH += $(TOP_DIR)/protocol/vusb:$(TOP_DIR)/protocol/vusb/usbdrv
|
||||
|
||||
|
||||
# Search Path
|
||||
|
1
protocol/iwrap/combo.desc
Normal file
1
protocol/iwrap/combo.desc
Normal file
@@ -0,0 +1 @@
|
||||
05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c005010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0050c0901a1018503050c1500250109e909ea09e209cd19b529b87501950881020a8a010a21020a2a021a23022a27027501950881020a83010a96010a92010a9e010a94010a060209b209b4750195088102c0
|
1
protocol/iwrap/consumer.desc
Normal file
1
protocol/iwrap/consumer.desc
Normal file
@@ -0,0 +1 @@
|
||||
050c0901a1018503050c1500250109e909ea09e209cd19b529b87501950881020a8a010a21020a2a021a23022a27027501950881020a83010a96010a92010a9e010a94010a060209b209b4750195088102c0
|
345
protocol/iwrap/iWRAP5.txt
Normal file
345
protocol/iwrap/iWRAP5.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -334,7 +334,7 @@ static void send_keyboard(report_keyboard_t *report)
|
||||
// HID raw mode header
|
||||
xmit(0x9f);
|
||||
xmit(0x0a); // Length
|
||||
xmit(0xa1); // keyboard report
|
||||
xmit(0xa1); // DATA(Input)
|
||||
xmit(0x01);
|
||||
xmit(report->mods);
|
||||
xmit(0x00); // reserved byte(always 0)
|
||||
@@ -355,9 +355,16 @@ static void send_mouse(report_mouse_t *report)
|
||||
// HID raw mode header
|
||||
xmit(0x9f);
|
||||
xmit(0x05); // Length
|
||||
xmit(0xa1); // mouse report
|
||||
xmit(0xa1); // DATA(Input)
|
||||
xmit(0x02);
|
||||
xmit(report->buttons);
|
||||
/* vertical wheel support */
|
||||
int8_t wheel = report->v;
|
||||
if (wheel < -15) {
|
||||
wheel = -15;
|
||||
} else if (wheel > 15) {
|
||||
wheel = 15;
|
||||
}
|
||||
xmit(((wheel&0x1f)<<3) | (report->buttons&0x07));
|
||||
xmit(report->x);
|
||||
xmit(report->y);
|
||||
MUX_FOOTER(0x01);
|
||||
@@ -457,7 +464,7 @@ static void send_consumer(uint16_t data)
|
||||
MUX_HEADER(0x01, 0x07);
|
||||
xmit(0x9f);
|
||||
xmit(0x05); // Length
|
||||
xmit(0xa1); // consumer report
|
||||
xmit(0xa1); // DATA(Input)
|
||||
xmit(0x03);
|
||||
xmit(bits1);
|
||||
xmit(bits2);
|
||||
|
1
protocol/iwrap/keyboard.desc
Normal file
1
protocol/iwrap/keyboard.desc
Normal file
@@ -0,0 +1 @@
|
||||
05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c0
|
@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "keyboard.h"
|
||||
#include "matrix.h"
|
||||
#include "host.h"
|
||||
#include "action.h"
|
||||
#include "iwrap.h"
|
||||
#ifdef PROTOCOL_VUSB
|
||||
# include "vusb.h"
|
||||
@@ -40,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
static void sleep(uint8_t term);
|
||||
static bool console(void);
|
||||
static uint8_t console_command(uint8_t c);
|
||||
static bool console_command(uint8_t c);
|
||||
static uint8_t key2asc(uint8_t key);
|
||||
|
||||
|
||||
@@ -108,10 +109,13 @@ static void init_vusb(void)
|
||||
|
||||
void change_driver(host_driver_t *driver)
|
||||
{
|
||||
/*
|
||||
host_clear_keyboard_report();
|
||||
host_swap_keyboard_report();
|
||||
host_clear_keyboard_report();
|
||||
host_send_keyboard_report();
|
||||
*/
|
||||
clear_keyboard();
|
||||
_delay_ms(1000);
|
||||
host_set_driver(driver);
|
||||
}
|
||||
@@ -168,6 +172,7 @@ int main(void)
|
||||
if (host_get_driver() == vusb_driver())
|
||||
vusb_transfer_keyboard();
|
||||
#endif
|
||||
// TODO: depricated
|
||||
if (matrix_is_modified() || console()) {
|
||||
last_timer = timer_read();
|
||||
sleeping = false;
|
||||
@@ -176,6 +181,7 @@ int main(void)
|
||||
iwrap_check_connection();
|
||||
}
|
||||
|
||||
// TODO: suspend.h
|
||||
if (host_get_driver() == iwrap_driver()) {
|
||||
if (sleeping && !insomniac) {
|
||||
_delay_ms(1); // wait for UART to send
|
||||
@@ -201,11 +207,6 @@ static void sleep(uint8_t term)
|
||||
WD_SET(WD_OFF);
|
||||
}
|
||||
|
||||
ISR(WDT_vect)
|
||||
{
|
||||
// wake up
|
||||
}
|
||||
|
||||
static bool console(void)
|
||||
{
|
||||
// Send to Bluetoot module WT12
|
||||
@@ -244,12 +245,12 @@ static bool console(void)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t command_extra()
|
||||
bool command_extra(uint8_t code)
|
||||
{
|
||||
return console_command(key2asc(host_get_first_key()));
|
||||
return console_command(key2asc(code));
|
||||
}
|
||||
|
||||
static uint8_t console_command(uint8_t c)
|
||||
static bool console_command(uint8_t c)
|
||||
{
|
||||
switch (c) {
|
||||
case 'h':
|
||||
|
1
protocol/iwrap/mouse.desc
Normal file
1
protocol/iwrap/mouse.desc
Normal file
@@ -0,0 +1 @@
|
||||
05010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0
|
@@ -10,10 +10,10 @@ SRC += $(VUSB_DIR)/main.c \
|
||||
|
||||
|
||||
ifdef NO_UART
|
||||
SRC += sendchar_null.c
|
||||
SRC += $(COMMON_DIR)/sendchar_null.c
|
||||
else
|
||||
SRC += sendchar_uart.c \
|
||||
uart.c
|
||||
SRC += $(COMMON_DIR)/sendchar_uart.c \
|
||||
$(COMMON_DIR)/uart.c
|
||||
endif
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user