1 // Copyright 2020 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 #include <stdint.h> 18 #include "soc/soc_caps.h" 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /* 25 * @brief The structure of the counter value in systimer 26 * 27 */ 28 typedef struct { 29 union { 30 struct { 31 uint64_t lo : SOC_SYSTIMER_BIT_WIDTH_LO; /*!< Low part of counter value */ 32 uint64_t hi : SOC_SYSTIMER_BIT_WIDTH_HI; /*!< High part of counter value */ 33 }; 34 uint64_t val; /*!< counter value */ 35 }; 36 } systimer_counter_value_t; 37 38 /** @cond */ 39 _Static_assert(sizeof(systimer_counter_value_t) == 8, "systimer_counter_value_t should occupy 8 bytes in memory"); 40 /** @endcond */ 41 42 /** 43 * @brief systimer alarm mode 44 * 45 */ 46 typedef enum { 47 SYSTIMER_ALARM_MODE_ONESHOT, /*!< systimer alarm oneshot mode */ 48 SYSTIMER_ALARM_MODE_PERIOD, /*!< systimer alarm period mode */ 49 } systimer_alarm_mode_t; 50 51 #ifdef __cplusplus 52 } 53 #endif 54