94 lines
2.6 KiB
C
94 lines
2.6 KiB
C
/*
|
|
******************************************************************************
|
|
* @file trim_fr30xx.h
|
|
* @author FreqChip Firmware Team
|
|
* @version V1.0.0
|
|
* @date 2023
|
|
* @brief Header file of trim HAL module.
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* Copyright (c) 2023 FreqChip.
|
|
* All rights reserved.
|
|
******************************************************************************
|
|
*/
|
|
#ifndef __TRIM_FR1010_H__
|
|
#define __TRIM_FR1010_H__
|
|
|
|
#include "fr30xx.h"
|
|
|
|
/** @addtogroup trim_Parameter_Section
|
|
* @{
|
|
*/
|
|
/* ################################ trim Parameter Section Start ################################ */
|
|
|
|
/*--------------------------------------------------*/
|
|
/* CP trim Parameter */
|
|
/*--------------------------------------------------*/
|
|
typedef __PACKED_STRUCT
|
|
{
|
|
/* --------- vendor-specific --------- */
|
|
volatile uint32_t Version : 2;
|
|
volatile uint32_t BBG_CODE : 5;
|
|
volatile uint32_t SYSLDO_CODE : 4;
|
|
volatile uint32_t BFB_CODE : 3;
|
|
volatile uint32_t DLDO_CODE : 3;
|
|
volatile uint32_t IOLDO_CODE : 3;
|
|
volatile uint32_t SBG_CODE : 4;
|
|
volatile uint32_t PKVDD_CODE : 4;
|
|
volatile uint32_t rsv_0 : 2;
|
|
volatile uint32_t LOT_ID : 10;
|
|
volatile uint32_t WaferID : 5;
|
|
volatile uint32_t XY : 16;
|
|
volatile uint32_t Year_Week : 14;
|
|
|
|
volatile uint32_t rsv_1 : 20;
|
|
/* --------- vendor-specific END--------- */
|
|
}struct_CP_Trim_t;
|
|
|
|
/*--------------------------------------------------*/
|
|
/* FT trim Parameter */
|
|
/*--------------------------------------------------*/
|
|
typedef struct
|
|
{
|
|
uint16_t u16_Version;
|
|
uint16_t u16_ioldo;
|
|
|
|
union {
|
|
struct{
|
|
int32_t s32_ConstantA;
|
|
int32_t s32_ConstantB;
|
|
uint16_t u16_SlopeA;
|
|
uint16_t u16_SlopeB;
|
|
}V1;
|
|
|
|
}Param;
|
|
|
|
uint32_t u32_crc;
|
|
|
|
}struct_FT_Trim_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint32_t u16_slopeA;
|
|
uint32_t u16_slopeB;
|
|
int32_t s32_constantA;
|
|
int32_t s32_constantB;
|
|
}struct_ADC_Cal_Param_t;
|
|
|
|
/* ################################ trim Parameter Section END ################################## */
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
|
|
/* Exported functions --------------------------------------------------------*/
|
|
void trim_cp_config(void);
|
|
void trim_ft_config(void);
|
|
|
|
bool ft_trim_get_param(void);
|
|
struct_ADC_Cal_Param_t *trim_get_adc_cal_param(void);
|
|
#endif // __TRIM_FR1010_H__
|