Giter VIP home page Giter VIP logo

cc254x-hidkbdm's Introduction

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.

cc254x-hidkbdm's People

Contributors

rampadc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cc254x-hidkbdm's Issues

Would it be possible to change the IDE?

Hi,

Is there any chance to get this ported to some other IDE? IAR Embedded Workspace is a tool I don't have access to.

I know there are plenty of IDEs capables of compiling for the 8051.

Could you consider that a posibility?

Thank you in advance

How to update firmware for CC2540 Dongle?

I have bought a CC2540 dongle, and I was hoping to update the firmware on it. I don't think I need the debugger in this case since the dongle has a USB connection to my laptop.

BT 4.0 HID string to HID

Hello, i have got one question, is it possible to send string to the UART RX of the module with this firmware, using for example in arduino Serial.print("SOME STRING YOU WANT"); ?

I have got a project, where i have to send some numbers and letters (hexadecimal) over serial, to the module, and make an input to the target application on host device.
For example to fill in the form, just like writing on keyboard.
So i need HID, but some hid keyboard modules do not have such a functionality as they are tended to read keystroke matrix without possibility to send string from serial (UART)

I'm asking here, because buying a programmer just for testing "is it working or not" makes no sense, but if it will work that way i'll buy :)

Waiting for some info about it.

Also i could use HC06 BT 2.0 and flash it with HID firmware but I can't find anywhere the hid firmware duped from hid version of that cSR module, so your bt 4.0 looks more interesting.

Contact Address

Hi Cong!

I couldn't find any contact address, so I'm trying it here.. can you please contact me at [email protected]? I have a question about the ThinkPad keyboard connectors!

Baudrate

Hi,

I know this project is currently unmaintained, but if somebody else wants to use it:

THE BAUDRATE IS 57600

According to hidKbdMouse.c:722

@rampadc Thank you very much for the project, although this baudrate issue was wasting quite a time :-)

Wrong password

i try to connect with my PC with BLE enumerator, and i can find the Ble device named as "keyboard" with the firmware of "HM-10_CC2541_Experimental", but the paired password flash by and the dialog window told me that i the password is wrong.

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.