nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Cherry8x16 Keyboard Application main file. More...

Macros

#define USE_UART
 
#define SIMPLE_UART_TXD_PIN_NUMBER   (24U)
 
#define SIMPLE_UART_RXD_PIN_NUMBER   (25U)
 
#define KEYPAD_NUM_OF_COLUMNS   16
 Number of columns in the keyboard matrix.
 
#define KEYPAD_NUM_OF_ROWS   8
 Number of rows in the keyboard matrix.
 

Functions

static void uart_puthidstring (const char *str)
 Function for sending a series of characters (string) to UART. Execution is blocked until UART peripheral reports a character has been sent. More...
 
int main (void)
 Function for application main entry. More...
 

Variables

static const uint8_t volatile
*const 
matrix_row_port = ((uint8_t*)(&NRF_GPIO->IN)) + 2
 
static uint16_t *const matrix_column_port = ((uint16_t*)(&NRF_GPIO->OUT))
 
static const uint8_t usb_hid2_ascii_look_up [KEYPAD_NUM_OF_COLUMNS *KEYPAD_NUM_OF_ROWS]
 

Detailed Description

This file contains the source code for an application using the Cherry8x16 Keyboard.

Macro Definition Documentation

#define SIMPLE_UART_TXD_PIN_NUMBER   (24U)

Pin number to use as UART TXD. LEDs for modifier key presses and UART cannot be used at the same time as both use SIMPLE_UART_TXD_PIN_NUMBER. Comment out UART code if using LEDs for modifier keys (and comment out the LED code if using UART).

#define SIMPLE_UART_RXD_PIN_NUMBER   (25U)

Pin number to use as UART RXD. LEDs for modifier key presses and UART cannot be used at the same time as both use SIMPLE_UART_RXD_PIN_NUMBER. Comment out UART code if using LEDs for modifier keys (and comment out the LED code if using UART).

Function Documentation

static void uart_puthidstring ( const char *  str)
static
Parameters
[in]strNull terminated array of characters to send.
int main ( void  )
Returns
0. int return type required by ANSI/ISO standard.

Variable Documentation

static const uint8_t volatile *const matrix_row_port = ((uint8_t*)(&NRF_GPIO->IN)) + 2
static

Pointer to GPIO memory used as a row port. No pointer alignment required for pointing to 8-bit values in this memory region.

static uint16_t *const matrix_column_port = ((uint16_t*)(&NRF_GPIO->OUT))
static

Pointer to GPIO memory used as a column port. Half-word alignment is required for pointing to 16-bit values in this memory region.

static const uint8_t usb_hid2_ascii_look_up
static
Initial value:
=
{
0x00, 0x00, 0x00, 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A,
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30,
0x0D, 0x1B, 0x08, 0x09, 0x20, 0x2D, 0x3D, 0x5B, 0x5D, 0x00,
0x00, 0x3B, 0x27, 0x00, 0x2C, 0x2E, 0x2F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}

Table containing the mapping between the USB HID codes and ASCII values for most of the keys.