driver: sensor: npcx: add tachometer sensor support.

In NPCX7 series, it contains two tachometer (TACH) modules that contains
two Independent timers (counter 1 and 2). They are used to capture a
counter value when an event is detected via the external pads (TA or
TB).

The CL also includes:
— Add npcx tachometer device tree declarations.
— Zephyr sensor api implementation for tachometer.
— Enable "tach1" device in npcx7m6fb.dts for testing.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
This commit is contained in:
Mulin Chao 2021-01-12 01:45:06 -08:00 committed by Anas Nashif
commit 7c9d3f44f0
13 changed files with 573 additions and 0 deletions

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2021 Nuvoton Technology Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_SENSOR_NPCX_TACH_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_SENSOR_NPCX_TACH_H_
/* NPCX tachometer port type */
#define NPCX_TACH_PORT_A 0
#define NPCX_TACH_PORT_B 1
/* NPCX tachometer specific operate frequency */
#define NPCX_TACH_FREQ_LFCLK 32768
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_SENSOR_NPCX_TACH_H_ */