Coder Social home page Coder Social logo

cc254x-hidkbdm's Introduction

Maintenance

Additions

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

Known Problems

  • Unable to connect on Android devices 5.0+
  • 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 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.

cc254x-hidkbdm's People

Contributors

rampadc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.