43 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			43 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
|  | #ifndef __SDAC_T_H
 | ||
|  | #define __SADC_T_H
 | ||
|  | 
 | ||
|  | #define SADC_DEBUG
 | ||
|  | #define SADC_TEMPERATURE
 | ||
|  | // #define SADC_TIME_CAL
 | ||
|  | 
 | ||
|  | //sleep time = cnt*1us, the max delay is 171 s
 | ||
|  | void usleep(uint32_t cnt); | ||
|  | /*
 | ||
|  | * * if return -1, discard the part; | ||
|  | * if return 0, return the dc calibration code(1024 times) | ||
|  | */ | ||
|  | int32_t sadc_dc_calibration_task(int32_t *dc_calib); | ||
|  | /*
 | ||
|  | * if return -1, discard the part; | ||
|  | * if return 0, sadc_arvg return the sadc voltage code(1024 times) | ||
|  | */ | ||
|  | int32_t sadc_ref_voltg_task(int32_t* sadc_arvg, int32_t* input_dc, int32_t* input_voltg); | ||
|  | 
 | ||
|  | /*
 | ||
|  | * dc_calib is the dc calibration when gain is 1/5 | ||
|  | * ref_voltg is the input voltg(1.2v) when gain is 1/5 | ||
|  | * ref_sadc is the sadc output when gain is 1/5 and input voltg is 1.2v | ||
|  | */ | ||
|  | int8_t atb_for_ical(uint8_t *bias_cal, int32_t dc_calib, int32_t ref_voltg, int32_t ref_sadc); | ||
|  | int32_t atb_for_adcref(uint8_t *trim_adcref, int32_t dc_calib, int32_t ref_voltg, int32_t ref_sadc); | ||
|  | int8_t dcdc_1p2v_test(uint8_t *trim_dcdc, int32_t dc_calib, int32_t ref_voltg, int32_t ref_sadc); | ||
|  | int32_t at_vbg_test(int32_t dc_calib, int32_t ref_voltg, int32_t ref_sadc); | ||
|  | int32_t vtemp_test(int16_t *vtemp, int32_t dc_calib, int32_t ref_voltg, int32_t ref_sadc); | ||
|  | 
 | ||
|  | /*
 | ||
|  | * if return -1, discard the part; | ||
|  | * if return 0, reset the cfg_dly and f_h. | ||
|  | */ | ||
|  | int32_t rx_adc_eoc_meta_task(uint8_t *cfg_dly, uint8_t *f_h); | ||
|  | /*
 | ||
|  | * used for sadc ftm test | ||
|  | */ | ||
|  | void sadc_ftm(void); | ||
|  | 
 | ||
|  | #endif
 |