You are on page 1of 52

_` BlueICE HID SDK User Guide

Issue 2

CSR Cambridge Science Park Milton Road Cambridge CB4 0WH United Kingdom Registered in England 3665875 Tel.: +44 (0)1223 692000 Fax.: +44 (0)1223 692001 www.csr.com

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Document History

Document History
Revision bcoreug-028P 1 2 Date Change Reason 18 JUL 06 Original publication of this data sheet as CSR reference bcore-ug-028P. 31 MAY 07 Updated with functionality changes from Kymodo to BlueICE Retail Bundle applicaton. Changed Document ID to CS-102079-UG. 06 NOV 08 Updated throughout If you have any comments about this document, send an email to comments@csr.com, giving the document number, title and section with your feedback.

_` BlueICE HID SDK User Guide

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 2 of 52

Trademarks, Patents and Licences

Trademarks, Patents and Licences


Unless otherwise stated, words and logos marked with or are trademarks registered or owned by CSR plc or its affiliates. Bluetooth and the Bluetooth logos are trademarks owned by Bluetooth SIG, Inc. and licensed to CSR. Other products, services and names used in this document may have been trademarked by their respective owners. The publication of this information does not imply that any licence is granted under any patent or other rights owned by CSR plc. CSR reserves the right to make technical changes to its products as part of its development programme. While every care has been taken to ensure the accuracy of the contents of this document, CSR cannot accept responsibility for any errors. CSRs products are not authorised for use in life-support or safety-critical applications. Refer to www.csrsupport.com for compliance and conformance to standards information.

_` BlueICE HID SDK User Guide

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 3 of 52

Contents

Contents
1 Introduction ..................................................................................................................................................... 8 1.1 Intended Audience ................................................................................................................................. 8 1.2 Assumptions .......................................................................................................................................... 8 1.3 Terminology ........................................................................................................................................... 8 Key Features .................................................................................................................................................. 9 Installing BlueICE HID SDK .......................................................................................................................... 10 3.1 Installing the BlueICE Components ..................................................................................................... 10 3.2 BlueICE HID SDK Prerequisite ............................................................................................................ 10 3.3 BlueICE HID SDK Modification to Bluelab v4.0.1 Release .................................................................. 10 3.4 Building BlueICE HID SDK VM Libraries ............................................................................................. 10 3.5 Building BlueICE HID VM Applications ............................................................................................... 10 About BlueICE HID SDK ............................................................................................................................... 11 4.1 Compatible Hardware (User-supplied) ................................................................................................ 11 4.2 Bluetooth Host and Device Modes of Operation .................................................................................. 11 4.2.1 Discovering ............................................................................................................................ 11 4.2.2 Pairing .................................................................................................................................... 11 4.2.3 Connecting ............................................................................................................................. 11 4.2.4 Pairing and Connecting: Modes of Operation Matrix ............................................................. 11 4.3 Types of Button Presses ...................................................................................................................... 12 4.4 CSR Firmware ..................................................................................................................................... 12 4.4.1 Host Module Firmware ........................................................................................................... 12 4.4.2 Host Module Firmware Interfaces ......................................................................................... 13 4.4.3 Device Firmware .................................................................................................................... 13 4.4.4 System Configurations ........................................................................................................... 13 4.4.5 HID Proxy Mode ..................................................................................................................... 13 4.4.6 HCI Mode ............................................................................................................................... 14 Switching Between the HID Proxy Mode and HCI Mode ............................................................................. 15 Loading and Configuring Bluetooth Host Firmware ...................................................................................... 16 6.1 Downloading Host Firmware into Flash on BlueCore Module ............................................................. 16 6.2 Using PSTool Utility to Download Default PS Key Values into Flash ................................................. 17 Setting Up Host Module ................................................................................................................................ 22 7.1 User PS Keys for BlueICE HID SDK v1.0.5 and Lower ...................................................................... 22 7.2 User PS Keys for BlueICE HID SDK v1.0.6 and Higher ...................................................................... 23 7.2.1 Hardware Radio Enable ......................................................................................................... 23 7.2.2 PIO Line/Status Indicator ....................................................................................................... 24 7.2.3 Sniff Subrating Configuration ................................................................................................. 24 7.2.4 Keyboard Sniff Subrating Parameters .................................................................................... 24 7.2.5 Mouse Sniff Subrating Parameters ........................................................................................ 25 7.2.6 Pushbutton ............................................................................................................................ 25 7.2.7 HCI Mode Status Indicator Pulse Sequences ...................................................................... 25 7.2.8 Configuring the HID Device Support Mode ............................................................................ 27 7.3 Initial Boot Mode (HCI or Proxy Mode) ................................................................................................ 27 7.4 Configuration Security ......................................................................................................................... 28 7.5 Host Interface ..................................................................................................................................... 28 Setting Up the Device ................................................................................................................................... 29 8.1 List of USER PS Keys ......................................................................................................................... 29 8.2 Sniff Subrating ..................................................................................................................................... 30 8.3 Class of Device .................................................................................................................................... 30 8.4 Sensor Interfaces ................................................................................................................................. 31 8.5 Idle Disconnect and Sniff Parameter ................................................................................................... 31

2 3

_` BlueICE HID SDK User Guide

5 6

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 4 of 52

Contents

8.5.1 Legacy Sniff Interval .............................................................................................................. 32 Programmable I/O ............................................................................................................................... 32 8.6.1 General I/O ............................................................................................................................. 32 8.6.2 Mouse Button I/O ................................................................................................................... 34 8.6.3 Mouse Wheel I/O ................................................................................................................... 34 8.6.4 Avago First Generation Sensor Interface I/O ........................................................................ 35 8.6.5 Avago Second Generation Sensor Interface I/O .................................................................. 36 8.6.6 Pixart Sensor Interface I/O ..................................................................................................... 36 8.7 UART Sensor Interface ........................................................................................................................ 36 8.8 Sensor XY Translation Configuration .................................................................................................. 37 8.9 Sensor Resolution Configuration ......................................................................................................... 37 8.10 Avago Laser Sensor ............................................................................................................................ 38 8.11 Pixart Additional Configurations ........................................................................................................... 38 8.12 Battery Monitoring ................................................................................................................................ 39 8.13 PIN Code (or Passcode) ...................................................................................................................... 41 8.14 HID Service Discovery Protocol Record Configuration ........................................................................ 41 8.14.1 String Language and Encoding .............................................................................................. 41 8.14.2 Service Name ......................................................................................................................... 42 8.14.3 Service Provider ..................................................................................................................... 42 8.14.4 Service Description ................................................................................................................ 43 8.14.5 Country Code ......................................................................................................................... 43 8.15 Device Identification SDP Record Configuration ................................................................................. 43 8.15.1 Vendor ID and Source ............................................................................................................ 43 8.15.2 Product ID .............................................................................................................................. 44 8.15.3 Version ................................................................................................................................... 44 8.16 Factory Test Mode ............................................................................................................................... 44 8.17 Extra Keyboard Configuration .............................................................................................................. 45 8.17.1 Scan Matrix Dimensions ........................................................................................................ 45 8.17.2 Keyboard LED Behaviour ....................................................................................................... 45 9 Document References .................................................................................................................................. 46 A Avago Mouse Sensors .................................................................................................................................. 47 A.1 Avago First Generation Sensor ........................................................................................................... 47 A.2 Avago Second Generation Sensors .................................................................................................... 47 B Appendix B Using UART as HID Sensor Interface ....................................................................................... 49 B.1 UART HID Report Format .................................................................................................................... 49 B.2 UART Flow Control .............................................................................................................................. 50 Terms and Definitions ............................................................................................................................................ 52 8.6

_` BlueICE HID SDK User Guide

List of Figures
Figure 4.1 Figure 4.2 Figure 6.1 Figure 6.2 Figure 6.3 Figure 6.4 Figure 6.5 Figure B.1 Figure B.2 HID Proxy Mode Interface Diagram ................................................................................................ 13 HCI Mode Interface Diagram .......................................................................................................... 14 BlueFlash Window .......................................................................................................................... 16 BlueFlash: Firmware File Selected for Download .......................................................................... 17 PSTool: Choose Transport Window ................................................................................................ 18 PSTool: BlueCore Persistent Store Window .................................................................................. 18 Device Manager: Before and After Firmware Loads (HID Proxy Mode) ........................................ 20 Synchronous UART Data Transfer ................................................................................................. 51 Asynchronous UART Data Transfer ................................................................................................ 51

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 5 of 52

Contents

List of Tables
Table 4.1 Table 4.2 Table 4.3 Table 6.1 Table 6.2 Table 6.3 Table 7.1 Table 7.2 Table 7.3 Table 7.4 Table 7.5 Table 7.6 Table 7.7 Table 7.8 Table 7.9 Table 7.10 Table 7.11 Table 7.12 Table 7.13 Table 7.14 Table 8.1 Table 8.2 Table 8.3 Table 8.4 Table 8.5 Table 8.6 Table 8.7 Table 8.8 Table 8.9 Table 8.10 Table 8.11 Table 8.12 Table 8.13 Table 8.14 Table 8.15 Table 8.16 Table 8.17 Table 8.18 Table 8.19 Table 8.20 Table 8.21 Table 8.22 Table 8.23 Table 8.24 Table 8.25 Table 8.26 Table 8.27 Table 8.28 Table 8.29 Table 8.30 Host Module and Device: Modes of Operation ................................................................................. 12 Types of Button Presses .................................................................................................................. 12 Pairing and Connection Behaviour ................................................................................................... 14 Casira Host Persistent Store Files ................................................................................................... 19 Dongle Host Persistent Store File .................................................................................................... 19 Pairing Instructions ........................................................................................................................... 21 List of PS Keys for the Host Module (BlueICE v1.0.5 and Lower) ................................................... 22 List of PS Keys for the Host Module (BlueICE v1.0.6 and Higher) ................................................... 23 Hardware and Software Radio Enable Configuration ....................................................................... 24 Status Indicator Configuration .......................................................................................................... 24 SSR Enable/Disable Configuration .................................................................................................. 24 Keyboard SSR Parameters .............................................................................................................. 25 Mouse SSR Parameters ................................................................................................................... 25 Pushbutton Configuration ................................................................................................................ 25 HCI Mode Status Indicator Pulse Sequences .................................................................................. 26 HCI Mode Status Indicator Operation .............................................................................................. 27 HID Device Support Mode Configuration ......................................................................................... 27 Initial Boot Mode Configuration ........................................................................................................ 28 BCCMD Security Configuration ........................................................................................................ 28 Host Interface Configuration ............................................................................................................. 28 List of PS Keys for the Device .......................................................................................................... 29 Device SSR Configuration ................................................................................................................ 30 Class of Device Configuration .......................................................................................................... 31 Sensor Interface Configuration ......................................................................................................... 31 Sniff Table Configuration .................................................................................................................. 32 PIO Mask Configuration .................................................................................................................. 33 PIO Value Configuration .................................................................................................................. 33 PIO Order of the Configuration Words ............................................................................................. 33 Mouse Button I/O PS Key ................................................................................................................ 34 Mouse Wheel I/O PS Key ................................................................................................................. 35 Wheel Quadrature Configuration ...................................................................................................... 35 Avago First Sensor Interface I/O Configuration ................................................................................ 35 Avago Second Sensor Interface Configuration ................................................................................ 36 Pixart Sensor Interface I/O Configuration ......................................................................................... 36 UART as Sensor Interface Configuration ......................................................................................... 37 Avago Sensor XY Translation Configuration .................................................................................... 37 Sensor Resolution Configuration ...................................................................................................... 38 Avago Laser Sensor Configuration .................................................................................................. 38 Pixart Additional Configuration ........................................................................................................ 39 Battery Monitoring Configuration ...................................................................................................... 40 PIN Code Configuration ................................................................................................................... 41 String Language and Encoding Configuration ................................................................................. 42 String Language and Encoding Configuration ............................................................................... 42 Service Name Configuration ............................................................................................................ 42 Service Provider Configuration ......................................................................................................... 43 Service Description Configuration .................................................................................................... 43 Country Code Configuration ............................................................................................................. 43 Vendor ID and Source Configuration .............................................................................................. 44 Product ID Configuration ................................................................................................................. 44 Version Configuration ...................................................................................................................... 44

_` BlueICE HID SDK User Guide

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 6 of 52

