Android G1 Serial to USB Cable

g1_serial_phone_powered.jpg
Intro

Android G1 Serial to USB Cable

Learn how to make an Android G1 2.8v serial to USB Serial device adapter (using a 3.3v ttl to usb serial adapter). This can be used for kernel debugging/etc with your computer. This project shouldn't cost you more than 40 bucks if you already have basic electronic tools such as a soldering iron.

Notice: The ability to use 3.3v ttl level serial is based off of google group discussions and a picture of a serial cable used by an alleged android dev. 2.8v level serial was determined via someone using a voltmeter. Build/use at your own risk and check the comments of this instructable too before beginning!

Information may be applied to build a 2.8v serial to RS232 converter to interact with RS232 devices, or a 2.8v serial to serial 5v level converter to interact with microcontroller such as an Arduino. I may post instructables on how to make these once I play around with the G1 kernel some more. :)

This tutorial assumes basic knowledge of soldering. If you don't have this skill you should find an instructable regarding it and practice a bit. The soldering required for this project isn't difficult, but needs to be done in a small amount of space which could be difficult for beginners.

This cable was created based off of information received from the Android-Platform Google Group.

... Specifically these two threads:
http://groups.google.com/group/android-platform/browse_thread/thread/f03730e25cc3fe55?fwc=1
http://groups.google.com/group/android-platform/browse_thread/thread/439d3f3af7a88a09/10a80eb835e8dbcc?lnk=gst&q=serial#10a80eb835e8dbcc

...This picture of a "mystical" g1 serial cable helped (and confused!) too:
https://www.noisebridge.net/wiki/Image:G1-two-usb-to-serial-cable.jpg

Please leave constructive criticism/comments if you find any steps wrong, confusing... or poorly written!
STM32F103C8 Serial(UART) to USB HID Keyboard Mouse 串口 转 USB键盘鼠标 (1) 使用Composite Device 组合(复合)设备 (1.1) 1个Device -> 1个 Configuation -> 2个Interfance (Keyboard & Mouse) (1.2) Keyboard Interfance -> HID (boot mode) -> 2个Endpoint(IN_0x81 & OUT_0x01) -> KeyboardReportDescriptor(不使用Report ID) (1.3) Mouse Interfance -> HID (boot mode) -> 1个Endpoint(IN_0x82) -> MouseReportDescriptor(不使用Report ID) (1.4) 使用HID boot模式, 不使用Report ID, 以便兼容在 计算器设定BIOS模式 中的操作 (2) 串口接收 命令 (2.1) UART协议: 115200, n, 8, 1 (2.2) 1帧发送字符串格式, 以 '{'开始; '}'结束; ','分隔. 共9个10进制数字 例如: {1,2,3,4,5,6,7,8,9} (2.3) 第9位 区分 Keyboard(64) 或是 Mouse(128) 命令 例如: {0,0,0,0,0,0,0,0,64} --- 发送Keyboard命令 {0,0,0,0,0,0,0,0,128} --- 发送Keyboard命令 (3) 发送Keyboard键盘命令时 : 第1~8位 分别如下 (3.1) 第1位 : Key_Release = 0x00, Left_Control = 0x01, Left_Shift = 0x02, Left_Alt = 0x04, Left_GUI = 0x08, Right_Control = 0x10, Right_Shift = 0x20, Right_Alt = 0x40, Right_GUI = 0x80, 例如: {8,0,0,0,0,0,0,0,64} --- 发送 Win_Key键 {128,0,0,0,0,0,0,0,64} --- 发送 WinApp_Key键 {32,0,0,0,0,0,0,0,64} --- 发送 右Shift键 (3.2) 第2位 : 保留,不使用,一律填0 (3.3) 第3~8位 : 可以同时发送6个Keyboard按键 例如: {0,0,4,5,6,7,8,9,64} --- 发送 'abcdef'键 {2,0,4,5,6,7,8,9,64} --- 按住 左Shift 发送 'abcdef'键 => 'ABCDEF' {0,0,0,5,0,7,0,9,64} --- 发送 'bdf'键 (0表示 无按键) 按键码 可参阅: (HID Usage ID) http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf https://www.hiemalis.org/~keiji/PC/scancode-translate.pdf https://gist.github.com/MightyPork/6da26e382a7ad91b5496ee55fdc73db2 http://www.usb.org/developers/hidpage/Hut1_12v2.pdf (4) 发送Mouse鼠标命令时 : 第1~8位 分别如下 (4.1) 第1位 : Button_Release = 0x00, Left_Button = 0x01, Right_Button = 0x02, Mid_Button = 0x04, 例如: {1,0,0,0,0,0,0,0,128} --- 点击 左键 {2,0,0,0,0,0,0,0,128} --- 点击 右键 {4,0,0,0,0,0,0,0,128} --- 点击 中键 (4.2) 第2~4位 : 移动(X,Y), 滚轮(Wheel) X: -127~127:左右移动鼠标 Y: -127~127:上下移动鼠标 Wheel: -127~127:上下转动滚轮 例如: {0,20,-10,0,0,0,0,0,128} --- 鼠标 右移20,上移10 {0,0,0,-30,0,0,0,0,128} --- 滚轮-30 (4.2) 第5~8位 : 保留,不使用,一律填0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值