Infineon / mtb-examples-CYW920820EVB-02-btsdk-hid

HID Examples
Other
1 stars 0 forks source link

HID Examples

This application group demonstrates Human Interface Devices. Applications included are:

Each app directory has a read_me.txt file which provides details of the application and usage.

Supported board

These apps are meant for the WICED BT board name mentioned in the name of the app repo. Every board may not support all apps listed above.

wiced_btsdk

Folder structure

All BTSDK code examples need 'wiced_btsdk' repo to build and test the apps. 'wiced_btsdk' includes the 'dev-kit' and 'tools' folders:

dev-kit

This folder contains the files that are needed to build the embedded BT apps.

tools

This folder contains tools and utilities need to test the embedded BT apps.

See README.md in the sub folders for more information.

Building code examples

Using the ModusToolbox IDE

  1. Install ModusToolbox 2.1
  2. In the ModusToolbox IDE, click the New Application link in the Quick Panel (or, use File > New > ModusToolbox IDE Application).
  3. Pick your board for BTSDK.
  4. First select 'wiced_btsdk'. This project contains the SDK. It is used by all BTSDK applications. You will need to create this project just once in the working directory (i.e. Eclipse workspace).
    Note: Do not change the name of this project. All BTSDK apps use this project name in application makefiles.
  5. After the 'wiced_btsdk' project is created, click the New Application link again, and select the board and application you want to use.
  6. Select the application in the IDE. In the Quick Panel, select Build to build the application.
  7. To program the board (download the application), select Program in the Quick Panel.

Using command line

  1. Install ModusToolbox 2.1
  2. On Windows, use Cygwin from \ModusToolbox\tools_2.1\modus-shell\Cygwin.bat to build apps.
  3. git clone 'wiced_btsdk' repo first. As mentioned earlier, this project contains the SDK used by all apps. You will need to create this project just once in the working directory. For example:

    git clone https://github.com/cypresssemiconductorco/wiced_btsdk

  4. git clone the BTSDK app repo [ mtb-examples-(board)-btsdk-(type) ]. The application repo directory should be at the same folder level as 'wiced_btsdk'. For example:

    git clone https://github.com/cypresssemiconductorco/mtb-examples-CYW920819EVB-02-btsdk-hid

  5. The 'wiced_btsdk' repo contains references to other repos. To download all the required collateral, cd to root folder and use 'make getlibs'. For example:

    cd wiced_btsdk
    make getlibs

  6. To build the app call make build. For example:

    cd ../mtb-examples-CYW920819EVB-02-btsdk-hid
    cd hid/ble_mouse/
    make build

  7. To program (download to) the board, call:

    make qprogram

  8. To build and program (download to) the board, call:

    make program

    Note: make program = make build + make qprogram

ModusToolbox Tools

Tools installed by ModusToolbox installer:

SDK software features

List of boards available for use with BTSDK

Application settings

Application settings below can configured via makefile of the application or passed in via command line. Options below are available for all applications. Other application specific options might also be available and are documented in the read_me.txt for those applications.

Downloading an application to a board

If you have issues downloading to the board, follow the steps below:

Note, this is only applicable to boards that download application images to FLASH storage. Boards that only support RAM download (DIRECT_LOAD) such as CYW9M2BASE-43012BT can be power cycled to boot from ROM.

Using BSP (platforms)

All BSPs supported by BTSDK can be found in the \wiced_btsdk\dev-kit\bsp\ folder.

a. Selecting an alternative BSP

The application makefile has a default BSP. See "TARGET". The makefile also has a list of other BSPs supported by the application. See "SUPPORTED_TARGETS". To select an alternative BSP, set TARGET as one of the supported BSPs.

b. Custom BSP

Complete BSP

To create and use a complete custom BSP that you want to use in applications, perform the following steps:

  1. Select an existing BSP you wish to use as a template from the list of supported BSPs in the \wiced_btsdk\dev-kit\bsp\ folder.

  2. Make a copy in the same folder and rename it. For example \wiced_btsdk\dev-kit\bsp\TARGET_mybsp.
    Note: This can be done in the system File Explorer and then refresh the workspace in Eclipse to see the new project. Delete the .git subfolder from the newly copied folder before refreshing in Eclipse. If done in the IDE, an error dialog may appear complaining about items in the .git folder being out of sync. This can be resolved by deleting the .git subfolder in the newly copied folder.

  3. In the new \wiced_btsdk\dev-kit\bsp\TARGET_mybsp folder, rename the existing/original (BSP).mk file to mybsp.mk.

  4. In the application makefile, set TARGET=mybsp and add it to SUPPORTED_TARGETS as well as TARGET_DEVICE_MAP. For example: mybsp/20819A1

  5. Update design.modus for your custom BSP if needed using the Device Configurator link under Configurators in the Quick Panel.

  6. Update the application makefile as needed for other custom BSP specific attributes and build the application.

Custom Pin Config Only - Multiple Apps

To create a custom pin configuration to be used by multiple applications using an existing BSP that supports Device Configurator, perform the following steps:

  1. Create a folder COMPONENT_(CUSTOM)_design_modus in the existing BSP folder. For example \wiced_btsdk\dev-kit\bsp\TARGET_CYW920819EVB-02\COMPONENT_my_design_modus
  2. Copy the file design.modus from the reference BSP COMPONENT_bsp_design_modus folder under \wiced_btsdk\dev-kit\bsp\ and place the file in the newly created COMPONENT_(CUSTOM)_design_modus folder.
  3. In the application makefile, add the following two lines
    DISABLE_COMPONENTS+=bsp_design_modus
    COMPONENTS+=(CUSTOM)_design_modus
    (for example COMPONENTS+=my_design_modus)
  4. Update design.modus for your custom pin config if needed using the Device Configurator link under Configurators in the Quick Panel.
  5. Building of the application will generate pin configuration source code under a GeneratedSource folder in the new COMPONENT_(CUSTOM)_design_modus folder.

Custom Pin Config Only - Per App

To create a custom configuration to be used by a single application from an existing BSP that supports Device Configurator, perform the following steps:

  1. Create a folder COMPONENT_(BSP)_design_modus in your application. For example COMPONENT_CYW920721B2EVK-03_design_modus
  2. Copy the file design.modus from the reference BSP under \wiced_btsdk\dev-kit\bsp\ and place the file in this folder.
  3. In the application makefile, add the following two lines
    DISABLE_COMPONENTS+=bsp_design_modus
    COMPONENTS+=(BSP)_design_modus
    (for example COMPONENTS+=CYW920721B2EVK-03_design_modus)
  4. Update design.modus for your custom pin config if needed using the Device Configurator link under Configurators in the Quick Panel.
  5. Building of the application will generate pin configuration source code under GeneratedSource folder in your application.

Using libraries

All supported libraries (middleware) can be found in the \wiced_btsdk\dev-kit\libraries folder. To use a library in your application, do the following changes to the makefile in your application:

  1. Update the makefile variable "COMPONENTS" to include the library. For example:
    COMPONENTS += fw_upgrade_lib

  2. Update the makefile variable "SEARCH_LIBS_AND_INCLUDES" to point to the location of the library. For example:
    SEARCH_LIBS_AND_INCLUDES+=$(CY_SHARED_PATH)/dev-kit/libraries/btsdk-ota

Documentation

BTSDK API documentation is available online

Note: For offline viewing, git clone the documentation repo

BTSDK Technical Brief and Release Notes are available online