Contents

Table 8.31 Table 8.32 Table 8.33 Table A.1 Table A.2 Table A.3 Table B.1 Table B.2 Table B.3

Factory Test Mode Configuration .................................................................................................... 44 Scan Matrix Dimension Configuration .............................................................................................. 45 Keyboard LED Behaviour Configuration .......................................................................................... 45 Avago First Generation Sensor ........................................................................................................ 47 Avago Second Generation Sensors ................................................................................................. 47 Interface Pins for Other Sensors ...................................................................................................... 48 UART Report Format ....................................................................................................................... 49 UART HID Report ID 1 Format ......................................................................................................... 49 Pointer Report Format ...................................................................................................................... 50

_` BlueICE HID SDK User Guide

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 7 of 52

Introduction

Introduction

The _`=_f`b HID SDK software solution is a collection of software and firmware components that are used to develop a Bluetooth HID Desktop Bundle. This bundle includes a keyboard, mouse and a host module and/or USB dongle. TheBlueICE Developer Guide describes how to install and configure the software and firmware, then use that knowledge to manufacture Bluetooth products. BlueICE HID SDK provides the following components:

BlueICE HID SDK Windows Installer Package: Windows development software to install on the PC that enables developing and/or modification of VM applications or VM libraries Host Firmware: Firmware that runs on a BlueCore-based host module and/or USB dongle Device Firmware: Firmware that runs on one or more BlueCore-based HIDs such as a keyboard and/or mouse

_` BlueICE HID SDK User Guide

1.1 1.2
Note:

Intended Audience Assumptions


Hardware that allows the end-user to download and run the firmware and tools to program and configure BlueICE The ability to program and configure Bluetooth modules using the SPI cable A unique address for each manufactured device as acquired from the Bluetooth SIG/IEEE VIDs and PIDs Fresh batteries in the HIDs

This document aids developers and CSR OEMs in using BlueICE HID SDK to design and manufacture and/or sell HIDs and Bluetooth host module and/or USB dongle products for use with PCs.

This section identifies the tools and knowledge required before installing the BlueICE application:

The Casira Development Kit is available for purchase and provides an alternative for hardware and a suite of utilities to assist the end-user with the wireless technology development program (for example, BlueSuite and BlueLab, PSTool and BlueFlash). If you are using a Casira Development Kit, contact CSR for appropriate versions of these products. BlueICE is based on a BlueCore4-External module design; the device firmware and host firmware are used on BlueCore4-External based Bluetooth HIDs and host modules respectively. See Section 4 for information on usersupplied hardware components required to use BlueICE.

1.3

Terminology

See the Terms and Definitions section for description of terms or acronyms used in this document. For clarification, this documentation makes the following distinction between a host module and a USB dongle:

Host module (embedded): A module or card embedded into the PC host; internal to the PC host USB dongle (external): A USB device that inserts into a USB port; a device that is external to the PC host BlueICE: is interchangeable with BlueICE HID SDK

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 8 of 52

Key Features

Key Features
Full compliance with Bluetooth v2.1 specifications Secure simple pairing Sniff subrating feature Device firmware based on BlueCore4-External; configurable by the customer Battery voltage measurement Either HID Proxy Mode or HID HCI Mode

The key features of BlueICE HID SDK are:

_` BlueICE HID SDK User Guide

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 9 of 52

Installing BlueICE HID SDK

3
3.1

Installing BlueICE HID SDK


Installing the BlueICE Components
Modifies Bluelab v4.0.1 release Builds HID SDK libraries Installs the built-in HID images for HID devices and HID dongles

This section provides instructions on installing BlueICE HID SDK.

BlueICE HID SDK installer:

3.2

BlueICE HID SDK Prerequisite

To install BlueICE HID SDK, you must install the following on your system: Bluelab v4.0.1 release (CSR development environment) Perl v5.08 or higher

_` BlueICE HID SDK User Guide

3.3
Note:

BlueICE HID SDK Modification to Bluelab v4.0.1 Release


New apps directory is added and the original apps directory is renamed to apps.orig New lib directory is added and the original lib directory is renamed to lib.orig The firmware directory coyote is renamed to coyote.orig and the proper firmware is picked up from a new directory Images If profiles directory exists, then it is renamed to profiles.orig and new directory profiles is created after building the new HID SDK VM libraries A new environment variable is added called BLUEICESDK

After successfully installing the BlueICE HID SDK, it modifies the Bluelab v4.0.1 release as follows:

You must first un-install BlueICE HID SDK before un-installing or re-installing the Bluelab v4.0.1 release.

3.4

Building BlueICE HID SDK VM Libraries

To debug, develop or modify any code in the BlueICE HID SDK, you must first build the new VM libraries. The VM libraries automatically build upon installation of the BlueICE HID SDK, unless you deselect the build of the VM libraries. If you modified the VM libraries, then you must build them as follows:

Run a DOS command prompt. Go to the directory of the installed Bluelab v4.0.1 release. Go to the src\lib directory. Run the buildlib.bat file.

3.5

Building BlueICE HID VM Applications

Two VM applications are under the apps directory; the Kymodo-Device and the Kymodo-Host. Use the xIDE and select one project at a time to build both applications.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 10 of 52

About BlueICE HID SDK

4
4.1

About BlueICE HID SDK


Compatible Hardware (User-supplied)
HIDs: Keyboard Mouse Host Module (a motherboard or internal module) or USB Dongle PC: Must be IBM-compatible running MS Windows XP or later Casira Endpoint: This hardware is part of the Casira Bluetooth Development Kit. This kit is available for purchase from CSR to supplement the BlueICE package.

This section provides information about the hardware that is compatible with BlueICE and the software and firmware CSR supplies.

BlueICE firmware is designed for use on the following BlueCore4-External based hardware:

_` BlueICE HID SDK User Guide

Firmware for other BlueCore variants is available on request from CSR. CSR recommends using a Casira with a BlueCore4-External module and a product prototype for early device development.

4.2

Bluetooth Host and Device Modes of Operation


Discovering Pairing Connecting

This section describes the Bluetooth connectivity modes for a host module and a device:

4.2.1

Discovering

Discovery occurs when a device attempts to identify or locate the devices in its vicinity and determine if and when they can communicate.

4.2.2

Pairing

The pairing process allows devices to recognise, to authenticate one another and to set up a trusted relationship between the host module and the HIDs. After a device pairs with the host (knows the Bluetooth address), it remains paired until cleared. To indicate the pairing status, the host module or USB dongle uses an LED indicator. PIOs can be used to connect a line to the sample input from the user, such as a pushbutton, and a different line to drive an output LED.

4.2.3

Connecting

After pairing occurs, a HID establishes a connection (link) with the host module as needed. The host and devices can transmit data between themselves. BlueICE HIDs disconnect to save power (configurable). For example, a mouse that sits idle for a long period disconnects. When the mouse moves again, the connection with the host is reestablished.

4.2.4

Pairing and Connecting: Modes of Operation Matrix

Table 4.1 shows states of behaviour that can occur at any time with a host module and a device:

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 11 of 52

About BlueICE HID SDK

State Not Paired Not Connected Paired Not Connected Paired Connected

Description The device has not established a trusted relationship or a connection. It is unable to provide input to the host PC. The device has established a trusted relationship. No active connection exists and the device is unable to provide input to the host PC. The device has completed and established a trusted relationship. Link keys have been exchanged. An active connection exists and the device is able to provide input to the host PC. Table 4.1: Host Module and Device: Modes of Operation

_` BlueICE HID SDK User Guide

4.3

Types of Button Presses

The button on the bottom of the keyboard or mouse is used to clear, pair, or connect HIDs with a host module, as required. This section explains the types of button presses and how they function within BlueICE: To Use This Type of Button Press Results

Clear all Bluetooth devices

Clears any paired devices from the host module or USB dongle. Initiates an Auto-Connect. Starts a Bluetooth device discovery and attempts to pair with a single device Long button press (hold down button that supports Auto-Connect. for 5 or more seconds)
Note:

The clear function does not clear a single device at a time. It clears all connected devices at a given time. Initiates an Auto-Connect. Pairs a device without clearing an existing paired device.
Note:

Add an additional Bluetooth device

Short button press (hold down button for at least 4 seconds)

The add function connects one type of device at one time (one mouse, one keyboard). A connection to more than one device type is not supported (two keyboards, two mice).

Table 4.2: Types of Button Presses

4.4
4.4.1

CSR Firmware
Host Module Firmware

This section describes the firmware that BlueICE installs for the host module and the HIDs.

The host module firmware runs on the internal processor of the BlueCore IC. The firmware is delivered as .xdv, .xpv and .psr files. The .xdv and .xpv files are loaded into a BlueCore4-External devices external flash using the BlueFlash utility. The .psr files are loaded using the PSTool utility. See Section 7 for details on PS Key settings for the host module. See Section 4.4.2 for information on the interfaces supported by the host firmware. See Section 4.4.4 for the system configurations that the host firmware supports.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 12 of 52

About BlueICE HID SDK

4.4.2

Host Module Firmware Interfaces


Host Interface: The host module firmware enables the connection of a Bluetooth radio to a host using a USB interface. Configurable features of the firmware allow a host module or USB dongle to present either the standard HCI interface or the USB HID interface to the host. Which interface is presented to the host is configured using PS Key settings when the module is manufactured. User Interface: The host module firmware is designed to interface directly with the customer using a pushbutton and a status indicator (usually a LED). PS Keys indicate which PIO lines are connected to the pushbutton and status indicator. Radio Interface: The BlueCore4-External Bluetooth radio interface is used to establish connections to peripheral devices. In HID Proxy mode, the module can only connect to a mouse or keyboard. In HCI mode, the module can connect to any Bluetooth peripheral supported by the PCs Bluetooth host software stack.

