• This repository has been archived on 19/Jul/2020
  • Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    C
  • Created over 10 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

HID Keyboard and Mouse firmware for CC2541 ICs

Additions

  • Added a test Windows software to send mouse and keyboard commands

Known Problems

  • GAP must be set to Display + intiated passcode method in order to connect on iOS devices
  • Mode switching starts after only 1 character is sent
  • Low power mode not configured
  • LED reports are not being received

Overview

This is a firmware for Texas Instruments CC254x Bluetooth Low Energy microcontroller that sends keyboard and mouse reports via Bluetooth to the host. The commands to control the reports are sent via UART at 9600 bps with 8 data bits and no parity bit.

The device operates in 2 modes: command mode and translation mode.

  • If 3 consequence @'s, ie. @@@ is sent, put device into command mode
  • If 3 consequent $'s, ie. $$$ is sent, put device into translation mode

In command mode, the device parse commands sent by the host that are followed by a CR or LF character. The list of commands implemented is listed below:

  • KU[value]: a key is released with an 8-bit value that corresponds to a HID keycode
  • KD[value]: a key is pressed with an 8-bit value that corresponds to a HID keycode
  • M[status][X][Y][Z]: sending mouse buttons and mouse coordinates
  • KUPDATE: send report to host
  • S,R: reset the device
  • S,DC: disconnect from host
  • SN,[value]: change scan response data's string and device name. [value] must be less than 20 characters long. Restart device to see changes.

In translation mode, the device automatically translate ASCII characters to HID keycodes and emulate the key being pressed and released. The characters being covered is currently limited to the first 128 ASCII characters. Other keys like F1-F12, PrintScreen, etc. can only be sent in command mode.

Pre-built firmwares are included as HEX files in the bin folder in CC2540DB and CC2541DB. Since most HM-10 modules now use CC2541, firmware compilation for CC2540 has since been stopped. However, since they both share the same code base, you can compile the firmware yourself. The firmware compiled includes:

  • HM-10_CC254x_DisplayOnly.hex: Early release, to-be-updated soon. (5/8/2014) - obsolete
  • HM-10_CC254x_KeyboardOnly.hex: Early release, to be updated soon (5/8/2014) - obsolete
  • HM-10_CC2541_Experimental.hex: Firmware that supports command mode and translation mode. Passcode 000000. (23/12/2014)

Features to be implemented

  • Receive LED reports from host and send it over UART to external MCU

Setup

This was developed with IAR Embedded Workbench for 8051 v9.20 and BLE-stack v1.4.2.

To flash the firmware onto the chip, CC Debugger ($49) from Texas Instruments need to be used with SmartRF Flash Programmer (free). Connection to HM-10 is as follows:

To customize the firmare, IAR Embedded Workspace for 8051 is needed. You may want to add: #include "bcomdef.h" #include "gatt.h" into hiddev.h to correct some compilation errors, as shown in the photo below:

The source code included needs to be copied into a folder created inside TI's official BLE API 1.4's Project folder as the INCLUDES defined in the Preprocessor are set up for this. The official API was not included in the project as the license agreement does not allow this.

License

Copyright 2017 Benjamin Aigner Copyright 2014 Cong Nguyen

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

arduino-thinkpadkb-usb

Using an Arduino Micro as a USB adapter for ThinkPad T60 keyboard with TrackPoint support. Supports different keyboards from the ThinkPad family that shares the same receptacle as T60.
D
111
star
2

arduino-trackpoint-extended

Arduino library used to interface with a TrackPoint/PS2 mouse. Supports stream mode.
D
59
star
3

tmk_samd21

On-going effort to use tmk_core on SAM D21 MCUs
C
9
star
4

thinkclamp-backup

Backup of ThinkClamp project files: v0.6.1 are produced PCBs on Tindie and v0.6.2 is a draft that was not produced
HTML
3
star
5

Frame

Remote controlling APIs for iPhone cameras with remote preview using NDI, and effects galore for camera and microphone.
C
2
star
6

multi-obj-cplex-python

Jupyter Notebook
2
star
7

line-highlighter

This project highlights specific lines of interest in a code snippet. The result can be copy/pasted back into a Powerpoint slide with the resulting highlight. https://congx.dev/line-highlighter
HTML
2
star
8

toddler-auth

Tribal Wars 2 scripts to authorise with Tribal Wars 2 server
TypeScript
2
star
9

kicad-thinkpad-kbd-connectors

Ongoing effort to bring ThinkPad keyboard connectors to KiCad.
1
star
10

samd21-usb-hids-cdc

Boilerplate application for SAM D21 with USB HID keyboard, mouse and STDIO over CDC
C
1
star
11

catalog

1
star
12

platform-config

1
star
13

multi-obj-optim-prob1

IBM ILOG CPLEX problem 1: max strength minimise recruit time
AMPL
1
star
14

watson-tts-esp32-lyrat

An example for IBM Watson Text-to-Speech on ESP32 ADF
C
1
star
15

rosa-cp4i

Shell
1
star
16

cpd-wds-wks

Shell
1
star
17

nodered-typescript-node-starter

A super simple node built in Typescript, with some Gulp automation to make life simple
JavaScript
1
star
18

grakn-bank-kb

JavaScript
1
star
19

cp4i

Shell
1
star
20

node-red-contrib-tribalwars2-gap

Tribal Wars 2 Graphical Attack Planner nodes for Node-RED
HTML
1
star
21

antora-x-carbon-example

1
star
22

antora-x-carbon

CSS
1
star
23

feklee-node

1
star