ARMEBS4  revision-26.06.2015
Data Structures | Functions | Variables
keyboard.c File Reference

PS2 keyboard functions. More...

#include "heivs/keyboard.h"
#include "stm32/stm32f4xx_usart.h"
#include "stm32/stm32f4xx_misc.h"
#include "stm32/stm32f4xx_rcc.h"
Include dependency graph for keyboard.c:

Go to the source code of this file.

Data Structures

struct  PS2Keymap_t
 Structure of the keyboard map. More...
 

Functions

static void irq_handler (void)
 Interrupt service method when a key is pressed. More...
 
static char get_iso8859_code (uint8_t s)
 Transform the keycode to ascii value. More...
 
uint8_t KeyboardRead (void)
 reads the keyboard More...
 

Variables

static void(* interruptHandler )(void)
 Inits the PS2 keyboard communication. More...
 
static const PS2Keymap_t Keymap_Ascom
 This is the keycode table correspondance.
 

Detailed Description

PS2 keyboard functions.

Author
Pascal Sartoretti (sap at hevs dot ch)

Definition in file keyboard.c.

Function Documentation

static void irq_handler ( void  )
static

Interrupt service method when a key is pressed.

It fills a table with the received characters

Definition at line 35 of file keyboard.c.

References interruptHandler, and USART2_IRQn.

static char get_iso8859_code ( uint8_t  s)
static

Transform the keycode to ascii value.

Parameters
sthe keycode returned by the keyboard
Returns
the ascii value of corresponding pressed key

It returns 0 if key released or if any special key pressed (shift)

Definition at line 199 of file keyboard.c.

References PS2Keymap_t::altgr, Keymap_Ascom, PS2Keymap_t::noshift, and PS2Keymap_t::shift.

Referenced by KeyboardRead().

Here is the caller graph for this function:

Variable Documentation

void(* interruptHandler) (void)
static

Inits the PS2 keyboard communication.

Parameters
interruptHandlerInterrupt function to call on interrupt, NULL for polling
prioPriority of interrupt (0[max] - 15[min]) if used

Definition at line 29 of file keyboard.c.

Referenced by irq_handler(), and KeyboardRead().