unity: add reference clock for use in unit tests

This commit is contained in:
Ivan Grokhotkov
2017-08-21 22:33:03 +08:00
parent 1af6384349
commit 9a2c62cf2b
2 changed files with 188 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
// Utilities for esp-idf unit tests
#include <stdint.h>
#include <esp_partition.h>
/* Return the 'flash_test' custom data partition (type 0x55)
@@ -22,3 +23,21 @@
*/
const esp_partition_t *get_test_data_partition();
/**
* @brief Initialize reference clock
*
* Reference clock provides timestamps at constant 1 MHz frequency, even when
* the APB frequency is changing.
*/
void ref_clock_init();
/**
* @brief Deinitialize reference clock
*/
void ref_clock_deinit();
/**
* @brief Get reference clock timestamp
* @return number of microseconds since the reference clock was initialized
*/
uint64_t ref_clock_get();