1 // Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /**
22  * @brief PCNT channel action on control level
23  *
24  */
25 typedef enum {
26     PCNT_CHANNEL_LEVEL_ACTION_KEEP,    /*!< Keep current count mode */
27     PCNT_CHANNEL_LEVEL_ACTION_INVERSE, /*!< Invert current count mode (increase -> decrease, decrease -> increase) */
28     PCNT_CHANNEL_LEVEL_ACTION_HOLD,    /*!< Hold current count value */
29 } pcnt_channel_level_action_t;
30 
31 /**
32  * @brief PCNT channel action on signal edge
33  *
34  */
35 typedef enum {
36     PCNT_CHANNEL_EDGE_ACTION_HOLD,     /*!< Hold current count value */
37     PCNT_CHANNEL_EDGE_ACTION_INCREASE, /*!< Increase count value */
38     PCNT_CHANNEL_EDGE_ACTION_DECREASE, /*!< Decrease count value */
39 } pcnt_channel_edge_action_t;
40 
41 /**
42  * @brief PCNT unit counter value's sign
43  *
44  */
45 typedef enum {
46     PCNT_UNIT_COUNT_SIGN_ZERO_POS, /*!< positive value to zero */
47     PCNT_UNIT_COUNT_SIGN_ZERO_NEG, /*!< negative value to zero */
48     PCNT_UNIT_COUNT_SIGN_NEG,      /*!< counter value negative */
49     PCNT_UNIT_COUNT_SIGN_POS,      /*!< counter value positive */
50 } pcnt_unit_count_sign_t;
51 
52 #ifdef __cplusplus
53 }
54 #endif
55