1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <internal/i2c_driver.h>
9 #include <internal/i2c_reg.h>
10 #include <internal/i2c_reg_access.h>
11 
12 #include <stdint.h>
13 
i2c_write_reg(uint32_t base_addr,uint32_t reg_addr,uint8_t value)14 static inline void i2c_write_reg(
15     uint32_t base_addr,
16     uint32_t reg_addr,
17     uint8_t value)
18 {
19     *((volatile uint8_t *)(base_addr + reg_addr)) = value;
20 }
21 
i2c_read_reg(uint32_t base_addr,uint32_t reg_addr)22 static inline uint8_t i2c_read_reg(uint32_t base_addr, uint32_t reg_addr)
23 {
24     return *((volatile uint8_t *)(base_addr + reg_addr));
25 }
26 
27 /* F_I2C Register Write */
f_i2c_write_BSR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)28 void f_i2c_write_BSR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
29 {
30     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_BSR, value);
31     return;
32 }
f_i2c_write_BCR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)33 void f_i2c_write_BCR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
34 {
35     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_BCR, value);
36     return;
37 }
f_i2c_write_CCR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)38 void f_i2c_write_CCR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
39 {
40     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_CCR, value);
41     return;
42 }
f_i2c_write_ADR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)43 void f_i2c_write_ADR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
44 {
45     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_ADR, value);
46     return;
47 }
f_i2c_write_DAR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)48 void f_i2c_write_DAR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
49 {
50     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_DAR, value);
51     return;
52 }
f_i2c_write_CSR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)53 void f_i2c_write_CSR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
54 {
55     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_CSR, value);
56     return;
57 }
f_i2c_write_FSR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)58 void f_i2c_write_FSR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
59 {
60     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_FSR, value);
61     return;
62 }
f_i2c_write_BC2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)63 void f_i2c_write_BC2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
64 {
65     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_BC2R, value);
66     return;
67 }
f_i2c_write_UNDEFINED(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)68 void f_i2c_write_UNDEFINED(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
69 {
70     while (1)
71         ;
72 }
73 
74 /* F_I2C Register Read */
f_i2c_read_BSR(I2C_ST_PACKET_INFO_t * packet_info)75 uint8_t f_i2c_read_BSR(I2C_ST_PACKET_INFO_t *packet_info)
76 {
77     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_BSR);
78 }
f_i2c_read_BCR(I2C_ST_PACKET_INFO_t * packet_info)79 uint8_t f_i2c_read_BCR(I2C_ST_PACKET_INFO_t *packet_info)
80 {
81     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_BCR);
82 }
f_i2c_read_CCR(I2C_ST_PACKET_INFO_t * packet_info)83 uint8_t f_i2c_read_CCR(I2C_ST_PACKET_INFO_t *packet_info)
84 {
85     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_CCR);
86 }
f_i2c_read_ADR(I2C_ST_PACKET_INFO_t * packet_info)87 uint8_t f_i2c_read_ADR(I2C_ST_PACKET_INFO_t *packet_info)
88 {
89     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_ADR);
90 }
f_i2c_read_DAR(I2C_ST_PACKET_INFO_t * packet_info)91 uint8_t f_i2c_read_DAR(I2C_ST_PACKET_INFO_t *packet_info)
92 {
93     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_DAR);
94 }
f_i2c_read_CSR(I2C_ST_PACKET_INFO_t * packet_info)95 uint8_t f_i2c_read_CSR(I2C_ST_PACKET_INFO_t *packet_info)
96 {
97     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_CSR);
98 }
f_i2c_read_FSR(I2C_ST_PACKET_INFO_t * packet_info)99 uint8_t f_i2c_read_FSR(I2C_ST_PACKET_INFO_t *packet_info)
100 {
101     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_FSR);
102 }
f_i2c_read_BC2R(I2C_ST_PACKET_INFO_t * packet_info)103 uint8_t f_i2c_read_BC2R(I2C_ST_PACKET_INFO_t *packet_info)
104 {
105     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_REG_ADDR_BC2R);
106 }
f_i2c_read_UNDEFINED(I2C_ST_PACKET_INFO_t * packet_info)107 uint8_t f_i2c_read_UNDEFINED(I2C_ST_PACKET_INFO_t *packet_info)
108 {
109     while (1)
110         ;
111 }
112 
113 /* F_I2C_SP1 Register Write */
f_i2c_sp1_write_BSR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)114 void f_i2c_sp1_write_BSR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
115 {
116     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BSR, value);
117     return;
118 }
f_i2c_sp1_write_BS2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)119 void f_i2c_sp1_write_BS2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
120 {
121     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BS2R, value);
122     return;
123 }
f_i2c_sp1_write_BCR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)124 void f_i2c_sp1_write_BCR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
125 {
126     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BCR, value);
127     return;
128 }
f_i2c_sp1_write_BC2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)129 void f_i2c_sp1_write_BC2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
130 {
131     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BC2R, value);
132     return;
133 }
f_i2c_sp1_write_ADR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)134 void f_i2c_sp1_write_ADR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
135 {
136     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_ADR, value);
137     return;
138 }
f_i2c_sp1_write_DAR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)139 void f_i2c_sp1_write_DAR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
140 {
141     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_DAR, value);
142     return;
143 }
f_i2c_sp1_write_NFR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)144 void f_i2c_sp1_write_NFR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
145 {
146     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_NFR, value);
147     return;
148 }
f_i2c_sp1_write_TLWR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)149 void f_i2c_sp1_write_TLWR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
150 {
151     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TLWR, value);
152     return;
153 }
f_i2c_sp1_write_TLW2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)154 void f_i2c_sp1_write_TLW2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
155 {
156     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TLW2R, value);
157     return;
158 }
f_i2c_sp1_write_THWR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)159 void f_i2c_sp1_write_THWR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
160 {
161     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_THWR, value);
162     return;
163 }
f_i2c_sp1_write_THW2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)164 void f_i2c_sp1_write_THW2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
165 {
166     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_THW2R, value);
167     return;
168 }
f_i2c_sp1_write_TBFR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)169 void f_i2c_sp1_write_TBFR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
170 {
171     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TBFR, value);
172     return;
173 }
f_i2c_sp1_write_TBF2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)174 void f_i2c_sp1_write_TBF2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
175 {
176     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TBF2R, value);
177     return;
178 }
f_i2c_sp1_write_TRSR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)179 void f_i2c_sp1_write_TRSR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
180 {
181     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TRSR, value);
182     return;
183 }
f_i2c_sp1_write_TRS2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)184 void f_i2c_sp1_write_TRS2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
185 {
186     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TRS2R, value);
187     return;
188 }
f_i2c_sp1_write_TSHR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)189 void f_i2c_sp1_write_TSHR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
190 {
191     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TSHR, value);
192     return;
193 }
f_i2c_sp1_write_TSH2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)194 void f_i2c_sp1_write_TSH2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
195 {
196     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TSH2R, value);
197     return;
198 }
f_i2c_sp1_write_TPSR(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)199 void f_i2c_sp1_write_TPSR(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
200 {
201     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TPSR, value);
202     return;
203 }
f_i2c_sp1_write_TPS2R(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)204 void f_i2c_sp1_write_TPS2R(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
205 {
206     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TPS2R, value);
207     return;
208 }
f_i2c_sp1_write_TLWRH(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)209 void f_i2c_sp1_write_TLWRH(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
210 {
211     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TLWRH, value);
212     return;
213 }
f_i2c_sp1_write_THWRH(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)214 void f_i2c_sp1_write_THWRH(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
215 {
216     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_THWRH, value);
217     return;
218 }
f_i2c_sp1_write_TRSRH(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)219 void f_i2c_sp1_write_TRSRH(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
220 {
221     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TRSRH, value);
222     return;
223 }
f_i2c_sp1_write_TSHRH(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)224 void f_i2c_sp1_write_TSHRH(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
225 {
226     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TSHRH, value);
227     return;
228 }
f_i2c_sp1_write_TPSRH(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)229 void f_i2c_sp1_write_TPSRH(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
230 {
231     i2c_write_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TPSRH, value);
232     return;
233 }
f_i2c_sp1_write_UNDEFINED(I2C_ST_PACKET_INFO_t * packet_info,uint8_t value)234 void f_i2c_sp1_write_UNDEFINED(I2C_ST_PACKET_INFO_t *packet_info, uint8_t value)
235 {
236     while (1)
237         ;
238 }
239 
240 /* F_I2C_SP1 Register Read */
f_i2c_sp1_read_BSR(I2C_ST_PACKET_INFO_t * packet_info)241 uint8_t f_i2c_sp1_read_BSR(I2C_ST_PACKET_INFO_t *packet_info)
242 {
243     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BSR);
244 }
f_i2c_sp1_read_BS2R(I2C_ST_PACKET_INFO_t * packet_info)245 uint8_t f_i2c_sp1_read_BS2R(I2C_ST_PACKET_INFO_t *packet_info)
246 {
247     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BS2R);
248 }
f_i2c_sp1_read_BCR(I2C_ST_PACKET_INFO_t * packet_info)249 uint8_t f_i2c_sp1_read_BCR(I2C_ST_PACKET_INFO_t *packet_info)
250 {
251     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BCR);
252 }
f_i2c_sp1_read_BC2R(I2C_ST_PACKET_INFO_t * packet_info)253 uint8_t f_i2c_sp1_read_BC2R(I2C_ST_PACKET_INFO_t *packet_info)
254 {
255     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_BC2R);
256 }
f_i2c_sp1_read_ADR(I2C_ST_PACKET_INFO_t * packet_info)257 uint8_t f_i2c_sp1_read_ADR(I2C_ST_PACKET_INFO_t *packet_info)
258 {
259     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_ADR);
260 }
f_i2c_sp1_read_DAR(I2C_ST_PACKET_INFO_t * packet_info)261 uint8_t f_i2c_sp1_read_DAR(I2C_ST_PACKET_INFO_t *packet_info)
262 {
263     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_DAR);
264 }
f_i2c_sp1_read_NFR(I2C_ST_PACKET_INFO_t * packet_info)265 uint8_t f_i2c_sp1_read_NFR(I2C_ST_PACKET_INFO_t *packet_info)
266 {
267     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_NFR);
268 }
f_i2c_sp1_read_TLWR(I2C_ST_PACKET_INFO_t * packet_info)269 uint8_t f_i2c_sp1_read_TLWR(I2C_ST_PACKET_INFO_t *packet_info)
270 {
271     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TLWR);
272 }
f_i2c_sp1_read_TLW2R(I2C_ST_PACKET_INFO_t * packet_info)273 uint8_t f_i2c_sp1_read_TLW2R(I2C_ST_PACKET_INFO_t *packet_info)
274 {
275     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TLW2R);
276 }
f_i2c_sp1_read_THWR(I2C_ST_PACKET_INFO_t * packet_info)277 uint8_t f_i2c_sp1_read_THWR(I2C_ST_PACKET_INFO_t *packet_info)
278 {
279     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_THWR);
280 }
f_i2c_sp1_read_THW2R(I2C_ST_PACKET_INFO_t * packet_info)281 uint8_t f_i2c_sp1_read_THW2R(I2C_ST_PACKET_INFO_t *packet_info)
282 {
283     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_THW2R);
284 }
f_i2c_sp1_read_TBFR(I2C_ST_PACKET_INFO_t * packet_info)285 uint8_t f_i2c_sp1_read_TBFR(I2C_ST_PACKET_INFO_t *packet_info)
286 {
287     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TBFR);
288 }
f_i2c_sp1_read_TBF2R(I2C_ST_PACKET_INFO_t * packet_info)289 uint8_t f_i2c_sp1_read_TBF2R(I2C_ST_PACKET_INFO_t *packet_info)
290 {
291     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TBF2R);
292 }
f_i2c_sp1_read_TRSR(I2C_ST_PACKET_INFO_t * packet_info)293 uint8_t f_i2c_sp1_read_TRSR(I2C_ST_PACKET_INFO_t *packet_info)
294 {
295     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TRSR);
296 }
f_i2c_sp1_read_TRS2R(I2C_ST_PACKET_INFO_t * packet_info)297 uint8_t f_i2c_sp1_read_TRS2R(I2C_ST_PACKET_INFO_t *packet_info)
298 {
299     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TRS2R);
300 }
f_i2c_sp1_read_TSHR(I2C_ST_PACKET_INFO_t * packet_info)301 uint8_t f_i2c_sp1_read_TSHR(I2C_ST_PACKET_INFO_t *packet_info)
302 {
303     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TSHR);
304 }
f_i2c_sp1_read_TSH2R(I2C_ST_PACKET_INFO_t * packet_info)305 uint8_t f_i2c_sp1_read_TSH2R(I2C_ST_PACKET_INFO_t *packet_info)
306 {
307     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TSH2R);
308 }
f_i2c_sp1_read_TPSR(I2C_ST_PACKET_INFO_t * packet_info)309 uint8_t f_i2c_sp1_read_TPSR(I2C_ST_PACKET_INFO_t *packet_info)
310 {
311     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TPSR);
312 }
f_i2c_sp1_read_TPS2R(I2C_ST_PACKET_INFO_t * packet_info)313 uint8_t f_i2c_sp1_read_TPS2R(I2C_ST_PACKET_INFO_t *packet_info)
314 {
315     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TPS2R);
316 }
f_i2c_sp1_read_TLWRH(I2C_ST_PACKET_INFO_t * packet_info)317 uint8_t f_i2c_sp1_read_TLWRH(I2C_ST_PACKET_INFO_t *packet_info)
318 {
319     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TLWRH);
320 }
f_i2c_sp1_read_THWRH(I2C_ST_PACKET_INFO_t * packet_info)321 uint8_t f_i2c_sp1_read_THWRH(I2C_ST_PACKET_INFO_t *packet_info)
322 {
323     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_THWRH);
324 }
f_i2c_sp1_read_TRSRH(I2C_ST_PACKET_INFO_t * packet_info)325 uint8_t f_i2c_sp1_read_TRSRH(I2C_ST_PACKET_INFO_t *packet_info)
326 {
327     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TRSRH);
328 }
f_i2c_sp1_read_TSHRH(I2C_ST_PACKET_INFO_t * packet_info)329 uint8_t f_i2c_sp1_read_TSHRH(I2C_ST_PACKET_INFO_t *packet_info)
330 {
331     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TSHRH);
332 }
f_i2c_sp1_read_TPSRH(I2C_ST_PACKET_INFO_t * packet_info)333 uint8_t f_i2c_sp1_read_TPSRH(I2C_ST_PACKET_INFO_t *packet_info)
334 {
335     return i2c_read_reg(packet_info->I2C_BASE_ADDR, I2C_SP1_REG_ADDR_TPSRH);
336 }
f_i2c_sp1_read_UNDEFINED(I2C_ST_PACKET_INFO_t * packet_info)337 uint8_t f_i2c_sp1_read_UNDEFINED(I2C_ST_PACKET_INFO_t *packet_info)
338 {
339     while (1)
340         ;
341 }
342