mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
support SPI_FLASH_ENABLE_COUNTERS feature on esp_flash driver and rename the functions to esp_flash_xx
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
// Copyright 2015-2016 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: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -32,31 +24,38 @@ typedef struct {
|
||||
uint32_t count; // number of times operation was executed
|
||||
uint32_t time; // total time taken, in microseconds
|
||||
uint32_t bytes; // total number of bytes
|
||||
} spi_flash_counter_t;
|
||||
} esp_flash_counter_t;
|
||||
|
||||
typedef struct {
|
||||
spi_flash_counter_t read;
|
||||
spi_flash_counter_t write;
|
||||
spi_flash_counter_t erase;
|
||||
} spi_flash_counters_t;
|
||||
esp_flash_counter_t read;
|
||||
esp_flash_counter_t write;
|
||||
esp_flash_counter_t erase;
|
||||
} esp_flash_counters_t;
|
||||
|
||||
// for deprecate old api
|
||||
typedef esp_flash_counter_t spi_flash_counter_t;
|
||||
typedef esp_flash_counters_t spi_flash_counters_t;
|
||||
|
||||
/**
|
||||
* @brief Reset SPI flash operation counters
|
||||
*/
|
||||
void spi_flash_reset_counters(void);
|
||||
void esp_flash_reset_counters(void);
|
||||
void spi_flash_reset_counters(void) __attribute__((deprecated("Please use 'esp_flash_reset_counters' instead")));
|
||||
|
||||
/**
|
||||
* @brief Print SPI flash operation counters
|
||||
*/
|
||||
void spi_flash_dump_counters(void);
|
||||
void esp_flash_dump_counters(FILE* stream);
|
||||
void spi_flash_dump_counters(void) __attribute__((deprecated("Please use 'esp_flash_dump_counters' instead")));
|
||||
|
||||
/**
|
||||
* @brief Return current SPI flash operation counters
|
||||
*
|
||||
* @return pointer to the spi_flash_counters_t structure holding values
|
||||
* @return pointer to the esp_flash_counters_t structure holding values
|
||||
* of the operation counters
|
||||
*/
|
||||
const spi_flash_counters_t* spi_flash_get_counters(void);
|
||||
const esp_flash_counters_t* esp_flash_get_counters(void);
|
||||
const spi_flash_counters_t* spi_flash_get_counters(void) __attribute__((deprecated("Please use 'esp_flash_get_counters' instead")));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user