The host module firmware supports the following interfaces for normal operation:

4.4.3

Device Firmware

_` BlueICE HID SDK User Guide

BlueICE supplies the device firmware for use with the BlueCore4-External-based Bluetooth HIDs. See Section 4.1 for a listing of BlueICE supported HIDs. The firmware is configured using PS Key settings to specify the type of device. Many other configuration options are also available. See Section 8 for descriptions of PS Key settings for the device. The firmware supplied is suitable for developing and prototyping Bluetooth HIDs and offers the flexibility to address a variety of design choices. However, some customer-specific data should be compiled into the firmware. Contact CSR to obtain a specific release.

4.4.4

System Configurations
HID Proxy Mode: Enables a connection of Bluetooth HIDs to a PC or host without the need for a Bluetooth host software stack and OS. See Section 4.4.5 for more information on the HID Proxy mode. HCI Mode: Enables a connection with Bluetooth HIDs and other Bluetooth peripherals, such as headsets, cell phones and PDAs, to a PC or host, but only when a Bluetooth host software stack and OS are loaded. See Section 4.4.6 for more information on the HCI mode.

The host module firmware supports two system configurations:

After installing BlueICE on a host, the firmware is used to connect the PC and HIDs and the host module or USB dongle using a connect feature (button press on the device or desktop system).

4.4.5

HID Proxy Mode


The BlueCore host module or USB dongle presents itself on the USB as a USB keyboard, mouse, or composite (keyboard and mouse). The host module can be set to automatically find the HIDs with no PIN entry required. The host module or USB dongle firmware implements the Bluetooth HID profile internally. The use of a Bluetooth keyboard for BIOS set-up programs is supported.

Figure 4.1 shows the actions that occur in the HID Proxy mode:

Figure 4.1: HID Proxy Mode Interface Diagram HID Proxy Mode Details Supported Devices: In the HID Proxy mode, the host module supports up to one connection to each supported device simultaneously. Device support is statically configured by the host module manufacturer when the host module is programmed. See section Section 7 for valid settings.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 13 of 52

About BlueICE HID SDK

Device Pairing Status

Host Module Behaviours

No Keyboard, No Mouse Search first. No Keyboard, Mouse Keyboard, No Mouse Keyboard and Mouse Search first. The priority is to connect with a keyboard, then connect the mouse. Connect the keyboard, then search for the mouse. Connect. No search. Table 4.3: Pairing and Connection Behaviour When no supported devices are paired with the host module. Following a short button press, the host module starts a search for approximately 30 seconds to find a supported device. If at least one, but not all, supported devices are already paired with the host module, the host module alternates between searching for the additional devices and allowing the paired devices to connect. The module performs 5 cycles, alternating between searching and allowing connections. Each search period is approximately 7.5 seconds while each connect period is approximately 4.5 seconds. The host module firmware gives priority to establishing a keyboard connection. The module starts with a connect period if a keyboard has been previously paired, otherwise, it starts with a search period. When all supported devices are paired with the host module, the discovery process is not initiated again unless the pairing information is cleared.

_` BlueICE HID SDK User Guide

Status Indicator: The status indicator PIO pulses with a 50% duty cycle 2 Hertz signal while the host module attempts to discover and automatically connect to a keyboard or mouse. Otherwise, the status indicator is active whenever the radio is enabled. Pushbutton (when available): Button presses are passed up to the Bluetooth host software stack as vendor specific events. Short button press: This initiates the pairing process. Long button press: This causes the host to delete any existing pairing information. If enabled, the host initiates the pairing and search process.

4.4.6

HCI Mode

When the host software stack loads, the host module or USB dongle and the HIDs operate in the HCI mode. In the HCI mode, the BlueCore host module or USB dongle presents an HCI interface on the USB.

Figure 4.2: HCI Mode Interface Diagram HCI Mode Details


Host Module Firmware: In the HCI mode, the host module presents the Bluetooth HCI interface on the USB. A Bluetooth host software stack is required. Status Indicator: If a status indicator pulse sequence is defined, the status indicator is driven as configured. Otherwise, the status indicator is active while the system is running and the radio is enabled. The status indicator is inactive during system: Standby Hibernate Power down Pushbutton (when available): Button presses are passed up to the Bluetooth host software stack as vendorspecific events.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 14 of 52

Switching Between the HID Proxy Mode and HCI Mode

Switching Between the HID Proxy Mode and HCI Mode

The current BlueICE HID SDK does not offer the required PC application/driver to allow switching between Proxy and HCI modes. The HID host module or dongle solutions operate in one of these modes.

_` BlueICE HID SDK User Guide

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 15 of 52

Loading and Configuring Bluetooth Host Firmware

Loading and Configuring Bluetooth Host Firmware

Firmware must be programmed into the flash of the BlueCore IC using the SPI. BlueICE solutions use external flash memory. The SPI Interface is also used to configure the behaviour of the BlueICE application. The instructions in this section describe how to use a Casira endpoint as the host module. It is beyond the scope of this document to describe how to provide SPI interface access to the customer design.
Important Note:

1. 2. 3.

BlueSuite or BlueLab must be installed to access BlueFlash. BlueFlash is required to download the firmware. PSTool is required to configure the firmware. Go to csrsupport.com to download the latest firmware files. Contact sales@csr.com for access to this site. The Casira development kit must be set up.

_` BlueICE HID SDK User Guide

6.1

Downloading Host Firmware into Flash on BlueCore Module

This section provides instructions on downloading and uploading the firmware used on the host module and/or USB dongle.
Note:

The names of some files and and the .psr key files are valid for BlueIce HID SDK v1.0.6 and higher. To download the host firmware: 1. 2. 3. 4. 5. 6. Back up the firmware and settings currently loaded on the Casira endpoint as described in the Casira User Guide. Download the latest firmware files from the CSR Support web site csrsupport.com from this location: PC Central/BlueICE Firmware There are three types of files for each component of BlueICE: .xdv, .xpv and .psr. Copy all these files to a local directory. Connect the power cable to the Casira endpoint. Connect the SPI cable (the grey ribbon cable supplied with the Casira Development Kit) between the Casira endpoint (to the connector marked CN16/SIF on the Casira board) and the parallel port on the PC. Click Start > All Programs > CSR BlueSuite > BlueFlash. The BlueFlash window displays:

7.

Figure 6.1: BlueFlash Window Click Stop Processor. The button description changes to Start Processor. This enables other buttons in the window.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 16 of 52

Loading and Configuring Bluetooth Host Firmware

Note:

The Stop Processor button acts as a toggle to stop and start the processor. When the Stop Processor button is selected, the button description changes to Start Processor. If the Start Processor button is selected, the button description changes to Stop Processor. 8. Click Flash Erase. The Erase Options window displays. 9. Click Erase Full chip. A confirmation window displays. 10. Click Yes to erase all of the software on the IC. Another confirmation window displays 11. Click Yes. An erase progress indicator appears until the erase operation is successfully completed. 12. Click Choose File and browse to the directory containing the host firmware files.
Note:

Download the correct version of the firmware file(s). Refer to release notes if necessary. 13. Select the .xpv file and click on Open. The firmware file selection window displays.

_` BlueICE HID SDK User Guide

14. 15. 16. 17. 18.

Figure 6.2: BlueFlash: Firmware File Selected for Download Click Download to download the firmware. Repeat steps 12-14 for each firmware file to be downloaded. When the download process is completed, click Start Processor to restart the processor. Close the BlueFlash utility. Configure the host firmware using the BlueSuite or BlueLab PSTool utility. See Section 6.2 for instructions.

6.2

Using PSTool Utility to Download Default PS Key Values into Flash

Releases of the BlueICE firmware are accompanied by PS Key configuration files containing PS Keys for a Casira endpoint. Downloading these files to the Casira endpoint sets all the PS Keys to values that are known to work with the BlueICE firmware. The PSTool application is used to download PS Key values. The PSTool utility is part of the BlueSuite package. Download the utility from csrsupport.com. When configuring a Casira endpoint to use host firmware for the first time, CSR recommends downloading PS Key configuration files. Follow these steps to set up a Casira endpoint as a BlueICE host with known good PS Key values:
Note:

See BlueSuite documentation for detailed instructions on using the PSTool utility. To download the host firmware using PSTool:

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 17 of 52

Loading and Configuring Bluetooth Host Firmware

1. 2.

Install BlueSuite. Download this application from csrsupport.com. See Section 3 for instructions to install and configure BlueICE. Click Start > All Programs > CSR BlueSuite > PSTool. The Choose Transport window displays.

_` BlueICE HID SDK User Guide

3.

4.

Figure 6.3: PSTool: Choose Transport Window Verify selection of these settings: SPI BCCMD LPT1 Halt Chip on SPI access Click OK. The BlueCore Persistent Store window displays.

5. 6.

Figure 6.4: PSTool: BlueCore Persistent Store Window Select File > Merge. The Open Persistent Store File window displays. If necessary, browse to the location of Persistent Store files, .psr, supplied with the host firmware release. The following files are available:

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 18 of 52

Loading and Configuring Bluetooth Host Firmware

Host Persistent Store File Name

File Type Generic (required)

Description Always download this file. Download this file first. Download this file to pair either a keyboard or mouse with the host module.

BlueICE_casira_host_generic.psr

BlueICE_casira_host_composite_hid.psr

Composite

Important Note:

If this file is downloaded, do not download the keyboard and mouse files.

_` BlueICE HID SDK User Guide

7.

Table 6.1: Casira Host Persistent Store Files To pair only a keyboard with the Casira, download the BlueICE_casira_host_keyboard_hid.psr file instead of

BlueICE_casira_host_composite_hid.psr
8. 9. To pair only a mouse with the Casira, download the BlueICE_casira_host_mouse_hid.psr file instead of BlueICE_casira_host_composite_hid.psr. To load a dongle instead of the Casira, see Table 6.2 Dongle Host Persistent Store File Name File Type Composite Description HID mode composite to pair both keyboard and mouse

BlueICE_dongle_host_composite.psr

Table 6.2: Dongle Host Persistent Store File 10. To pair only a keyboard with the dongle, download the BlueICE_dongle_host_keyboard.psr file instead of BlueICE_dongle_host_composite.psr. 11. To pair only a mouse with the dongle, download the BlueICE_dongle_host_mouse.psr file instead of BlueICE_dongle_host_composite.psr. 12. Click the kymodo_host_generic.psr file, then click Open. 13. Repeat steps 5 through 7 for each file to be downloaded. 14. Close the PSTool utility. 15. Click Start. 16. Locate and move cursor to the My Computer option, then right-click and select Manage. The Computer Management window appears. 17. In the left pane, click Device Manager. 18. In the right pane, expand Keyboards and Mice and other pointing devices. 19. Verify that the selected firmware is loaded. The appearance of the HID devices verifies that the firmware is successfully downloaded.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 19 of 52

Loading and Configuring Bluetooth Host Firmware

_` BlueICE HID SDK User Guide

