MSP430UltrasonicLibrary  02_30_00_03
ussSwLibCalibration.h
Go to the documentation of this file.
1 #ifndef _USSSWLIBCALIBRATION_H_
2 #define _USSSWLIBCALIBRATION_H_
3 
4 //#############################################################################
5 //
10 //
11 // Group: MSP
12 // Target Device: Banshee
13 //
14 // (C) Copyright 2019, Texas Instruments, Inc.
15 //#############################################################################
16 // TI Release: __PRODUCT_NAME__
17 // Release Date: __PACKAGE_RELEASE_DATE__
18 //#############################################################################
19 
20 
21 //*****************************************************************************
22 // includes
23 //*****************************************************************************
24 #include <msp430.h>
25 #include <stdint.h>
26 #include <stdbool.h>
27 #include "ussSwLib.h"
28 #include <math.h>
34 
35 
36 
37 //*****************************************************************************
40 //*****************************************************************************
41 
42 #ifdef __cplusplus
43 
44 extern "C" {
45 #endif
46 
47 //*****************************************************************************
48 // defines
49 //*****************************************************************************
50 
51 // Number of iterations used for averaging = 2^(RESONATOR_CALIB_ITERATION_COUNT)
52 // If RESONATOR_CALIB_ITERATION_COUNT == 0, Number of iterations used for
53 // averaging = 1.
54 // If RESONATOR_CALIB_ITERATION_COUNT == 1, Number of iterations used for
55 // averaging = 2
56 //
57 // Minimum value = 0
58 // Maximum value = 10
59 #define RESONATOR_CALIB_ITERATION_COUNT 2
60 
61 // Number of ACLK cycles to monitor SAPH ASQCLK.
62 // Minimum value = 1
63 // Maximum value = 3000
64 #define RESONATOR_CALIB_MONITORING_ACLK 550
65 
66 
67 #define AGC_LOOP_MAX_ITERATIONS 5
68 #define AGC_LOOP_SETTLING 3
69 #define ADC_MINIMUM_GAIN_SETTING USS_Capture_Gain_Range_minus_6_5
70 #define AGC_GAIN_TABLE_SIZE (47*2)
71 #define AGC_INDEX_OFFSET 17
72 #define AGC_MIN_DIFFERENCE 1.0
73 
74 
75 // Advanced / Derived parameters
76 // Number of ACLK cycles need to guarantee MSP will go to LPM
77 // minimum = 2 (recommended)
78 // maximum = 20
79 #define RESONATOR_CALIB_MONITORING_ACLK_MIN_COUNT 4
80 
81 #define PLL_68_MHZ_TEMP_CONST (uint64_t)((uint64_t)68000000* \
82  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
83 #define PLL_69_MHZ_TEMP_CONST (uint64_t)((uint64_t)69000000* \
84  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
85 #define PLL_70_MHZ_TEMP_CONST (uint64_t)((uint64_t)70000000* \
86  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
87 #define PLL_71_MHZ_TEMP_CONST (uint64_t)((uint64_t)71000000* \
88  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
89 #define PLL_72_MHZ_TEMP_CONST (uint64_t)((uint64_t)72000000* \
90  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
91 #define PLL_73_MHZ_TEMP_CONST (uint64_t)((uint64_t)73000000* \
92  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
93 #define PLL_74_MHZ_TEMP_CONST (uint64_t)((uint64_t)74000000* \
94  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
95 #define PLL_75_MHZ_TEMP_CONST (uint64_t)((uint64_t)75000000* \
96  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
97 #define PLL_76_MHZ_TEMP_CONST (uint64_t)((uint64_t)76000000* \
98  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
99 #define PLL_77_MHZ_TEMP_CONST (uint64_t)((uint64_t)77000000* \
100  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
101 #define PLL_78_MHZ_TEMP_CONST (uint64_t)((uint64_t)78000000* \
102  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
103 #define PLL_79_MHZ_TEMP_CONST (uint64_t)((uint64_t)79000000* \
104  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
105 #define PLL_80_MHZ_TEMP_CONST (uint64_t)((uint64_t)80000000* \
106  (uint64_t)RESONATOR_CALIB_MONITORING_ACLK)
107 
108 #define ABSTOF_DTOF_MAX_ITERATIONS 64999
109 
110 //*****************************************************************************
111 // typedefs
112 //*****************************************************************************
113 
114 
115 //*****************************************************************************
116 // globals
117 //*****************************************************************************
118 
119 //*****************************************************************************
120 // the function prototypes
121 //*****************************************************************************
122 static float USS_findAGCIndex(int8_t leftIndex, int8_t rightIndex, float tempGain);
123 
124 #ifdef __cplusplus
125 }
126 #endif // extern "C"
127 
128 
129 #endif // end of _USSSWLIBCALIBRATION_H_ definition
float USS_findAGCIndex(int8_t leftIndex, int8_t rightIndex, float tempGain)
Definition: ussSwLibCalibration.c:269
Contains all USS SW Library enums, structs, macros, function and global variables definitions...
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale