nRF Connect SDK API
0.1.0
Loading...
Searching...
No Matches
key_id.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019-2021 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
*/
6
7
#ifndef _KEY_ID_H_
8
#define _KEY_ID_H_
9
10
#include <zephyr/types.h>
11
#include <zephyr/sys/util.h>
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
17
#define _ROW_POS 0ul
18
#define _ROW_SIZE 7ul
19
#define _COL_POS (_ROW_POS + _ROW_SIZE)
20
#define _COL_SIZE 7ul
21
22
#define _COL_BITS(_col) ((_col & BIT_MASK(_COL_SIZE)) << _COL_POS)
23
#define _ROW_BITS(_row) ((_row & BIT_MASK(_ROW_SIZE)) << _ROW_POS)
24
25
26
#define KEY_ID(_col, _row) ((uint16_t)(_COL_BITS(_col) | _ROW_BITS(_row)))
27
28
#define KEY_COL(_keyid) ((_keyid >> _COL_POS) & BIT_MASK(_COL_SIZE))
29
#define KEY_ROW(_keyid) ((_keyid >> _ROW_POS) & BIT_MASK(_ROW_SIZE))
30
31
#ifdef __cplusplus
32
}
33
#endif
34
35
#endif
/* _KEY_ID_H_ */
include
caf
key_id.h
Generated on Thu Sep 26 2024 10:53:16 for nRF Connect SDK API by
1.9.6