Full featured matrix (row/column) keyboard scanning module. More...
Data Structures | |
| struct | kbd_matrix_key_state_t |
| Key state bit mask (1 = key pressed; 0 = key released). More... | |
| struct | kbd_matrix_key_t |
| Linked list structure that describes which key has been pressed. More... | |
Defines | |
| #define | KBD_MATRIX_MAX_NR_KEYS 56 |
| Maximum number of keys that can be handled by the module. | |
| #define | KBD_MATRIX_NR_SAMPLES 4 |
| Number of samples that are necessary to debounce a keypress. | |
| #define | KBD_MATRIX_MAX_NR_KEYS_PRESSED 4 |
| Maximum number of keys that may be pressed simultaneously. | |
| #define | KBD_DELAY_BEFORE_REPEATING_KEY 200 |
| Delay before a pressed key will be repeated. | |
| #define | KBD_KEY_REPEAT_DELAY 20 |
| Delay between pressed key repeats. | |
Typedefs | |
| typedef void(* | kbd_matrix_on_key_event_t )(u8_t row, u8_t col, kbd_matrix_event_t event) |
| Function that will be called when a key event has taken place. | |
| typedef void(* | kbd_matrix_set_row_t )(u8_t row, bool_t active) |
| Function that will be called to set a row output. | |
| typedef bool_t(* | kbd_matrix_get_col_t )(u8_t col) |
| Function that will be called to read a column input. | |
| typedef void(* | kbd_matrix_delay_t )(bool_t active) |
| Function that will be called for row column scanning delay. | |
Enumerations | |
| enum | kbd_matrix_event_t { KBD_MATRIX_EVENT_RELEASED = 0, KBD_MATRIX_EVENT_PRESSED = 1 } |
Key event types. More... | |
Files: kbd_matrix.h & kbd_matrix.c
This module implements or makes provision for:
License:
----------------------------------------------------------------------------
ATMEL Microcontroller Software Support
----------------------------------------------------------------------------
Copyright (c) 2008, Atmel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the disclaimer below.
Atmel's name may not be used to endorse or promote products derived from
this software without specific prior written permission.
DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------------
| typedef void(* kbd_matrix_on_key_event_t)(u8_t row, u8_t col, kbd_matrix_event_t event) |
| [in] | row | Row address of key event |
| [in] | col | Column address of key event |
| [in] | event | Key event type: PRESSED or RELEASED |
Definition at line 149 of file kbd_matrix.h.
| typedef void(* kbd_matrix_set_row_t)(u8_t row, bool_t active) |
| [in] | row | Specifies which row that should be set |
| [in] | active | Specifies that row should be activated (normally active low) |
Definition at line 158 of file kbd_matrix.h.
| typedef bool_t(* kbd_matrix_get_col_t)(u8_t col) |
| TRUE | Key is being pressed | |
| FALSE | Key is not pressed (released) |
Definition at line 166 of file kbd_matrix.h.
| typedef void(* kbd_matrix_delay_t)(bool_t active) |
If a row is set to active, there is a certain delay before the columns should be sampled.
If a row is set to inactive, there is a certain delay before the columns return to their inactive state.
| [in] | active | Specifies that row should be activated (normally active low) |
Definition at line 180 of file kbd_matrix.h.
| enum kbd_matrix_event_t |
| KBD_MATRIX_EVENT_RELEASED |
Key has been released. |
| KBD_MATRIX_EVENT_PRESSED |
Key has been pressed. |
Definition at line 135 of file kbd_matrix.h.
00136 { 00137 KBD_MATRIX_EVENT_RELEASED = 0, ///< Key has been released 00138 KBD_MATRIX_EVENT_PRESSED = 1 ///< Key has been pressed 00139 } kbd_matrix_event_t;
1.6.3