SMBusLibrary  1.0
smbus_nwk.h
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2023, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 #ifndef __SMBUS_NWK_H__
33 #define __SMBUS_NWK_H__
34 
35 //*****************************************************************************
36 //
39 //
40 //*****************************************************************************
41 
42 //*****************************************************************************
43 //
44 // If building with a C++ compiler, make all of the definitions in this header
45 // have a C binding.
46 //
47 //*****************************************************************************
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #endif
52 
53 //
54 // Include files
55 //
56 #include <stdlib.h>
57 #include <stdint.h>
58 #include <stdbool.h>
59 #include "smbus.h"
60 
61 //*****************************************************************************
62 // Internal functions called by the physical layer and internal smbus
63 // processing. Application programs should not call these functions directly.
64 //*****************************************************************************
65 //*****************************************************************************
66 //
68 //
70 //
72 //
73 //*****************************************************************************
74 extern uint16_t SMBus_NWK_getRxPayloadSize(SMBus *smbus);
75 
76 
77 //*****************************************************************************
78 //
80 //
82 //
84 //
85 //*****************************************************************************
86 extern void SMBus_NWK_startTxTransfer(SMBus *smbus);
87 
88 //*****************************************************************************
89 //
91 //
93 //
95 //
96 //*****************************************************************************
97 extern void SMBus_NWK_startRxTransfer(SMBus *smbus);
98 
99 //*****************************************************************************
100 //
102 //
105 //
108 //
114 //
115 //*****************************************************************************
117  uint8_t addrRw);
118 
119 //*****************************************************************************
120 //
122 //
124 //
127 //
137 //
138 //*****************************************************************************
140  uint8_t data);
141 
142 //*****************************************************************************
143 //
145 //
147 //
151 //
158 //
159 //*****************************************************************************
161  uint8_t *data);
162 
163 //*****************************************************************************
164 //
166 //
168 //
170 //
178 //
179 //*****************************************************************************
181 
182 //*****************************************************************************
183 //
185 //
187 //
189 //
190 //*****************************************************************************
192 
193 //*****************************************************************************
194 //
196 //
198 //
200 //
201 //*****************************************************************************
203 
204 //*****************************************************************************
205 //
207 //
209 //
212 //
218 //
219 //*****************************************************************************
221  uint8_t data);
222 
223 //*****************************************************************************
224 //
226 //
228 //
232 //
236 //
237 //*****************************************************************************
239  uint8_t *data);
240 
241 
242 //*****************************************************************************
243 //
245 //
246 //
248 //
250 //
251 //*****************************************************************************
253 //*****************************************************************************
254 //
256 //
257 //
259 //
263 //
264 //*****************************************************************************
266 
267 //*****************************************************************************
268 //
270 //
272 //
274 //
275 //*****************************************************************************
277 
278 //*****************************************************************************
279 //
281 //
283 //
287 //
288 //*****************************************************************************
290 
291 //*****************************************************************************
292 //
294 //
296 //
298 //
299 //*****************************************************************************
300 extern void SMBus_NWK_controllerReset(SMBus *smbus);
301 
302 //*****************************************************************************
303 //
305 //
308 //
310 //
311 //*****************************************************************************
312 extern void SMBus_NWK_controllerEnableHostNotify(SMBus *smbus, uint8_t *buff);
313 
314 //*****************************************************************************
315 //
317 //
319 //
321 //
322 //*****************************************************************************
323 extern void SMBus_NWK_controllerDisableHostNotify(SMBus *smbus);
324 
325 //*****************************************************************************
326 //
327 // Mark the end of the C bindings section for C++ compilers.
328 //
329 //*****************************************************************************
330 #ifdef __cplusplus
331 }
332 #endif
333 
334 //*****************************************************************************
335 //
336 // Close the Doxygen group.
338 //
339 //*****************************************************************************
340 
341 #endif //__SMBUS_NWK_H__
SMBus_State SMBus_NWK_targetProcessTimeout(SMBus *smbus)
Handles the SMBus protocol when a Timeout error is detected by PHY.
Definition: smbus_nwk.c:546
SMBus_State SMBus_NWK_targetProcessRx(SMBus *smbus, uint8_t data)
RX callback for SMBus target.
Definition: smbus_nwk.c:286
void SMBus_NWK_startRxTransfer(SMBus *smbus)
Start the RX transfer process.
Definition: smbus_nwk.c:94
void SMBus_NWK_startTxTransfer(SMBus *smbus)
Start the TX transfer process.
Definition: smbus_nwk.c:49
SMBus_State SMBus_NWK_targetArbLost(SMBus *smbus)
Handles the SMBus protocol when a Arbitration is lost by PHY.
Definition: smbus_nwk.c:533
SMBus_State SMBus_NWK_controllerProcessNACK(SMBus *smbus)
Handles the SMBus protocol when a NACK.
Definition: smbus_nwk.c:760
void SMBus_NWK_controllerReset(SMBus *smbus)
Resets the SMBus network layer.
Definition: smbus_nwk.c:739
void SMBus_NWK_controllerDisableHostNotify(SMBus *smbus)
Disable network functions for Host Notify.
Definition: smbus_nwk.c:781
SMBus_State SMBus_NWK_controllerTxDone(SMBus *smbus)
Process a Done condition, between restarts.
Definition: smbus_nwk.c:688
SMBus_State SMBus_NWK_targetProcessStart(SMBus *smbus, uint8_t addrRw)
Start callback for SMBus.
Definition: smbus_nwk.c:198
void SMBus_NWK_controllerEnableHostNotify(SMBus *smbus, uint8_t *buff)
Enable network functions for Host Notify.
Definition: smbus_nwk.c:776
SMBus_State
SMBus state sent to application layer.
Definition: smbus.h:512
uint16_t SMBus_NWK_getRxPayloadSize(SMBus *smbus)
Returns the number of received bytes from last transaction.
Definition: smbus_nwk.c:38
SMBus_State SMBus_NWK_controllerProcessTimeout(SMBus *smbus)
Handles the SMBus protocol when a Timeout error is detected by PHY.
Definition: smbus_nwk.c:748
SMBus_State SMBus_NWK_controllerProcessRx(SMBus *smbus, uint8_t data)
RX callback for SMBus controller.
Definition: smbus_nwk.c:561
SMBus_State SMBus_NWK_controllerProcessStop(SMBus *smbus)
Process a Stop condition.
Definition: smbus_nwk.c:701
Main SMBus object.
Definition: smbus.h:617
SMBus_State SMBus_NWK_targetProcessTx(SMBus *smbus, uint8_t *data)
TX callback for SMBus target.
Definition: smbus_nwk.c:387
SMBus_State SMBus_NWK_controllerProcessTx(SMBus *smbus, uint8_t *data)
TX callback for SMBus controller.
Definition: smbus_nwk.c:626
SMBus_State SMBus_NWK_targetProcessStop(SMBus *smbus)
Stop callback for SMBus-based protocol.
Definition: smbus_nwk.c:460
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale