gr533x_chip_trim.h
Go to the documentation of this file.
1 /**
2 *******************************************************************************
3 *
4 * @file gr533x_chip_trim.h
5 *
6 * @brief GR533X chip trim
7 *
8 *******************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 @addtogroup SYSTEM
40 @{
41 */
42
43 /**
44 * @addtogroup SYS System SDK
45 * @{
46 * @brief Definitions and prototypes for the system SDK interface.
47 */
48
49 #ifndef __GR533X_CHIP_TRIM_H__
50 #define __GR533X_CHIP_TRIM_H__
51
52 #include<stdio.h>
53 #include<stdint.h>
54
55 #define CHIP_TRIM_PATTERN (0x4744)
56
57 typedef struct
58 {
59 uint16_t ate_version;
60 uint16_t hw_version;
61 uint16_t chip_id;
62 uint16_t package;
63 uint16_t flash_size;
64 uint16_t ram_size;
65 uint8_t unused[12];
66 } __attribute__ ((packed)) production_t;
67
68 typedef struct
69 {
70 uint8_t tx_power;
71 uint8_t rssi_cali;
72 uint8_t hp_gain;
73 uint8_t unused[1];
74 } __attribute__ ((packed)) rf_trim_t;
75
76 typedef struct
77 {
78 uint8_t dcdc_1p05;
79 uint8_t dcdc_1p15;
80 uint8_t dig_ldo_0p9_coarse;
81 uint8_t dig_ldo_0P9_fine;
82 uint8_t dig_ldo_1p05_coarse;
83 uint8_t dig_ldo_1p05_fine;
84 uint8_t sys_ldo_1p05;
85 uint8_t sys_ldo_1p15;
86 uint8_t io_ldo_1p8;
87 uint8_t io_ldo_3p0;
88 uint8_t stb_io_ldo_1P8;
89 uint8_t stb_io_ldo_3p0;
90 uint8_t unused[4];
91 } __attribute__ ((packed)) pmu_trim_t;
92
93 typedef struct
94 {
95 uint16_t offset_int_0p8; /* Offset based on interanl reference(0.85V) */
96 uint16_t slope_int_0p8; /* Slope based on interanl reference(0.85V) */
97 uint16_t offset_int_1p2; /* Offset based on interanl reference(1.28V) */
98 uint16_t slope_int_1p2; /* Slope based on interanl reference(1.28V) */
99 uint16_t offset_int_1p6; /* Offset based on interanl reference(0.85V) */
100 uint16_t slope_int_1p6; /* Offset based on interanl reference(0.85V) */
101 uint16_t offset_ext_1p0; /* Offset based on interanl reference(1.6V) */
102 uint16_t slope_ext_1p0; /* Slope based on interanl reference(1.6V) */
103 uint16_t temp; /* Offset based on interanl reference(0.85V) */
104 uint16_t temp_ref; /* Chip temperature sensor reference temperature. E.g. Decimal 2618: 26.18ˇăC */
105 uint8_t unused[4];
106 } __attribute__ ((packed)) sadc_trim_t;
107
108 typedef struct
109 {
110 uint16_t hf_osc_192m;
111 uint16_t hf_osc_192m_fine;
112 uint8_t unused[4];
113 } __attribute__ ((packed)) clk_trim_t;
114
115 typedef struct
116 {
117 uint8_t flash_manufacturer; /* flash manufacturer type PUYA: P25Q40SU: 0x11 */
118 uint8_t feature; /* 0bit: 1 ~ support 512byte write, 0 ~ not support 512 byte write */
119 uint8_t flash_tVSL; /* VCC(min.) to device operation. Uint: 10us */
120 uint8_t flash_tESL; /* Erase suspend latency. Uint: 5us */
121 uint8_t flash_tPSL; /* Program suspend latency. Uint: 5us */
122 uint8_t flash_tPRS; /* Latency between program resume and next suspend. Uint: 5us */
123 uint8_t flash_tERS; /* Latency between erase resume and next suspend. Uint: 5us */
124 uint8_t flash_tDP; /* CS# High to Deep Power-down Mode. Uint: 5us */
125 uint8_t flash_tRES2; /* CS# High To Standby Mode With Electronic Signature Read. Uint: 5us */
126 uint8_t flash_tRDINT; /* Read status register interval when wait busy. Uint: 5us */
127 uint8_t unused[2];
128 } __attribute__ ((packed)) flash_timing_t;
129
130 typedef struct {
131 uint16_t pattern;
132 uint16_t item_end;
133 uint32_t check_sum;
134 production_t prod;
135 rf_trim_t rf;
136 pmu_trim_t pmu;
137 sadc_trim_t sadc;
138 clk_trim_t clk;
139 flash_timing_t flash;
140 // uint8_t unused[168];
141 } __attribute__ ((packed)) chip_trim0_t;
142
143 typedef struct {
144 uint8_t bt_addr[6];
145 uint16_t xo_offset;
146 // uint8_t reserved[24];
147 // uint8_t user[224];
148 } __attribute__ ((packed)) chip_trim1_t;
149
150
151 /** @} */
152 #endif
153
154 /** @} */
__attribute__::rssi_cali
uint8_t rssi_cali
Definition: gr533x_chip_trim.h:71
__attribute__::dig_ldo_0P9_fine
uint8_t dig_ldo_0P9_fine
Definition: gr533x_chip_trim.h:81
__attribute__::temp
uint16_t temp
Definition: gr533x_chip_trim.h:103
__attribute__::rf
rf_trim_t rf
Definition: gr533x_chip_trim.h:135
__attribute__::offset_int_1p2
uint16_t offset_int_1p2
Definition: gr533x_chip_trim.h:97
__attribute__::stb_io_ldo_1P8
uint8_t stb_io_ldo_1P8
Definition: gr533x_chip_trim.h:88
__attribute__::chip_id
uint16_t chip_id
Definition: gr533x_chip_trim.h:61
__attribute__::feature
uint8_t feature
Definition: gr533x_chip_trim.h:118
__attribute__::flash_tRES2
uint8_t flash_tRES2
Definition: gr533x_chip_trim.h:125
__attribute__::package
uint16_t package
Definition: gr533x_chip_trim.h:62
__attribute__::check_sum
uint32_t check_sum
Definition: gr533x_chip_trim.h:133
__attribute__::prod
production_t prod
Definition: gr533x_chip_trim.h:134
__attribute__::pattern
uint16_t pattern
Definition: gr533x_chip_trim.h:131
__attribute__::dcdc_1p05
uint8_t dcdc_1p05
Definition: gr533x_chip_trim.h:78
__attribute__::flash_tVSL
uint8_t flash_tVSL
Definition: gr533x_chip_trim.h:119
__attribute__::ram_size
uint16_t ram_size
Definition: gr533x_chip_trim.h:64
__attribute__::dcdc_1p15
uint8_t dcdc_1p15
Definition: gr533x_chip_trim.h:79
__attribute__::hw_version
uint16_t hw_version
Definition: gr533x_chip_trim.h:60
__attribute__::slope_int_1p6
uint16_t slope_int_1p6
Definition: gr533x_chip_trim.h:100
__attribute__::hf_osc_192m_fine
uint16_t hf_osc_192m_fine
Definition: gr533x_chip_trim.h:111
__attribute__::hf_osc_192m
uint16_t hf_osc_192m
Definition: gr533x_chip_trim.h:110
__attribute__::offset_int_1p6
uint16_t offset_int_1p6
Definition: gr533x_chip_trim.h:99
__attribute__::sys_ldo_1p05
uint8_t sys_ldo_1p05
Definition: gr533x_chip_trim.h:84
__attribute__::offset_int_0p8
uint16_t offset_int_0p8
Definition: gr533x_chip_trim.h:95
__attribute__::ate_version
uint16_t ate_version
Definition: gr533x_chip_trim.h:59
__attribute__::dig_ldo_1p05_coarse
uint8_t dig_ldo_1p05_coarse
Definition: gr533x_chip_trim.h:82
__attribute__::sadc
sadc_trim_t sadc
Definition: gr533x_chip_trim.h:137
__attribute__::io_ldo_3p0
uint8_t io_ldo_3p0
Definition: gr533x_chip_trim.h:87
__attribute__::clk
clk_trim_t clk
Definition: gr533x_chip_trim.h:138
__attribute__::offset_ext_1p0
uint16_t offset_ext_1p0
Definition: gr533x_chip_trim.h:101
__attribute__::flash_manufacturer
uint8_t flash_manufacturer
Definition: gr533x_chip_trim.h:117
__attribute__::tx_power
uint8_t tx_power
Definition: gr533x_chip_trim.h:70
__attribute__::slope_int_0p8
uint16_t slope_int_0p8
Definition: gr533x_chip_trim.h:96
__attribute__::slope_ext_1p0
uint16_t slope_ext_1p0
Definition: gr533x_chip_trim.h:102
__attribute__::io_ldo_1p8
uint8_t io_ldo_1p8
Definition: gr533x_chip_trim.h:86
__attribute__
Definition: gr533x_chip_trim.h:58
__attribute__::stb_io_ldo_3p0
uint8_t stb_io_ldo_3p0
Definition: gr533x_chip_trim.h:89
__attribute__::pmu
pmu_trim_t pmu
Definition: gr533x_chip_trim.h:136
__attribute__::temp_ref
uint16_t temp_ref
Definition: gr533x_chip_trim.h:104
__attribute__::flash_tESL
uint8_t flash_tESL
Definition: gr533x_chip_trim.h:120
__attribute__::hp_gain
uint8_t hp_gain
Definition: gr533x_chip_trim.h:72
__attribute__::flash_tERS
uint8_t flash_tERS
Definition: gr533x_chip_trim.h:123
__attribute__::flash_tPRS
uint8_t flash_tPRS
Definition: gr533x_chip_trim.h:122
__attribute__::dig_ldo_0p9_coarse
uint8_t dig_ldo_0p9_coarse
Definition: gr533x_chip_trim.h:80
__attribute__::flash
flash_timing_t flash
Definition: gr533x_chip_trim.h:139
__attribute__::sys_ldo_1p15
uint8_t sys_ldo_1p15
Definition: gr533x_chip_trim.h:85
__attribute__::item_end
uint16_t item_end
Definition: gr533x_chip_trim.h:132
__attribute__::flash_size
uint16_t flash_size
Definition: gr533x_chip_trim.h:63
__attribute__::flash_tRDINT
uint8_t flash_tRDINT
Definition: gr533x_chip_trim.h:126
__attribute__::dig_ldo_1p05_fine
uint8_t dig_ldo_1p05_fine
Definition: gr533x_chip_trim.h:83
__attribute__::xo_offset
uint16_t xo_offset
Definition: gr533x_chip_trim.h:145
__attribute__::flash_tDP
uint8_t flash_tDP
Definition: gr533x_chip_trim.h:124
__attribute__::slope_int_1p2
uint16_t slope_int_1p2
Definition: gr533x_chip_trim.h:98
__attribute__::flash_tPSL
uint8_t flash_tPSL
Definition: gr533x_chip_trim.h:121