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