1 /*
2  * Copyright (c) 2024 ENE Technology Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ENE_KB1200_TACHO_H
8 #define ENE_KB1200_TACHO_H
9 
10 /**
11  * brief Structure type to access TACHO.
12  */
13 struct tacho_regs {
14 	volatile uint16_t TACHOCFG;      /*Configuration Register */
15 	volatile uint16_t Reserved0;     /*Reserved */
16 	volatile uint8_t  TACHOIE;       /*Interrupt Enable Register */
17 	volatile uint8_t  Reserved1[3];  /*Reserved */
18 	volatile uint8_t  TACHOPF;       /*Event Pending Flag Register */
19 	volatile uint8_t  Reserved2[3];  /*Reserved */
20 	volatile uint16_t TACHOCV;       /*TACHO0 Counter Value Register */
21 	volatile uint16_t Reserved3;     /*Reserved */
22 };
23 
24 #define TACHO_CNT_MAX_VALUE                 0x7FFF
25 
26 #define TACHO_TIMEOUT_EVENT                 0x02
27 #define TACHO_UPDATE_EVENT                  0x01
28 
29 #define TACHO_MONITOR_CLK_64US              0
30 #define TACHO_MONITOR_CLK_16US              1
31 #define TACHO_MONITOR_CLK_8US               2
32 #define TACHO_MONITOR_CLK_2US               3
33 
34 #define TACHO_FUNCTION_ENABLE               0x0001
35 #define TACHO_RING_EDGE_SAMPLE              0x0000
36 #define TACHO_EDGE_CHANGE_SAMPLE            0x0080
37 #define TACHO_FILTER_ENABLE                 0x8000
38 
39 #endif /* ENE_KB1200_TACHO_H */
40