efuse: Add new esp_efuse_read_field_bit() convenience function

This commit is contained in:
Angus Gratton
2020-04-25 15:13:18 +10:00
committed by Angus Gratton
parent 1dd5a4dba4
commit 48d9c14c28
4 changed files with 41 additions and 12 deletions

View File

@@ -66,6 +66,23 @@ typedef struct esp_efuse_desc_s esp_efuse_desc_t;
*/
esp_err_t esp_efuse_read_field_blob(const esp_efuse_desc_t* field[], void* dst, size_t dst_size_bits);
/**
* @brief Read a single bit eFuse field as a boolean value.
*
* @note The value must exist and must be a single bit wide. If there is any possibility of an error
* in the provided arguments, call esp_efuse_read_field_blob() and check the returned value instead.
*
* @note If assertions are enabled and the parameter is invalid, execution will abort
*
* @param[in] field A pointer to the structure describing the fields of efuse.
* @return
* - true: The field parameter is valid and the bit is set.
* - false: The bit is not set, or the parameter is invalid and assertions are disabled.
*
*/
bool esp_efuse_read_field_bit(const esp_efuse_desc_t *field[]);
/**
* @brief Reads bits from EFUSE field and returns number of bits programmed as "1".
*