Project 1  4×4 Keypad
Neff Site
Macros | Functions
c1889.h File Reference

This module implements an interface to the MIKROE-1294 8x8 Y Click. More...

Go to the source code of this file.

Macros

#define C1889_COLS   4
 
#define C1889_ROWS   4
 

Functions

uint16_t c1889_scan (void)
 Scan keypad. More...
 
void c1889_init (void)
 Initialize click module. More...
 
uint16_t c1889_pressed (uint16_t current, uint16_t previous)
 Return pressed keys. More...
 
uint16_t c1889_released (uint16_t current, uint16_t previous)
 Return released keys. More...
 
char c1889_decode (uint8_t key)
 Decode key. More...
 

Detailed Description

This module implements an interface to the MIKROE-1294 8x8 Y Click.

The MIKROE-1294 8x8 Y Click implements a 8x8 dot-matrix using a MAX7219 serially interfaced 8-Digit LED display driver. This module provides an interface to this module.

Author
Wolfgang Neff
Version
1.0
Date
2018-03-13
History
Created: 2018-03-13

Macro Definition Documentation

◆ C1889_COLS

#define C1889_COLS   4

◆ C1889_ROWS

#define C1889_ROWS   4

Function Documentation

◆ c1889_decode()

char c1889_decode ( uint8_t  key)

Decode key.

Decodes a key and returns the corresponding ASCII code.

Parameters
keyThe key to decode.
Returns
The ASCII code of the key.

◆ c1889_init()

void c1889_init ( void  )

Initialize click module.

Initializes the click module by setting up the SPI module.

◆ c1889_pressed()

uint16_t c1889_pressed ( uint16_t  current,
uint16_t  previous 
)

Return pressed keys.

Returns the keys that have been pressed since the last scan. This is done by analyzing the current and the previous state.

Parameters
currentCurrent scan code of the keypad.
previousPrevious scan code of the keypad.
Returns
Key map of the pressed keys.

◆ c1889_released()

uint16_t c1889_released ( uint16_t  current,
uint16_t  previous 
)

Return released keys.

Returns the keys that have been released since the last scan. This is done by analyzing the current and the previous state.

Parameters
currentCurrent scan code of the keypad.
previousPrevious scan code of the keypad.
Returns
Key map of the released keys.

◆ c1889_scan()

uint16_t c1889_scan ( void  )

Scan keypad.

Scans the keypad and returns a scan code. Each key position is encoded by a bit. If a key is pressed the corresponding is set.

Returns
Scan code of the keypad.
Contact