1 /* 2 * Copyright (c) 2021-2023, The TrustedFirmware-M Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #ifndef CC3XX_OTP_H 9 #define CC3XX_OTP_H 10 11 #include "cc3xx_error.h" 12 13 #include <stdint.h> 14 #include <stddef.h> 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 /** 21 * @brief Write contents from the OTP memory 22 * 23 * @param[out] otp_addr Address to write to 24 * @param[in] size Size in bytes of the data to write 25 * @param[in] buf Buffer containing the data to be written 26 * 27 * @return cc3xx_err_t 28 */ 29 cc3xx_err_t cc3xx_otp_write(uint8_t *otp_addr, size_t size, const uint8_t *buf); 30 31 /** 32 * @brief Read contents from the OTP memory 33 * 34 * @param[in] otp_addr Address to read from 35 * @param[in] size Size in bytes of the data to read 36 * @param[out] buf Buffer that will be holding the retrieved data from OTP 37 * 38 * @return cc3xx_err_t 39 */ 40 cc3xx_err_t cc3xx_otp_read(const uint8_t *otp_addr, size_t size, uint8_t *buf); 41 42 #ifdef __cplusplus 43 } 44 #endif 45 46 #endif /* CC3XX_OTP_H */ 47