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:
parent
377456c5af
commit
7c9d3f44f0
13 changed files with 573 additions and 0 deletions
16
include/dt-bindings/sensor/npcx_tach.h
Normal file
16
include/dt-bindings/sensor/npcx_tach.h
Normal 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_ */
|
Loading…
Add table
Add a link
Reference in a new issue