EU1KY AA
keyboard.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "LCD.h"
#include "touch.h"
#include "font.h"
#include "keyboard.h"
#include "textbox.h"

Macros

#define KEYW   40
 
#define KEYH   40
 
#define KBDX0   15
 
#define KBDY0   50
 
#define KBDX(col)   (KBDX0 + col * KEYW + 6 * col)
 
#define KBDY(row)   (KBDY0 + row * KEYH + 6 * row)
 
#define KBDNUMKEYS   (sizeof(tb_keybal) / sizeof(TEXTBOX_t))
 

Functions

void Sleep (uint32_t)
 
void SetCursor (void)
 
void WriteText (void)
 
static void KeybHitCb (const TEXTBOX_t *tb)
 
static void KeybHitBackspaceCb (void)
 
static void KeybHitLeftCb (void)
 
static void KeybHitRightCb (void)
 
static void KeybHitOKCb (void)
 
static void KeybHitCancelCb (void)
 
uint32_t KeyboardWindow (char *buffer, uint32_t max_len, const char *header_text)
 Alphanumeric keyboard window. Automatically stores and restores LCD contents. More...
 

Variables

static uint32_t kbdRqExit = 0
 
static char txtbuf [33]
 
static char * presult
 
static uint32_t maxlen
 
static uint32_t lenTxt
 
static uint32_t isChanged
 
static uint32_t CurPos
 
static uint32_t iCount
 
uint32_t color = LCD_GREEN
 
static const TEXTBOX_t tb_keybal []
 

Macro Definition Documentation

#define KBDNUMKEYS   (sizeof(tb_keybal) / sizeof(TEXTBOX_t))
#define KBDX (   col)    (KBDX0 + col * KEYW + 6 * col)
#define KBDX0   15
#define KBDY (   row)    (KBDY0 + row * KEYH + 6 * row)
#define KBDY0   50
#define KEYH   40
#define KEYW   40

Function Documentation

static void KeybHitBackspaceCb ( void  )
static
static void KeybHitCancelCb ( void  )
static
static void KeybHitCb ( const TEXTBOX_t tb)
static
static void KeybHitLeftCb ( void  )
static
static void KeybHitOKCb ( void  )
static
static void KeybHitRightCb ( void  )
static
uint32_t KeyboardWindow ( char *  buffer,
uint32_t  max_len,
const char *  header_text 
)

Alphanumeric keyboard window. Automatically stores and restores LCD contents.

Parameters
bufferA buffer with string to be edited
max_lenMaximum number of characters to fit in the buffer
header_textKeyboard window header text
Returns
1 if the string in buffer has changed, 0 if not changed
void SetCursor ( void  )
void Sleep ( uint32_t  )
void WriteText ( void  )

Variable Documentation

uint32_t color = LCD_GREEN
uint32_t CurPos
static
uint32_t iCount
static
uint32_t isChanged
static
uint32_t kbdRqExit = 0
static
uint32_t lenTxt
static
uint32_t maxlen
static
char* presult
static
const TEXTBOX_t tb_keybal[]
static
char txtbuf[33]
static