Figure 6.5: Device Manager: Before and After Firmware Loads (HID Proxy Mode) 20. Unplug and re-plug in the power cord on the Casira endpoint to reset the BlueCore4-External IC. BlueCore4External is now configured to run in the default mode using the PIO assignments suitable for the CSR Casira host module. 21. Based on the PS Keys downloaded, pair the appropriate devices using the instructions in Table 6.3.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 20 of 52

Loading and Configuring Bluetooth Host Firmware

Pair Device

Host Persistent File Type

Actions On the Casira endpoint, hold down the 3 key for 4 seconds or less (short button press) to pair with more than one HID. The #7 LED starts to blink indicating it is in search mode. On the bottom of the keyboard, press the connect button to place the device in a discoverable mode. The LED button on the Casira endpoint stops blinking when the keyboard is paired with the PC, or if the PC connection fails. Test the keyboard to make sure it is functional from the PC (for example, open Microsoft Word and start typing, and the keystrokes are visible on the PC screen).

Composite

Keyboard

_` BlueICE HID SDK User Guide

Keyboard

On the Casira endpoint, hold down the 3 key for 5 or more seconds (long button press) to clear any paired devices. The #7 LED starts to blink indicating it is in search mode. On the bottom of the keyboard, press the connect button to place the device in a discoverable mode. The LED button on the Casira endpoint stops blinking when the keyboard is paired with the PC, or if the PC connection fails. Test the keyboard to make sure it is functional from the PC (for example, open Microsoft Word and start typing, and the keystrokes are visible on the PC screen). On the Casira endpoint, hold down the 3 key for 4 seconds or less (short button press) to pair with more than one HID. The #7 LED starts to blink indicating it is in search mode. On the bottom of the mouse, press the connect button to place the device in a discoverable mode. The LED button on the Casira endpoint stops blinking when the mouse is paired with the PC, or if the PC connection fails. Test the mouse to make sure the mouse pointer moves on the PC screen. On the Casira endpoint, hold down the 3 key for 5 or more seconds (long button press) to clear any paired devices. The #7 LED starts to blink indicating it is in search mode. On the bottom of the mouse, press the connect button to place the device in a discoverable mode. The LED button on the Casira endpoint stops blinking when the mouse is paired with the PC, or if the PC connection fails. Test the mouse to make sure the mouse pointer moves on the PC screen. Table 6.3: Pairing Instructions

Composite

Mouse

Mouse

You are ready to use the Casira endpoint as a host and pair with either a keyboard or mouse to build devices.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 21 of 52

Setting Up Host Module

Setting Up Host Module

This section contains information for configuring PS Keys for the HID Proxy mode, HID device support, PIO assignments, push button presses (short and long) and turning the Bluetooth radio on and off.
Important Note:

Use the Programmer ID view in the PSTool utility to view the PS Key IDs as represented in these instructions. Select this view from the BlueCore Persistent Store window by selecting View > Programmer IDs.

7.1

User PS Keys for BlueICE HID SDK v1.0.5 and Lower

This section provides a numerical list of the User PS Keys for BlueICE HID SDK v1.0.5 and lower. PS Key Description

_` BlueICE HID SDK User Guide

USR0 USR1 USR2 USR6 USR7 USR8

Enables/disables the hardware TX radio by PIO Configures the PIO line/status indicator Enables/disables of hardware TX radio by software Enables/disables SSR Configures SSR parameters for the keyboard Configures SSR parameters for the mouse

USR12 Configures the Connect Button USR15 Configures the status indicator functionality for the HCI mode USR16 Configures the HID Support mode for the host module to support no device, only a keyboard, only a
mouse or both a keyboard and a mouse Table 7.1: List of PS Keys for the Host Module (BlueICE v1.0.5 and Lower)

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 22 of 52

Setting Up Host Module

7.2
PS Key

User PS Keys for BlueICE HID SDK v1.0.6 and Higher


Description

This section provides a numerical list of the User PS Keys for BlueICE HID SDK v1.0.6 and higher.

USR0, USR1, USR2 Reserved USR4 USR5 USR6 USR7 USR8 USR12 USR15 USR16
Enables/disables of hardware TX radio by PIO Configures the PIO line/status indicator Enables/disables SSR

_` BlueICE HID SDK User Guide

Configures SSR parameters for the keyboard Configures SSR parameters for the mouse Configures the Connect Button Configures the status indicator functionality for the HCI mode Configures the HID Support mode for the host module to support no device, only a keyboard, only a mouse or both a keyboard and a mouse Table 7.2: List of PS Keys for the Host Module (BlueICE v1.0.6 and Higher)

7.2.1

Hardware Radio Enable

The host modules Bluetooth radio can be disabled by a hardware or software mechanism. The radio is enabled if both the hardware and software mechanisms agree that it should be. Otherwise the radio is disabled.
Note:

The word Radio when used in the context of Radio Enable or Radio Disable refers to the radio transmission function of the BlueCore IC. By default, the radio on the host module is hardware-enabled. A PIO can be configured to control the hardware radio enabling. It can be configured active high or low. Active high means that the hardware mechanism enables the radio when the configured PIO is high; otherwise it is disabled. Active low means that the radio is enabled when the configured PIO is low or disabled otherwise.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 23 of 52

Setting Up Host Module

PS Key

Value

Devices Supported by the Host Module Indicates the number of the PIO line used as the hardware radio enable. If the most significant bit is set, the hardware enable is sampled as active low. If this PS Key is not present, then hardware radio enable is considered on. In this case, the software mechanism has full control over radio enabling.

USR0 or USR4
Depends on the SDK version

Hexadecimal Integer between 0x0000 and 0x000e or

0x8000 and 0x800e

_` BlueICE HID SDK User Guide

USR2
Should only be set by VM commands

0x0000

False
Software disabled TX radio

0x0001

True
Software enabled TX radio

Table 7.3: Hardware and Software Radio Enable Configuration

7.2.2

PIO Line/Status Indicator

The host module firmware requires a knowledge of which PIO lines are connected for user input and the status indicator. Both active high and active low operations are supported for user input and status indication. PS Key Value Hexadecimal Integer between 0x0000 and 0x000e or Description Indicates the number of the PIO line which is connected to the status indicator. If the most significant bit is set, the status indicator is driven as active low.

USR1 or USR5
Depends on the SDK version

0x8000 and 0x800e

Table 7.4: Status Indicator Configuration

7.2.3

Sniff Subrating Configuration

USR6 enables and disables the SSR functionality. It enables or disables the SSR globally for both keyboard and mouse.
PS Key Value Comments Disables SSR Enables SSR

0 USR6 1

Table 7.5: SSR Enable/Disable Configuration

7.2.4

Keyboard Sniff Subrating Parameters

PS Key USR7 defines the SSR parameters of the keyboard. The SSR parameters define the maximum TX and RX latency. The Sniff Subrating Anchor points are functions of both parameters defined here and the sniff period.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 24 of 52

Setting Up Host Module

PS Key

Word Position 0 1

Comments MaxRemoteLatency Reserved MinRemoteTimeout MinLocalTimeout

USR7
2 3 Table 7.6: Keyboard SSR Parameters

7.2.5

Mouse Sniff Subrating Parameters

_` BlueICE HID SDK User Guide

PS Key USR8 defines the SSR parameters of the keyboard. The SSR parameters define the maximum TX and RX latency. The Sniff Subrating Anchor points are functions of both parameters defined here and the sniff period. PS Key Word Position 0 1 Comments MaxRemoteLatency Reserved MinRemoteTimeout MinLocalTimeout

USR8
2 3 Table 7.7: Mouse SSR Parameters

7.2.6

Pushbutton

The user interacts with the host module using button presses. PS Key Value Hexadecimal Integer between 0x0000 and 0x000e or Description Indicates the number of the PIO line connected to the pushbutton. If the most significant bit is set, the pushbutton is sampled as active low.

USR12

0x8000 and 0x800e


Table 7.8: Pushbutton Configuration

7.2.7

HCI Mode Status Indicator Pulse Sequences

The host module firmware can indicate the Bluetooth radio status by driving user-defined logic pulse sequences on the selected status indicator PIO when the host module is in HCI mode. BlueCore repeats the pulse sequence as specified until the radio state changes. Normally the selected status indicator PIO is used to drive an LED. Pulse sequences consist of a series of pulses repeated at regular intervals. The designer specifies:

On duration for the pulse Off duration for the pulse Number of pulses in the sequence Period for sequence

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 25 of 52

Setting Up Host Module

Radio State Usage Word Position

Unit

Value

Description Indicates the status indicator should be inactive while in this radio state. Number of 128ms intervals indicates the status indicator should be active for each pulse while in this radio state. Indicates the status indicator should be continuously active while in this radio state. Indicates the status indicator should be inactive while in this radio state. Number of 128ms intervals indicates the status indicator should be inactive for each pulse while in this radio state. Indicates the status indicator should be inactive while in this radio state. Indicates the number of pulses that should occur for each cycle while in this radio state. Indicates the time delay between pulse sequences while in this radio state.

0x0000

Pulse On Duration This value is used to indicate 128ms how long the LED is illuminated for each pulse.

0x0001 0x000E 0x000f


-

_` BlueICE HID SDK User Guide

0xffff

0x0000

0x0001
1 Pulse Off Duration 128ms -

0x000e 0x000f
-

0xffff 0x0000
2 Pulse Count 1 pulse -

0x000f 0x0000
3 Period 1s -

0x000f

Table 7.9: HCI Mode Status Indicator Pulse Sequences

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 26 of 52

Setting Up Host Module

PS Key

Word Position 0-3 4-7 8-11

Radio State Idle Inquiry Page Reserved Connected Transferring

State Description Radio has no active connections, is not discoverable, and is not attempting to establish connections. Radio is performing an inquiry operation. Radio is performing a Page operation. Reserved Radio has an active connection to another Bluetooth device Radio is transmitting to or receiving data from another Bluetooth device.

USR15
12-15 16-19 20-23

_` BlueICE HID SDK User Guide

Table 7.10: HCI Mode Status Indicator Operation


Important Note:

PS Key USR15 must be at least 24 words in length, even if some states are not used. See BlueICE Radio State LED Flashing for explanation and examples.

7.2.8

Configuring the HID Device Support Mode

The HID Device Support mode configures the host module to support no device, only a keyboard, only a mouse or both a keyboard and a mouse. PS Key Value Description None Keyboard only Mouse only Both keyboard and mouse

0x0000 0x0001 USR16 0x0002 0x0003

Table 7.11: HID Device Support Mode Configuration

7.3

Initial Boot Mode (HCI or Proxy Mode)

This PS Key determines the mode of the host module; either HID Proxy or HCI mode. HID Proxy mode allows the use of a Bluetooth keyboard and/or mouse without the need to load a Bluetooth host software stack. To use HID Proxy mode, the BlueCore IC must be configured to operate in the HID Proxy mode. HCI mode operates the module as a Bluetooth radio but requires a stack on the host. HID Proxy mode supports only HID devices, such as keyboard and mouse. It does not support audio or other Bluetooth profiles. This section provides the PS Key settings to support HID Proxy mode and HCI mode.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 27 of 52

Setting Up Host Module

PS Key

Value

Description Enables HCI mode Enables HID Proxy mode

0x0000 INITIAL_BOOTMODE 0x0001

Table 7.12: Initial Boot Mode Configuration Additional PS Keys must be set properly for PS Key INITIAL_BOOTMODE to operate like a switch. See the Kymodo_host_generic.psr file in the HID SDK for proper settings.

7.4

Configuration Security

When a BlueCore module is freshly manufactured, this bool flag is set to FALSE. The host can then read and write all Persistent Store values and can run all of the BCCMD commands. This enables the manufacturer to configure the Bluetooth module. In addition, it allows utility tools such as PsTool.exe to access the IC over USB. When the configuration is complete, the manufacturer sets this PS Key to TRUE. This enables the Persistent Store and BCCMD access controls. Once this PS Key is set to TRUE, it cannot be set back to FALSE via BCSP running over BCSP or the HCI extension channel. Setting security active is normally a one-way operation. PS Key Value Description

_` BlueICE HID SDK User Guide

0x0000 BCCMD_SECURITY_ACTIVE 0x0001

FALSE TRUE

Table 7.13: BCCMD Security Configuration

7.5

Host Interface

This PS Key configures the physical connection of the module to the host. For all practical purposes, this key should be set to USB link. Table 7.14 shows other possible values. PS Key Value Description No chip-to-host connection BCSP H2-USB H4-UART VM access to UART H5-UART H4-UART with deep sleep SDIO (virtual UART)

0x0000 0x0001 0x0002 0x0003 HOST_INTERFACE 0x0004 0x0006 0x0007 0x0009

Table 7.14: Host Interface Configuration

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 28 of 52

Setting Up the Device

8
8.1

Setting Up the Device


List of USER PS Keys
Description Enables and defines parameters for Sniff Subrating Configures the class of the HIDs, whether keyboard, mouse, or both (combo)

The device firmware is configured using PS Keys that are accessible from the CSR PSTool utility.

Table 8.1 provides a numerical list of PS Keys described in this section: PS Key

USR0 USR2 USR3 USR5 USR6 USR12 USR16 USR18 USR19 USR20 USR21 USR22 USR23 USR25 USR28 USR29 USR30 USR31

_` BlueICE HID SDK User Guide

Configures the sensor interface, whether Avago First or Second Generation, Pixart or UART Specifies the type of mouse wheel being used and whether the wheel is active Configures the (X,Y) data translation Sets the resolution at which the sensor reports motion Configures the legacy sniff period and legacy power table Configures the sniff period and power table Defines the scan matrix dimensions; row by column Specifies the Bluetooth style language and character encoding Specifies the name of the device Specifies the Service Provider name (device vendor) Provides a short description of the device Specifies the Country Code for devices that might require localisation Configures the USB HID style language Specifies the VID of the device manufacturer Specifies the PID of the device Specifies the devices version number (release number)

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 29 of 52

Setting Up the Device

PS Key

Description Specifies the VID source (the organisation that issued the VID) Sets the PIO configuration Configures the battery monitoring Sets a fixed PIN code Sets the factory test mode Sets keyboard LED mode of operation Table 8.1: List of PS Keys for the Device

USR32 USR33 USR35 USR36 USR37 USR38

_` BlueICE HID SDK User Guide

8.2

Sniff Subrating

PS Key USR0 defines the SSR parameters. The SSR parameters define the maximum TX and RX latency. The Sniff Subrating Anchor points are functions of both parameters defined here and the sniff period. PS Key Word Position 0 1 Comments

0 = Disable 1 = Enable
MaxRemoteLatency Reserved MinRemoteTimeout MinLocalTimeout MinReceiveLatency

USR0

2 3 4 5 Table 8.2: Device SSR Configuration

8.3

Class of Device
Keyboard Mouse Combo device (keyboard with mouse functionality)

The class tells the firmware the type of device on which it is running. The followings are the supported devices:

The PS Key should be set to the HID minor class of the device. Table 8.3 lists PS Key USR2 settings for configuring the class of the HIDs.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 30 of 52

Setting Up the Device

PS Key

Value

Class of Device Keyboard Mouse Combo (keyboard and mouse)

0x0040 USR2 0x0080 0x00c0

Table 8.3: Class of Device Configuration

8.4
Note:

Sensor Interfaces

The following sensor interfaces are supported: UART Avago First Generation Sensor (3-wire serial) Avago Second Generation Sensors (4-wire serial) Pixart PAN3201 or PAW3204

_` BlueICE HID SDK User Guide

Additional sensor interfaces will be supported in the future. Table 8.4 shows the settings for the PS Key USR3 used to configure the sensor interface. PS Key Value Sensor Inteface Avago First Generation UART Scan Matrix (Keyboard) Avago Second Generation Pixart Sensor

1 2 USR3 3 5 9

Table 8.4: Sensor Interface Configuration If UART is selected as the sensor interface, a coprocessor is required to interface with the sensor. The coprocessor sends HID input reports to BlueCore using the UART. See Appendix Section B for information on using the UART as the HID sensor interface. See Appendix Section A for more information about Avago mouse sensors and their interfaces.
Note:

In this document, directly interfacing BlueCore to an Avago sensor means BlueCore controlling the mouse sensor using direct connections between PIOs and the sensor pins as opposed to an intervening external coprocessor. Value 3 is only valid for configuring the keyboard device.

8.5

Idle Disconnect and Sniff Parameter

PS Key USR18 defines the idle-disconnect timeout and the sniff parameter. This key is also called the power table. It is a set of one or more entries. Each entry is 4 words.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 31 of 52

Setting Up the Device

PS Key

Word 0 1

Position Comments Sniff Interval Sniff Attempt Sniff Timeout Entry Timeout

USR18
2 3 Table 8.5: Sniff Table Configuration Where:

_` BlueICE HID SDK User Guide

Sniff Interval is the number of slots that get multiplied always by 6 to determine the sniff interval (for example, if the value is 4, then the Sniff Interval = 4 * 6 = 24 slots = 24 *625s = 15 milliseconds). Refer to the Bluetooth Specification for full explanation of:

Sniff Attempt Sniff Timeout

Entry Timeout is the time spent in this entry before moving to the next entry in the power table. This allows the user to set multiple Sniff Intervals when pairing with a device that is not Bluetooth v2.1-compliant. When pairing with a Bluetooth v2.1-compliant device, only one entry is needed. In addition, the Entry Timeout is used to define the idle-disconnect timeout. For example: Assume you have two entries Power Table and the values of the Entry Timeout fields are 003c and 0078; then the idle-disconnect value = 003c + 0078 = 00b4 = 180seconds. When the device is idle for 180 seconds it disconnects. When it is busy again it reconnects to save power. To disable the idle-disconnect, set the value of Entry Timeout to ffff in the last entry of the Power Table.
Note:

The minimum number for Sniff Interval that you can set is 0002.

8.5.1

Legacy Sniff Interval

Copy PS Key USR18 to PS Key USR16 to prevent the device firmware from pulling back to predefined power table called the legacy Sniff Intervals.

8.6
8.6.1

Programmable I/O
General I/O

PIOs are configurable input and output pins on the BlueCore IC. This section provides information on configuring PIOs for general use, then specifically for a mouse, mouse wheel, Avago sensor and UART sensor.

PS Key USR33 is used to configure the PIO configuration. The following control I/O functions can be associated with, driven by or input to the PIOs:

Connection Status Caps Lock Scroll Lock Num Lock Boot Mode Power Enable Connect Button Battery Charging Test Mode Battery Low As a mask By a value
Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Each I/O is configured by a single word in the PS Key and in one of two ways:

CS-102079-UGP2

Page 32 of 52

Setting Up the Device

In addition to the I/O configuration words, a word can be described as a modifier. A modifier is used to modify the configuration of a specific I/O. Each I/O is described separately. Table 8.6 provides the settings for PS Key USR33 used to configure a mask I/O: PS Key Value Description This mask I/O is unused. PIO mask; describes which BlueCore PIOs are used for this mask I/O (one-bit each for PIOs [0] to [14]). Single-bit which, when bitwise ORd with the PIO mask, inverts the sense of the I/O (I/Os are normally active high. Setting this bit makes the I/O active low). Table 8.6: PIO Mask Configuration Table 8.7 provides the values to configure a value I/O: PS Key Value Description PIO; the PIO used for this I/O Single-bit which, when bitwise OR'd with the PIO value, inverts the sense of the I/O. I/Os are normally active high. Setting this bit makes the I/O active low. Table 8.7: PIO Value Configuration PS Key Word Position 0 1 2 3 I/O Connection Status Caps Lock Scroll Lock Num Lock Boot Mode Power Enable Connect Status Modifier Battery is Charging Table 8.8: PIO Order of the Configuration Words The Status Modifier modifies the way the connection status is output by the device. If the connection status is nonzero, then a value of 1 in the status modifier tells the firmware to use the AUX DAC as the connection status output. This can be useful in a mouse design where the number of available PIOs is limited. If a status modifier is not used, it must be set to 0xffff. Example PS Key USR33 entry for a keyboard: 8007 0100 0101 0102 0003 0109 000a ffff ffff Connection Status is indicated on PIO[0, 1, 2 ] (from the mask), which are active low. Description Mask Input Modifier -

0x0000 0x0001 to 0x7fff USR33 0x8000

_` BlueICE HID SDK User Guide

0x0000 to 0x000f USR33 0x0100

USR33

4 5 6 7 8

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 33 of 52

Setting Up the Device

Caps Lock, Num Lock and Scroll Lock are indicated on PIO[0, 1, 2] respectively and are active low.
Note:

The same PIOs are used for Caps Lock, Num Lock and Scroll Lock indication as connection status indication. Boot Mode is on PIO[3]. Power Enable is indicated on PIO[9] and is active low. This means in normal operation, this PIO is driven low. When a battery is in a critically low condition, (for example, the battery empty level is reached), the PIO drives high. This can be used to disable a power supply regulator on the device if the battery voltage is dangerously low. The Connect Button is attached to PIO[10]. Use the Connect Button to make the device discoverable. The Status Modifier is unused, and does not modify the connection status I/O configuration. The Battery is Charging I/O is unused. In this configuration, the battery status report always indicates that the devices battery is not being charged. If this IO is configured, then its PIO should be pulled high to indicate that the devices battery is being charged. When the firmware is told the battery is charging, it will not disconnect from its host after an idle timeout and will respond to host requests for battery information indicating that its battery is being charged.

_` BlueICE HID SDK User Guide

8.6.2

Mouse Button I/O

When the device is a mouse and BlueCore interfaced to an Avago or Pixart sensor, additional I/O set-up is required. This section describes how to configure the mouse button I/O in this case. The mouse button and wheel set-up is common to all sensor configurations. The mouse buttons are configured with PS Key HIDIO_BUTTON. It takes 5 words, which configure the PIOs for buttons 1 through 5. If the button is unused, its configuration word should be set to 0x00ff. In addition to specifying the PIOs used for each mouse button, it is possible to set them active low. This is done by setting the bit corresponding to each PIO low to signify an active low button, or high to signify an active high button in the PS Key PIO_WAKEUP_STATE. PS Key Word Position 0 1 Comments PIO assignment for mouse button 1 PIO assignment for mouse button 2 PIO assignment for mouse button 3 PIO assignment for mouse button 4 PIO assignment for mouse button 5 Table 8.9: Mouse Button I/O PS Key Example PS Key HIDIO_BUTTON assignments entry: 0002 0007 0004 00ff 00ff This entry is used if mouse button 1 is connected to PIO[2]; button 2 connected to PIO[7]; button 3 connected to PIO[4]; with no other buttons connected (for example, a 3-button mouse).
Note:

HIDIO_BUTTON

2 3 4

if the device is a keyboard, set all the words to 0x00ff.

8.6.3

Mouse Wheel I/O

When the device is a mouse and BlueCore is directly interfaced to an Avago sensor, additional I/O set-up is required. This section describes how to configure the mouse wheel I/O in this case. The mouse wheel is configured with two PS Keys, PS Key HIDIO_WHEEL and PS Key USR5. PS Key HIDIO_WHEEL takes three words which configure the PIOs to use for Quad A input, Quad B input and the Wheel Enable output. It is also possible to use the BlueCore RTS pin as Wheel Enable, freeing up a PIO. In which case, the Wheel Enable configuration word should be set to 0xFD.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 34 of 52

Setting Up the Device

For the mouse buttons in Section 8.6.2, the sense of the mouse wheel Quad A and Quad B inputs can be set active high or low by setting the bit corresponding to each PIO low to signify an active low Quad input or high to signify an active high Quad input in the PS Key PIO_WAKEUP_STATE. PS Key Word Position 0 1 Comments PIO assignment for mouse wheel Quad A input PIO assignment for mouse wheel Quad B input PIO assignment for mouse wheel enable output Can be set to 0xFD to use RTS pin

HIDIO_WHEEL

_` BlueICE HID SDK User Guide

Table 8.10: Mouse Wheel I/O PS Key Use the PS Key USR5 to specify the type of mouse wheel being used, and whether the Wheel Enable is active high or low. A single word specifies the wheel type. Setting the most significant bit of the word to 1 (for example, by ORing with 0x8000) specifies that Wheel Enable is active low. PS Key Value Comments

0x0000 (or 0x8000 for active low Denotes a full-quadrature wheel is being used Wheel Enable) USR5 0x0001 (or 0x8001 for active low Denotes a half-quadrature type 1 wheel is being used Wheel Enable) 0x0002 (or 0x8002 for active low Denotes a half-quadrature type 2 wheel is being used Wheel Enable)
Table 8.11: Wheel Quadrature Configuration If the type of wheel being used is not known, CSR recommends trying each of the above settings and settling the one that gives the best wheel performance.

8.6.4

Avago First Generation Sensor Interface I/O

When the device is a mouse and the sensor interface selected is Avago First Generation, the sensor interface itself needs to be configured. This involves setting PS Key HIDIO_AGILENT to specify the PIOs used for the SDIO, SCLK and PD lines. See Section 8.2 for more information on supported sensors interfaces. PS Key Word Position 0 1 2 Comments PIO assignment for Avago First Generation interface SDIO line PIO assignment for Avago First Generation interface SCLK line PIO assignment for Avago First Generation interface PD line

HIDIO_AGILENT

Table 8.12: Avago First Sensor Interface I/O Configuration

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 35 of 52

Setting Up the Device

8.6.5

Avago Second Generation Sensor Interface I/O

When the device is a mouse and the sensor interface selected is Avago Second Generation, the sensor interface itself needs to be configured. This involves setting PS Key HIDIO_AGILENT_SP2 to specify the PIOs used for the SCLK, MOSI, MISO, NCS, MOT (optional) and STDWN (optional) lines. See section 8.2 for more information on supported sensors. PS Key Word Position 0 1 2 Comments PIO assignment for Avago Second Generation interface SCLK line PIO assignment for Avago Second Generation interface MOSI line PIO assignment for Avago Second Generation interface MISO line PIO assignment for Avago Second Generation interface NCS line PIO assignment for Avago Second Generation interface MOT line (set to 0xff if unused) PIO assignment for Avago Second Generation interface STDWN line (set to 0xff if unused)

_` BlueICE HID SDK User Guide

HIDIO_AGILENT_SP2

Table 8.13: Avago Second Sensor Interface Configuration

8.6.6

Pixart Sensor Interface I/O

When the device is a mouse and the sensor interface selected is Pixart, the sensor interface must be configured. This involves setting PS Key HIDIO_PIXART to specify the PIOs used for the SDIO, SCLK, PD and SWKINT lines. PS Key Word Position 0 1 Reference PIO assignment for Pixart interface SDIO line PIO assignment for Pixart interface SCLK line PIO assignment for Pixart interface PD line. Set to 0x10 if PD is not connected PIO assignment for Pixart interface SWKINT line. Set to 0x10 if SWKINT is not connected

HIDIO_PIXART
2

Table 8.14: Pixart Sensor Interface I/O Configuration

8.7

UART Sensor Interface

For the low power mode to be enabled on a BlueCore when the UART is used as the sensor interface, use flow control. Flow control is necessary to avoid HID report loss across the UART when the BlueCore is in low power mode. The flow control scheme gives an indication to the co-processor when BlueCore is awake and ready to receive HID reports over the UART.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 36 of 52

Setting Up the Device

Successful UART flow control reduces power consumption and latency in a device. See Section B for details of the UART flow control scheme and report format. This section describes the necessary Persistent Store configuration required for using the BlueCore UART as the sensor interface. PS Key Value 9.6kbaud to 3686.4kbaud VM access to UART Comments Actual value in the PS Key is calculated as: value = baud_rate* 0.004096 Allows the virtual machine access to the UART

BAUDRATE

HOST_INTERFACE

_` BlueICE HID SDK User Guide

DEEP_SLEEP_PIO_WAKE

0 to 15

Wake PIO PIO assignment for the UART flow control asynchronous line input to BlueCore Polling PIO PIO assignment for the UART flow control synchronous line output from BlueCore

HIDIO_UART

0 to 15

Table 8.15: UART as Sensor Interface Configuration

8.8

Sensor XY Translation Configuration

When the device is a mouse then additional configuration options are available and may be required. These options are to configure the (X,Y) translation of the motion data acquired from the sensor and the resolution at which the sensor reports motion. (X,Y) translation can be modified by setting a single word in PS Key USR6. The word is a field of 3 bits, specifying whether to invert either the X or Y data, or to swap the X and Y data. The X, Y swap is performed before inverting the X and/or Y data. PS Key Bit Position Within Single Word 0 Comments Inverts X data when set to 1 Inverts Y data when set to 1 Swaps X and Y data when set to 1

USR6

1 2

Table 8.16: Avago Sensor XY Translation Configuration As an example, setting PS Key USR6 to 0x0005 swaps the X and Y data, then inverts X.

8.9

Sensor Resolution Configuration

The resolution at which the sensor reports motion can be set with a single word in PS Key USR12. With no word in this PS Key, the resolution defaults to 1 (500 cpi)

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 37 of 52

Setting Up the Device

PS Key

Value

Comments 400 cpi 500 cpi 600 cpi 800 cpi 1000 cpi 1200 cpi 1600 cpi

0x0000 0x0001 0x0002 USR12 0x0003 0x0004 0x0005 0x0006

_` BlueICE HID SDK User Guide

Table 8.17: Sensor Resolution Configuration


Note:

Not all settings are valid for every sensor. Refer to the sensor data sheet to set the resolution properly.

8.10

Avago Laser Sensor

When the device is a mouse, the sensor interface selected is Avago Second Generation and the sensor used is an Avago 60x0 or 70x0, additional configuration is required. Laser calibration is needed to comply with Class 1 laser power regulations. Use PS Key HIDIO_AVAGO_LASER_CONFIG to configure the laser. This PS Key enables you to write to the LASER_CTRL0 and LSRPWR_CFG0 sensor registers according to Table 8.18. The firmware writes the inverted values to LASER_CTRL1 and LSRPWR_CFG1 respectively. See the relevant Avago datasheet for more information about Avago laser sensor registers and calibrating the laser power. PS Key Word Position 0 Comments 8-bit value to write to the Avago laser sensors LASER_CTRL0 register 8-bit value to write to the Avago laser sensors LSRPWR_CFG0 register

HIDIO_AVAGO_LASER_CONFIG
1

Table 8.18: Avago Laser Sensor Configuration

8.11

Pixart Additional Configurations

Additional configuration for the Pixart sensor for Power Saving, the SWKINT behaviour and the minimum lapse time before the registers are accessed after power down.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 38 of 52

Setting Up the Device

PS Key

Bit Position Within Single Word

Comments Non-zero to enable sensor controlled power down; zero to disable sensor control and allows BlueCore to save power Non-zero to enable pulses on the SWKINT line; Zero to make the SWKINT line level instead of pulses

HIDIO_PIXART_CONFIG

_` BlueICE HID SDK User Guide

Minimum time (in ms) after the sensor is woken from power down before its registers are accessed.

Table 8.19: Pixart Additional Configuration Example values for HIDIO_PIXART_CONFIG are 0001 0000 0003.

Sensor controlled power saving = 0001 SWKINT level behaviour= 0000 3ms delay before accessing the registers after wake up from power down

8.12

Battery Monitoring

The BlueICE firmware can be set up to sample the devices battery voltage and convey a battery percentage reading to the host using a vendor specific HID feature report. This section describes the configuration necessary for battery monitoring. PS Key USR35 is used to set up battery monitoring and takes the following parameters in successive words:

Sampling source Sampling period Voltage at 100% Voltage at 75% Voltage at 50% Voltage at 25% Danger voltage (below which an indication is given that the battery is low) Voltage at empty Battery hysteresis Battery power divider Battery power report page selections

Battery hysteresis is a value period applied to a raw battery reading to filter out small but frequent fluctuation in voltage reading. Battery divider is a multiplication factor to be applied to the ADC readout at the sampling source to obtain the actual battery voltage. Power report page is to select which HID Usage Page to use when reporting battery power: the CSR vendor-defined consumer device page or the standard HID Power Device page.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 39 of 52

Setting Up the Device

Word Position in PS Key USR35

Value

Comments

0 => battery monitoring disabled 1 => AIO0


0

2 => AIO1 3 => VDD 4 => AIO2 5 => AIO3 (only on some
IC variants) 6=> internal monitor (only on some IC variants)

The analogue source from which to acquire the battery voltage reading. If it is 0, the battery monitoring is disabled (battery reading is not communicated to the host).

_` BlueICE HID SDK User Guide

0 to 60

The battery voltage sampling period in seconds. A value of 0 samples the battery voltage once, and only once, while the firmware is booting. The voltage at the specified analogue source (1) when the battery is at 100%. The voltage at the specified analogue source when the battery is at 75%. The voltage at the specified analogue source when the battery is at 50%. The voltage at the specified analogue source when the battery is at 25%. The voltage at the specified analogue source when the battery is at or below the danger level (2). The voltage at the specified analogue source when the battery is empty (3). Battery hysteresis value. Default to 0 for no hysteresis to apply. Battery divider given in tenths. Defaults to 25 (for example, the battery voltage is divided by 25/10 = 2.5 before being input to an AIO pin). HID Usage page selection for battery power report. 0 = Vendor-defined consumer device power page (default) non-zero = HID Power Device page

2 3 4 5 6 7 8

0 to VDD (mV) 0 to VDD (mV) 0 to VDD (mV) 0 to VDD (mV) 0 to VDD (mV) 0 to VDD (mV) 0 to VDD (mV)

0 to 0xff (unsigned)

10

0 or non-zero

Table 8.20: Battery Monitoring Configuration

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 40 of 52

Setting Up the Device

As an example, the following words in PS Key USR35 indicate a battery sampling configuration using analogue source AIO1 at a sampling interval of 3 seconds. Voltage level at:

100% = 1500mV 75% = 1275mV 50% = 1050mV 25% = 825mV Danger = 750mV Empty = 600mV

The battery hysteresis is 20mV and the battery divider is 3.2. The battery power report is set to use the vendordefined consumer device power page (the default, as the word is not set):

0002 0003 05dc 04fb 041a 0339 02ee 0258 0014 0020 0000
Note:

_` BlueICE HID SDK User Guide

1. 2. 3.

Voltage at the analogue source means the voltage presented at an AIO pin, for example. This does not take into account any potential divider or other circuitry external to the IC which may divide down the actual battery voltage. Danger level means the voltage at which the firmware indicates a low battery. The empty battery voltage level should be the minimum battery voltage at which the device can operate. Typically this is the minimum operating input voltage of the devices voltage regulator(s), scaled by any external potential divider.

8.13

PIN Code (or Passcode)

A BlueICE device can be configured to have a fixed PIN code or to have no-fixed PIN code. If a fixed PIN code is used, this is always used during authentication with a device that does not support Bluetooth v2.1. If no fixed PIN code is used, some method of entering the PIN code during authentication is required on the device. On a keyboard, the number keys can be used to enter the PIN code. The PIN code is configured with PS Key USR36. The first word specifies the length in bytes of the PIN code. The subsequent words specify the PIN code with two bytes packed into each word big-endian. The PIN code bytes are specified as ASCII codes. Word Position in PS Key USR36 0 1 to 8 Value Comments The length of the PIN code. 0 is special and denotes no PIN code. The high byte of a word comes first, followed by the low byte.

0 to 16
2 ASCII bytes packed into a word big-endian Table 8.21: PIN Code Configuration

As an example, to give the device a fixed PIN code of 1234, the entry for PS Key USR36 is

0004 3132 3334.


The BT HID specification recommended default is a PIN code of 0000. To implement this, the entry for PS Key USR36 is 0004 3030 3030.

8.14
8.14.1

HID Service Discovery Protocol Record Configuration


String Language and Encoding

The BlueICE device presents a HID SDP record to its Bluetooth host. Several of the parameters of the record are configurable using PS Keys. This section describes the PS Keys to configure HID SDP.

The BlueICE devices implementation of the HID Profile Specification allows a single language to be used for the strings in the HID SDP record (and those in the DI SDP record). The HID Profile Specification contains parts from the Bluetooth specification and USB HID specification, which implement language encoding differently. Therefore, two different codes are required in the HID SDP record to represent the single language of the strings in the record. The default language is US English.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 41 of 52

Setting Up the Device

The character encoding of the strings can also be specified. The HID Profile Specification recommends using UTF-8 as the character encoding, which is the default for the BlueICE device. PS Key USR20 is used to specify the Bluetooth style language and character encoding. It contains two words, both of which are optional. The first word contains the string language encoded according to ISO 639:1988 (E/F): Code for the representation of names of languages, which is further encoded in ASCII (or equivalent UTF-8). The two bytes are packed into one word big-endian. The second word contains the string character encoding. Values for the character encoding are on the IANA website: www.iana.org/assignments/character-sets. If the character encoding word is not present in PS Key USR20, the default of UTF-8 is used. If both the language and character encoding are not present, the defaults of English and UTF-8 are used. An example of a PS Key USR20 entry specifying English and UTF-8 as the string language and character encoding (default) is 656e 006a.

_` BlueICE HID SDK User Guide

PS Key

Word Position 0

Description Bluetooth style string language encoding (defaults to English). Two bytes packed into one word big-endian. String character encoding (defaults to UTF-8).

USR20
1

Table 8.22: String Language and Encoding Configuration PS Key USR28 is used to specify the USB HID style language. It contains one word encoded according to the USB LANGIDs specification. See www.usb.org/developers/docs/USB_LANGIDs.pdf If no value is present in PS Key USR28, the default of US English is used. As an example, PS Key USR28 entry of 0409 specifies US English as the string language: PS Key Description One word specifying the USB HID style string language encoding. Defaults to US English. Table 8.23: String Language and Encoding Configuration

USR28

8.14.2

Service Name

Service Name is the name of the device. It is specified as a string in PS Key USR21. HID SDP record strings are specified as bytes packed into words little endian. Strings containing an odd number of bytes must be zero extended with one additional byte to an even byte length. The format is the same as for the PS Key DEVICE_NAME. Although the maximum length restriction of DEVICE_NAME does not hold, it is advisable to keep text strings as short as possible due to tight memory restrictions. Strings cannot contain embedded zero bytes, and hence the character encoding needs to be chosen appropriately. PS Key Description Little-endian byte packed string specifying the devices name. Table 8.24: Service Name Configuration Example PS Key USR21 entry specifying a Service Name of KYE N11 mouse in UTF-8 encoding is 594b 2045 314e 2031 6f6d 7375 0065.

USR21

8.14.3

Service Provider

Service Provider is the device vendor. It is specified as a string in PS Key USR22. See Table 8.25 for details on the required format for the data for PS Key USR22.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 42 of 52

Setting Up the Device

PS Key

Description Little-endian byte packed string specifying the devices vendor. Table 8.25: Service Provider Configuration

USR22

Example PS Key USR22 entry specifying a Service Provider of CSR in UTF-8 encoding is 5343 0052.

8.14.4

Service Description

Service Description gives a short description of the device. It is specified as a string in PS Key USR23. See Table 8.26 for details on the required format of the data for PS Key USR23.

_` BlueICE HID SDK User Guide

PS Key

Description Little endian byte packed string specifying a short description of the device Table 8.26: Service Description Configuration

USR23

Example PS Key USR23 entry specifying a Service Description for a mouse in UTF-8 encoding is: 2041 6f4d 7375 0065.

8.14.5

Country Code

A specific Country Code may be required for some types of devices that require localisation. Country Code could be used, for example, to specify the language of the codes on the keycaps of a keyboard, but this is not required. If not specified, the default of not localised is used. PS Key USR25 specifies Country Code. It is a single 8-bit number encoded according to the country code list in the USB HID Specification v1.11. PS Key Description 8-bit number representing the country code of the device. Defaults to 0 or not localised. Table 8.27: Country Code Configuration

USR25

8.15
8.15.1

Device Identification SDP Record Configuration


Vendor ID and Source

The BlueICE device presents a device identification SDP record to its Bluetooth host. Several of the parameters of the record are configurable using PS Keys. This section describes the PS Keys to configure this SDP record.

The VID of the manufacturer of the device can be specified using PS Key USR29. The source of the VID can be specified using PS Key USR32. The VID source (the organisation that issued the VID) can be specified using PS Key USR32. The format for this key conforms to the Bluetooth Device ID Specification, namely a value of 0001 specifies a Bluetooth SIG assigned VID, a value of 0x0002 specifies a USB-IF assigned VID.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 43 of 52

Setting Up the Device

PS Key

Value

Comments Devices VID 0xffff is reserved to mean no device identification record is present on the device Devices VID source

USR29

0x0000 to 0xfffe

USR32

0x0001 or 0x0002

Table 8.28: Vendor ID and Source Configuration

8.15.2

Product ID

The product ID of the device is intended to differentiate between different products manufactured by the same vendor, and can be specified with PS Key USR30. PS Key Value Comments Devices PID

_` BlueICE HID SDK User Guide

USR30

0x0000 to 0xffff
Table 8.29: Product ID Configuration

8.15.3

Version

The devices version identifies the release number for a given product and vendor ID pair. The Bluetooth Device ID Specification requires that a BCD number be in the form of 0xJJMN which signifies a version number JJ.M.N. Further recommendations can be found in the aforementioned specification. The version can be specified in PS Key USR31. If PS Key USR31 is not present, the BlueICE device firmware version number is used as the version number in the Device ID SDP record. PS Key Value Comments Devices release number

USR31

0x0000 to 0xffff
Table 8.30: Version Configuration

8.16

Factory Test Mode

The device firmware includes a factory test mode. This can be used to give more control over the device when performing production tests on an entire device. Factory mode capable can only be configured using a PS Key. The in-factory state can be enabled either by a PS Key or, if factory mode capable, using a long connect button press at power on. The in-factory state is lost after a long button press or after a 12-hour timeout (for devices that ship with batteries installed and power enabled). Configure the factory test mode using PS Key USR37. It contains up to 2 words. If the first word is present and nonzero, then the device is factory mode capable. If the device is factory mode capable and the second word is present and non-zero, then the in factory state is entered at power up. Word Position in PS Key USR37 0 Value zero or non-zero Comments Non-zero to make device factory mode capable Non-zero to put device in in factory state (requires the device to be factory mode capable)

zero or non-zero

Table 8.31: Factory Test Mode Configuration


Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

CS-102079-UGP2

Page 44 of 52

Setting Up the Device

8.17
8.17.1

Extra Keyboard Configuration


Scan Matrix Dimensions

This section is relevant to a keyboard device.

The default for the keyboard scan matrix dimension is 18 rows by 8 columns. To change dimensions, define the key as: PS Key Word Position 0 Comments Row dimension Column dimension

USR19
1

_` BlueICE HID SDK User Guide

Table 8.32: Scan Matrix Dimension Configuration The maximum number of rows is 19 and the maximum number of columns is 8.

8.17.2

Keyboard LED Behaviour

You can configure the behaviour of the keyboard LEDs (Caps, Num Lock and Scroll) when connected to two modes. The two modes are based on either LED state change or keyboard activities. When in state change mode, the LED turns off following a timeout period after the user changes the state of the LED (such as pressing the Num Lock key on). When in keyboard activities mode, the LED turns off following a timeout period after the user stops typing. The LED turn on after the user starts typing. PS Key Word Position Value Comments LED-OFF timeout based on LED state changes LED-OFF timeout based on keyboard activities Reserved Timeout in seconds Reserved

0x0000
0

0x0001 0x0002 to 0xffff 0x0001 to 0xffff

USR38

0x0000
Table 8.33: Keyboard LED Behaviour Configuration If the key is not defined, the LED's behaviour reflects the state of the key:

Num Lock pressed = LED-ON always Num Lock depressed = LED-OFF

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 45 of 52

Document References

Document References
Reference CS-115945-DC v1.0 v1.0 CS-102077-UG v1.11

Document

BlueICE Radio State LED Flashing Bluetooth Device Identification Specification Bluetooth HID Profile Specification Casira User Guide USB HID Specification

_` BlueICE HID SDK User Guide

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 46 of 52

Avago Mouse Sensors

Appendix A

Avago Mouse Sensors

This section provides more information on the Avago mouse sensors that can directly interface to BlueCore. To interface to BlueCore, the supported sensor interfaces are in these two categories: First Generation serial interface Second Generation serial interface

The First and Second Generation terminology pertains to this document and may or may not agree with the Avago documentation. The interface sensors described here are those intended for low-power wireless applications. There may be other available interface sensors that BlueCore can use, but do not exhibit the low-power features of those described here. The following sections describe the supported Avago mouse interface sensors and some basic information regarding PIO connections.

_` BlueICE HID SDK User Guide

A.1
Sensor

Avago First Generation Sensor


Light source LED Table A.1: Avago First Generation Sensor

ADNS-2030

The first generation interface has 3 wire connections between BlueCore and the sensor:

SDIO SCLK PD

A.2
Sensor

Avago Second Generation Sensors


Light Source LED LED Laser Laser Additional Wire Connections MOTION, SHTDWN NRESET MOTION MOTION

ADNS-3040 ADNS-5030 ADNS-6030 ADNS-7050

Table A.2: Avago Second Generation Sensors The Second Generation interface has 4-, 5- or 6-wire connections between BlueCore and the sensor, depending on the configuration and sensor type. The four wires common to all sensors are:

NCS SCLK MOSI MISO

These are the SPI chip select, clock and data wires, respectively. Table A.3 describes additional interface pins that are present on certain sensors. Connecting them is either optional or mandatory.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 47 of 52

Avago Mouse Sensors

Pin MOTION

Optional/ Mandatory Optional

Description Input to BlueCore. Active when sensor has unread motion data. If unconnected, BlueCore firmware polls the sensor for motion data. Output from BlueCore. Used to put sensor into shutdown mode. If unconnected, the sensor is placed into its lowest power rest mode instead of the shutdown mode. Output from BlueCore. Used to perform hardware power on and reset of the sensor. Mandatory when fitted sensor requires a hardware reset. Reset could be performed at power up by some other means, making this connection unnecessary and freeing up a PIO.

SHTDWN

Optional

NRESET

Mandatory

_` BlueICE HID SDK User Guide

Table A.3: Interface Pins for Other Sensors The PIOs used for the wire connections between BlueCore and the sensor are specified using PS Key HIDIO_AGILENT_SP2. Unconnected optional wire connections are specified in the PS Key as 0x00ff.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 48 of 52

Appendix B Using UART as HID Sensor Interface

Appendix B

Appendix B Using UART as HID Sensor Interface

The BlueICE device can be configured to use BlueCores UART to receive pre-assembled HID report packets from an external microprocessor. The external microprocessor is responsible for assembling reports and sending them to BlueCore according to the flow control scheme described in this section. Use of the UART as the devices sensor interface is independent of the type of the device. As examples, the external microprocessor can be used to perform key matrix scanning for a keyboard or to interface with an optical mouse sensor. The UART should be considered as a sensor interface when it is not possible for the required functions to be implemented without an external microprocessor. This can be implementing a mouse with an optical sensor not yet supported by the BlueICE device firmware or performing matrix scanning functions that are not yet available in the firmware. It is usually advantageous to avoid the need for an external microprocessor on the grounds of cost and current consumption. Regarding current consumption, if BlueCore is interfaced directly to a mouse sensor, for example, it can tightly control the power-saving mode of the sensor and minimise current consumption in a wide range of configurations. The following sections describe the UART report format and UART flow control mechanism.

_` BlueICE HID SDK User Guide

B.1
Byte

UART HID Report Format


Description Length of packet in bytes Type of packet: 0 Forward HID Report HID Report including header Table B.1: UART Report Format

HID reports sent to BlueCore over the UART must conform to the following format:

0 (first byte in packet) 1 2 to N

The BlueICE built-in keyboard descriptor, report ID 1, conforms to the Boot Protocol Specification. This is the recommended format for standard keyboard keystrokes, as the keyboard can then be used with USB hosts that only support boot protocol when the host module is in HID Proxy mode, such as for keyboard entry to enter and configure a PCs BIOS. Table B.2 describes the required UART HID report ID 1 format: Byte 0 (first byte in packet) 1 2 3 4 5 Value Description Length of packet in bytes (12) Type of packet: Forward HID Report HID Input Report Header Keyboard Report ID 1 Modifier Keys Reserved

0x0c 0x00 0xa1 0x01 0x00 to 0xff 0x00

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 49 of 52

Appendix B Using UART as HID Sensor Interface

Byte 6 7 8 9 10 11

Value

Description Keycode 1 Keycode 2 Keycode 3 Keycode 4 Keycode 5 Keycode 6

0x00 to 0xff 0x00 to 0xff 0x00 to 0xff 0x00 to 0xff 0x00 to 0xff 0x00 to 0xff

_` BlueICE HID SDK User Guide

Table B.2: UART HID Report ID 1 Format The BlueICE built-in pointer (mouse) descriptor, report ID 2, also conforms to the Boot Protocol Specification. Table B.3 identifies the format to which the Pointer reports sent to BlueCore over the UART must conform: Byte 0 (first byte in packet) 1 2 3 4 Value Description Length of packet in bytes (8) Type of packet: Forward HID Report HID Input Report Header Keyboard Report ID 2 Up to 5 buttons, one bit each Delta X Number between -127 and +127 representing the change in mouse movement on the x-axis Delta Y Number between -127 and +127 representing the change in mouse movement on the y-axis Wheel movement Number between -127 and +127 representing the amount of wheel movement

0x08 0x00 0xa1 0x02 0x00 to 0x1f 0x00 to 0xff

0x00 to 0xff

0x00 to 0xff

Table B.3: Pointer Report Format

B.2

UART Flow Control

Use this flow control scheme to achieve the optimum combination of the lowest latency and the lowest power consumption in a BlueICE-based HID using the UART as the sensor interface. The flow control scheme allows BlueCore to enter a low power mode as often and for as long as possible to minimise current consumption while allowing the external microprocessor to wake BlueCore and send a HID report with minimal latency. Following this scheme (particularly its timings), no UART HID reports will be dropped because BlueCore is in deep sleep. There are two methods an external microprocessor can use to send HID reports to BlueCore over the UART:

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 50 of 52

Appendix B Using UART as HID Sensor Interface

Synchronous With this method, BlueCore asserts a PIO to poll the external microprocessor a short time before each sniff interval or sample rate. After detecting this PIO going high, the external microprocessor may immediately start transmitting a HID report(s). The polling pulse is guaranteed to be at least 5ms in width. The external microprocessor should aim to have sent a complete packet 3ms after the beginning of the polling period to make sure an attempt is made to transmit it during the sniff interval. See Figure B.1 for a diagram of the synchronous flow control timings. Asynchronous With this asynchronous data transfer method, the external microprocessor can change the BlueCore from a low power mode to send a packet at any time. This allows for minimal buffering in the external microprocessor. To perform an asynchronous HID report transfer over the UART, the external microprocessor first sends the wake PIO high. The external microprocessor must then wait at least 10ms to allow BlueCore to reach its fully awake state before starting to transmit a HID report(s). After packet transmission is completed, the external microprocessor sends the wake PIO low again. See Figure B.2 for a diagram of the asynchronous flow control timings.

_` BlueICE HID SDK User Guide

Figure B.1: Synchronous UART Data Transfer

Figure B.2: Asynchronous UART Data Transfer A good flow control implementation should use both synchronous and asynchronous transfer methods. With data available to send, the suggested protocol is for the external microprocessor to wait a timeout period for a synchronous transfer opportunity. If the opportunity does not arise before the timeout, then the external microprocessor should perform an asynchronous transfer. The timeout period depends on the space available in the external microprocessors UART transmit buffer; 50ms is a suggested timeout period. Synchronous and asynchronous data transfer periods can overlap. This allows the external microprocessor to extend the synchronous transfer period by raising the wake PIO while the polling PIO is high. In this case, the external microprocessor can send data immediately after raising the wake PIO, as BlueCore is already awake.

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 51 of 52

Terms and Definitions

Terms and Definitions


Term BCCMD BCSP BIOS BlueCore BlueICE BlueFlash BlueLab BlueSuite Bluetooth Casira CSR HCI HID I/O IEEE LANGID LED OEM OS PC PDA PID PIN PIO PS Key PSTool RX SDK SDP SIG SPI SSR TX UART USB VID VM Definition BlueCore Command BlueCore Serial Protocol Basic Input Output System Group term for CSRs range of Bluetooth wireless technology ICs BlueCore Input Connection Enhancement Software for programming BlueCores associated flash device CSRs development toolset for building applications to run in the firmwares VM

_` BlueICE HID SDK User Guide

BlueCore family of software utilities for Bluetooth evaluation and development Set of technologies providing audio and data transfer over short-range radio connections Bluetooth development hardware from CSR Cambridge Silicon Radio Host Controller Interface Human Interface Device Input/Output Institute of Electronic and Electrical Engineers Language Identifiers Light-Emitting Diode Original End Manufacturer Operating System Personal Computer Personal Digital Assistant Product ID used to identify USB devices Personal Identification Number Parallel Input Output Persistent Store Key BlueSuite utility Receive or Receiver Software Development Kit Service Discovery Protocol; element of Bluetooth (Bluetooth) Special Interest Group Serial Peripheral Interface Sniff Sub-Rating Transmit or Transmitter Universal Asynchronous Receiver Transmitter Universal Serial Bus Vendor ID used to identify USB devices Virtual Machine

CS-102079-UGP2

Cambridge Silicon Radio Limited 2006-2008 This material is subject to CSR's non-disclosure agreement

Page 52 of 52

You might also like