1 /** 2 ****************************************************************************** 3 * @file otp.h 4 * @author MCD Application Team 5 * @brief OTP manager interface 6 ****************************************************************************** 7 * @attention 8 * 9 * <h2><center>© Copyright (c) 2019 STMicroelectronics. 10 * All rights reserved.</center></h2> 11 * 12 * This software component is licensed by ST under BSD 3-Clause license, 13 * the "License"; You may not use this file except in compliance with the 14 * License. You may obtain a copy of the License at: 15 * opensource.org/licenses/BSD-3-Clause 16 * 17 ****************************************************************************** 18 */ 19 20 21 /* Define to prevent recursive inclusion -------------------------------------*/ 22 #ifndef __OTP_H 23 #define __OTP_H 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 /* Includes ------------------------------------------------------------------*/ 30 #include "utilities_common.h" 31 32 /* Exported types ------------------------------------------------------------*/ 33 typedef PACKED_STRUCT 34 { 35 uint8_t bd_address[6]; 36 uint8_t hse_tuning; 37 uint8_t id; 38 } OTP_ID0_t; 39 40 /* Exported constants --------------------------------------------------------*/ 41 /* External variables --------------------------------------------------------*/ 42 /* Exported macros -----------------------------------------------------------*/ 43 /* Exported functions ------------------------------------------------------- */ 44 45 /** 46 * @brief This API return the address (64 bits aligned) of the ID parameter in the OTP 47 * It returns the first ID declaration found from the higher address down to the base address 48 * The user shall fill the OTP from the base address to the top of the OTP so that the more recent 49 * declaration is returned by the API 50 * The OTP manager handles only 64bits parameter 51 * | Id | Parameter | 52 * | 8bits | 58bits | 53 * | MSB | LSB | 54 * 55 * @param id: ID of the parameter to read from OTP 56 * @retval Address of the ID in the OTP - returns 0 when no ID found 57 */ 58 uint8_t * OTP_Read( uint8_t id ); 59 60 #ifdef __cplusplus 61 } 62 #endif 63 64 #endif /*__OTP_H */ 65 66 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 67