temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IKobayashi 0:c88c3b616c00 1
IKobayashi 0:c88c3b616c00 2 /** \addtogroup platform */
IKobayashi 0:c88c3b616c00 3 /** @{*/
IKobayashi 0:c88c3b616c00 4 /* mbed Microcontroller Library
IKobayashi 0:c88c3b616c00 5 * Copyright (c) 2016-2016 ARM Limited
IKobayashi 0:c88c3b616c00 6 *
IKobayashi 0:c88c3b616c00 7 * Licensed under the Apache License, Version 2.0 (the "License");
IKobayashi 0:c88c3b616c00 8 * you may not use this file except in compliance with the License.
IKobayashi 0:c88c3b616c00 9 * You may obtain a copy of the License at
IKobayashi 0:c88c3b616c00 10 *
IKobayashi 0:c88c3b616c00 11 * http://www.apache.org/licenses/LICENSE-2.0
IKobayashi 0:c88c3b616c00 12 *
IKobayashi 0:c88c3b616c00 13 * Unless required by applicable law or agreed to in writing, software
IKobayashi 0:c88c3b616c00 14 * distributed under the License is distributed on an "AS IS" BASIS,
IKobayashi 0:c88c3b616c00 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
IKobayashi 0:c88c3b616c00 16 * See the License for the specific language governing permissions and
IKobayashi 0:c88c3b616c00 17 * limitations under the License.
IKobayashi 0:c88c3b616c00 18 */
IKobayashi 0:c88c3b616c00 19 #ifndef MBED_STATS_H
IKobayashi 0:c88c3b616c00 20 #define MBED_STATS_H
IKobayashi 0:c88c3b616c00 21 #include <stdint.h>
IKobayashi 0:c88c3b616c00 22 #include <stddef.h>
IKobayashi 0:c88c3b616c00 23
IKobayashi 0:c88c3b616c00 24 #ifdef __cplusplus
IKobayashi 0:c88c3b616c00 25 extern "C" {
IKobayashi 0:c88c3b616c00 26 #endif
IKobayashi 0:c88c3b616c00 27
IKobayashi 0:c88c3b616c00 28 typedef struct {
IKobayashi 0:c88c3b616c00 29 uint32_t current_size; /**< Bytes allocated currently. */
IKobayashi 0:c88c3b616c00 30 uint32_t max_size; /**< Max bytes allocated at a given time. */
IKobayashi 0:c88c3b616c00 31 uint32_t total_size; /**< Cumulative sum of bytes ever allocated. */
IKobayashi 0:c88c3b616c00 32 uint32_t reserved_size; /**< Current number of bytes allocated for the heap. */
IKobayashi 0:c88c3b616c00 33 uint32_t alloc_cnt; /**< Current number of allocations. */
IKobayashi 0:c88c3b616c00 34 uint32_t alloc_fail_cnt; /**< Number of failed allocations. */
IKobayashi 0:c88c3b616c00 35 } mbed_stats_heap_t;
IKobayashi 0:c88c3b616c00 36
IKobayashi 0:c88c3b616c00 37 /**
IKobayashi 0:c88c3b616c00 38 * Fill the passed in heap stat structure with heap stats.
IKobayashi 0:c88c3b616c00 39 *
IKobayashi 0:c88c3b616c00 40 * @param stats A pointer to the mbed_stats_heap_t structure to fill
IKobayashi 0:c88c3b616c00 41 */
IKobayashi 0:c88c3b616c00 42 void mbed_stats_heap_get(mbed_stats_heap_t *stats);
IKobayashi 0:c88c3b616c00 43
IKobayashi 0:c88c3b616c00 44 typedef struct {
IKobayashi 0:c88c3b616c00 45 uint32_t thread_id; /**< Identifier for thread that owns the stack. */
IKobayashi 0:c88c3b616c00 46 uint32_t max_size; /**< Sum of the maximum number of bytes used in each stack. */
IKobayashi 0:c88c3b616c00 47 uint32_t reserved_size; /**< Current number of bytes allocated for all stacks. */
IKobayashi 0:c88c3b616c00 48 uint32_t stack_cnt; /**< Number of stacks currently allocated. */
IKobayashi 0:c88c3b616c00 49 } mbed_stats_stack_t;
IKobayashi 0:c88c3b616c00 50
IKobayashi 0:c88c3b616c00 51 /**
IKobayashi 0:c88c3b616c00 52 * Fill the passed in structure with stack stats.
IKobayashi 0:c88c3b616c00 53 *
IKobayashi 0:c88c3b616c00 54 * @param stats A pointer to the mbed_stats_stack_t structure to fill
IKobayashi 0:c88c3b616c00 55 */
IKobayashi 0:c88c3b616c00 56 void mbed_stats_stack_get(mbed_stats_stack_t *stats);
IKobayashi 0:c88c3b616c00 57
IKobayashi 0:c88c3b616c00 58 /**
IKobayashi 0:c88c3b616c00 59 * Fill the passed array of stat structures with the stack stats
IKobayashi 0:c88c3b616c00 60 * for each available stack.
IKobayashi 0:c88c3b616c00 61 *
IKobayashi 0:c88c3b616c00 62 * @param stats A pointer to an array of mbed_stats_stack_t structures to fill
IKobayashi 0:c88c3b616c00 63 * @param count The number of mbed_stats_stack_t structures in the provided array
IKobayashi 0:c88c3b616c00 64 * @return The number of mbed_stats_stack_t structures that have been filled,
IKobayashi 0:c88c3b616c00 65 * this is equal to the number of stacks on the system.
IKobayashi 0:c88c3b616c00 66 */
IKobayashi 0:c88c3b616c00 67 size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count);
IKobayashi 0:c88c3b616c00 68
IKobayashi 0:c88c3b616c00 69 #ifdef __cplusplus
IKobayashi 0:c88c3b616c00 70 }
IKobayashi 0:c88c3b616c00 71 #endif
IKobayashi 0:c88c3b616c00 72
IKobayashi 0:c88c3b616c00 73 #endif
IKobayashi 0:c88c3b616c00 74
IKobayashi 0:c88c3b616c00 75 /** @}*/