Smart Remote 3 nRF52 v1.2
User input

Smart Remote offers comprehensive user input options. It supports a classic keyboard, motion tracking, as well as a touchpad.

Keyboard

Smart Remote offers two distinct keyboard drivers. Both support up to 64 keys arranged in a matrix with up to 8 rows and 8 columns, and both can be scaled down to any row/column count. One driver expects that the matrix is connected directly to the nRF52 GPIOs, while the other one uses SX1509 I/O expanders connected to a two-wire bus.

The GPIO-based driver is designed to minimize power consumption and it is recommended for the final design. The driver waits for an interrupt generated by pressing any key. The interrupt triggers a scanning procedure which is executed at regular intervals configured by the CONFIG_KBD_POLL_INTERVAL option, as long as at least one key is pressed. The driver switches back to interrupt mode if no key press is detected in three consecutive scans.

If the remote uses the GPIO-based driver, the keyboard can be configured as a wakeup source (see Power management). Such behavior is enabled by the CONFIG_KBD_WAKEUP_SOURCE option.

The SX1509-based driver is recommended for prototypes, where GPIO pins are used for testing and/or debugging purposes. It works in the similar way as the GPIO-based driver. However, as the keyboard is scanned continuously, power consumption is increased.

Regardless of the driver used, Smart Remote offers several features simplifying key processing in the firmware. These include:

Despite the fact that the Smart Remote core is able to handle 65536 different key codes, the maximum number of keys in the system is limited by the following restrictions:

Motion

Smart Remote is able to convert device orientation into X/Y mouse cursor movement sent to the host, providing Air Mouse functionality. This function is performed by a dedicated library, which converts data from a 6-axis motion tracking chip (integrating both an accelerometer and a gyroscope) into motion on an imaginary X/Y plane located ahead of the remote.

When activated by the CONFIG_GYRO_MODE_KEY_ID key, the gyroscope driver starts polling the motion tracking chip every CONFIG_GYRO_POLL_INTERVAL milliseconds.

Note
The polling interval may be configured, however the motion processing library expects a 10 ms polling rate.

The linear and angular accelerations are then passed to the library which converts these values into delta movements on the X/Y plane. Gain of the process can be adjusted using the CONFIG_GYRO_X_GAIN and CONFIG_GYRO_Y_GAIN options. The gyroscope mode is deactivated when CONFIG_GYRO_MODE_KEY_ID is pressed again or when there is no movement for CONFIG_GRYO_IDLE_TIMEOUT seconds.

Gyroscope calibration

The gyroscope is automatically calibrated on the first firmware boot. Calibration can be also performed on user request by holding CONFIG_GYRO_MODE_KEY_ID for 3 seconds (this functionality is available only when key combinations detection is enabled by setting CONFIG_KBD_KEY_COMBO_ENABLED to 1). In both cases, calibration data is saved to flash. Moreover, the motion processing library performs automatic sensor calibration when the device remains stationary for at least one second. This is done to eliminate aging effects.

Note
Smart Remote has another accelerometer used solely for waking up the device. When enabled (by setting both CONFIG_ACC_ENABLED and CONFIG_ACC_WAKEUP_SOURCE options to 1), it wakes up the device on the slightest movement in order to mitigate key press transmission delay introduced by device boot and by the Bluetooth connection setup. See Power management.

Touchpad

Smart Remote supports a classic touchpad. Both X/Y motion, basic gestures (wheel/pan), as well as clicks are recognized and forwarded to the host as HID reports. The remote polls the touchpad every CONFIG_TOUCHPAD_POLL_INTERVAL milliseconds and generates appropriate events based on the reported status.


Documentation feedback | Developer Zone | Subscribe | Updated