/**
  ******************************************************************************
  * @file           : ACWG_build_info.h
  * @brief          : Header for ACWG build information.
  *                   This file contains public declarations for library build info.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2025 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _ACWG_BUILD_INFO_H_
#define _ACWG_BUILD_INFO_H_

#ifdef __cplusplus
extern "C" {
#endif

/** @addtogroup ACWG_SECURITY
  * @{
  */

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>

/** @addtogroup ACWG_build_info_Exported_Constants
  * @{
  */
/* Exported constants --------------------------------------------------------*/
#define ACWG_BI_FW_DESCRIPTION_LEN 24
/**
  * @brief Length of the firmware description string in the build info structure.
  */

#define ACWG_BI_VERSION 1
/**
  * @brief Version of the ACWG build info structure.
  */

#define ACWG_ALIRO_SPEC_VERSION_MAJ 0
/**
  * @brief Major version number of the Aliro specification.
  */

#define ACWG_ALIRO_SPEC_VERSION_MIN 9
/**
  * @brief Minor version number of the Aliro specification.
  */

#define ACWG_ALIRO_SPEC_VERSION_SUBMIN 5
/**
  * @brief Subminor version number of the Aliro specification.
  */
/**
  * @}
  */

/** @addtogroup ACWG_build_info_Exported_Types
  * @{
  */
/* Exported types ------------------------------------------------------------*/
/**
 * @brief Various info about the firmware build
 *
 * The build info are put at a specific address in flash (e.g. 0x0200), so that we can easily recover it with an
 * external application which would read the flash.
 */
typedef struct ACWG_build_info_s {
    uint8_t magic_cookie[4];                        //!< A magic cookie that external application could easily read: 'A', 'C', 'W', 'G'
    uint8_t build_info_version;                     //!< Version of this structure, e.g. @ref MBI_VERSION
    uint8_t ver_major;                                  //!< Major version number of the acwg
    uint8_t ver_minor;                                  //!< Minor version number of the acwg
    uint8_t ver_subminor;                               //!< Subminor version number of the acwg
    // char revision[32];                              //!< git version at the build time, based on hash
    char date[12];                                  //!< Build date, e.g. "Jan 1 1970"
    char time[12];                                  //!< Build time, e.g. "01:00:00"
    uint8_t aliro_spec_major;                                  //!< Major version number of the Aliro spec.
    uint8_t aliro_spec_minor;                                  //!< Minor version number of the Aliro spec.
    uint8_t aliro_spec_subminor;                               //!< Subminor version number of the Aliro spec.
    char fw_description[ACWG_BI_FW_DESCRIPTION_LEN];    //!< Name of the firmware
}ACWG_build_info_t;
/**
  * @}
  */

/**
* @}
*/

#ifdef __cplusplus
}
#endif

#endif /* _ACWG_BUILD_INFO_H_ */