From 3fc4a0c9c1c3f8988051bcf9c45b89abf91b28e0 Mon Sep 17 00:00:00 2001 From: xiaqilin Date: Thu, 21 Oct 2021 19:16:53 +0800 Subject: [PATCH] ieee802154: add timer APIs --- .../ieee802154/include/esp_ieee802154.h | 45 +++++++++++++------ .../ieee802154/include/esp_ieee802154_types.h | 18 +++----- components/ieee802154/lib | 2 +- tools/ci/check_copyright_ignore.txt | 2 - 4 files changed, 38 insertions(+), 29 deletions(-) diff --git a/components/ieee802154/include/esp_ieee802154.h b/components/ieee802154/include/esp_ieee802154.h index e31a5ca37e..0cee0b56a7 100644 --- a/components/ieee802154/include/esp_ieee802154.h +++ b/components/ieee802154/include/esp_ieee802154.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -321,6 +313,21 @@ bool esp_ieee802154_get_rx_when_idle(void); */ esp_err_t esp_ieee802154_energy_detect(uint32_t duration); +/** + * @brief Start the one-shot timer 0 in IEEE 802.15.4 subsystem. + * + * @param[in] interval The timer interval in microseconds. + * + */ +void esp_ieee802154_timer0_start(uint32_t interval); + +/** + * @brief Start the one-shot timer 1 in IEEE 802.15.4 subsystem. + * + * @param[in] interval The timer interval in 625 microseconds. + * + */ +void esp_ieee802154_timer1_start(uint32_t interval); /** Below are the events generated by IEEE 802.15.4 subsystem, which are in ISR context **/ /** @@ -380,6 +387,18 @@ extern void esp_ieee802154_transmit_sfd_done(uint8_t *frame); */ extern void esp_ieee802154_energy_detect_done(int8_t power); +/** + * @brief The timer 0 has expired. + * + */ +extern void esp_ieee802154_timer0_done(void); + +/** + * @brief The timer 1 has expired. + * + */ +extern void esp_ieee802154_timer1_done(void); + #ifdef __cplusplus } #endif diff --git a/components/ieee802154/include/esp_ieee802154_types.h b/components/ieee802154/include/esp_ieee802154_types.h index 823e3cdcf3..13a97341b5 100644 --- a/components/ieee802154/include/esp_ieee802154_types.h +++ b/components/ieee802154/include/esp_ieee802154_types.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/ieee802154/lib b/components/ieee802154/lib index 387c762a71..816f6b8f87 160000 --- a/components/ieee802154/lib +++ b/components/ieee802154/lib @@ -1 +1 @@ -Subproject commit 387c762a711ca70a1b86d66716736f162a52ff4a +Subproject commit 816f6b8f87bbfededdeda68c0340aa90999507f2 diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 8021d424db..ecd6c716fc 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -1497,8 +1497,6 @@ components/idf_test/include/esp32h2/idf_performance_target.h components/idf_test/include/esp32s2/idf_performance_target.h components/idf_test/include/esp32s3/idf_performance_target.h components/idf_test/include/idf_performance.h -components/ieee802154/include/esp_ieee802154.h -components/ieee802154/include/esp_ieee802154_types.h components/jsmn/include/jsmn.h components/jsmn/src/jsmn.c components/linux/include/sys/queue.h