This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2650: Bluetooth Smart Keyboard Reference Design Generated Code Question?

Part Number: CC2650
Other Parts Discussed in Thread: CC2640R2F

Hi,

    I am referring tho the Bluetooth Smart Keyboard Reference Design from this link. http://www.ti.com/tool/TIDC-BLUETOOTH-SMART-KEYBOARD-MODULE

    It has a tool to generate code files. So far I understand how the code works. But, I am not clear how the inPinId2inPinIndex[] array was made. Can the reference to how the inPinId2inPinIndex[] was made be found in one of the technical reference documents? Is it possible to get the code for the code file generator so I know how the array was made? Also, I ported the codes to work for CC2640R2F Launchpad, I would like to know if the array is still applicable to work for CC2640R2F MCU? I have wired a USB Keyboard to CC2640R2F Launchpad to work as BLE HID Keyboard.

// Mapping of Pin Index to Input Pin(Coloumn GPIO)
// Reverse mapping of gInputPinMap
// Invalid Input Pin Index(for pins used as output) are represented as BOARD_INPUTCOUNT.

static const uint8_t inPinId2inPinIndex[MAX_NUM_PINS] =  
{
    BOARD_INPUTCOUNT,
    BOARD_INPUT1,
    BOARD_INPUT4,
    BOARD_INPUT6,
    BOARD_INPUTCOUNT,
    BOARD_INPUT0,
    BOARD_INPUTCOUNT,
    BOARD_INPUTCOUNT,
    BOARD_INPUT15,
    BOARD_INPUT14,
    BOARD_INPUTCOUNT,
    BOARD_INPUT11,
    BOARD_INPUT9,
    BOARD_INPUT16,
    BOARD_INPUT17,
    BOARD_INPUTCOUNT,
    BOARD_INPUTCOUNT,
    BOARD_INPUTCOUNT,
    BOARD_INPUT13,
    BOARD_INPUT12,
    BOARD_INPUT10,
    BOARD_INPUTCOUNT,
    BOARD_INPUT2,
    BOARD_INPUT8,
    BOARD_INPUTCOUNT,
    BOARD_INPUT7,
    BOARD_INPUT5,
    BOARD_INPUT3,
    BOARD_INPUTCOUNT,
    BOARD_INPUTCOUNT,
    BOARD_INPUTCOUNT
};

-kel

  • Markel,

    Looking at the documentation (which is pretty old), this array is generated by Key_Scan.exe (probably not a virus :) ). Key_Scan.exe is generated by Key_Scan.py, which unfortunately is not included with the TI reference design. At this time, I have no way of retrieving Key_Scan.py from the original author.

    Fast forwarding to today, we do have a an HID emu kbd example in the BLE Examples pack for the Simplelink CC2640R2 SDK if that interests you.
    www.ti.com/.../SIMPLELINK-CC2640R2-SDK
  • Hi Tom

    I ported the code files generated by Key_Scan.exe to HID Emu Kbd example program. It works and I see the output at my Iphone4s. At the moment my prototype BLE Keyboard is not fully working due to connectivity issues.

    Anyway, of all the code that array is the only one I can not explain. Also at the Key_matrix excel file there is a limit of 16 inputs and the number of key is set to 164 but the standard USB Keyboard has only 104 keys. Also the HID values at Key_matrix excel file are in unusual order. I do not understand why the "author" made it that way.

    I will mark this post as resolved.

    - kel