S32 SDK
lin_driver.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Freescale Semiconductor, Inc.
3  * Copyright 2016 - 2017 NXP
4  * All rights reserved.
5  *
6  * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
7  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
9  * IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
10  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
11  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
12  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
13  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
14  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
15  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
16  * THE POSSIBILITY OF SUCH DAMAGE.
17  */
18 
29 /*******************************************************************************
30  * Includes
31  ******************************************************************************/
32 #include "lin_driver.h"
33 #if (LPUART_INSTANCE_COUNT > 0U)
34  #include "lin_lpuart_driver.h"
35 #endif
36 
37 /*******************************************************************************
38  * Code
39  ******************************************************************************/
40 /*FUNCTION**********************************************************************
41  *
42  * Function Name : LIN_DRV_Init
43  * Description : This function initializes a LIN Hardware Interface for operation.
44  * This function will initialize the run-time state structure to keep track of
45  * the on-going transfers, ungate the clock to LIN Hardware Interface, initialize the
46  * module to user defined settings and default settings, configure the IRQ state
47  * structure and enable the module-level interrupt to the core, and enable the
48  * LIN Hardware Interface transmitter and receiver.
49  * The following is an example of how to set up the lin_state_t and the
50  * lin_user_config_t parameters and how to call the LIN_DRV_Init function
51  * by passing in these parameters:
52  * lin_user_config_t linUserConfig
53  * linUserConfig.baudRate = 9600
54  * linUserConfig.nodeFunction = SLAVE
55  * linUserConfig.autobaudEnable = true
56  * linUserConfig.timerGetTimeIntervalCallback = (lin_timer_get_time_interval_t) l_ifc_timerGetTimeIntervalCallbackHandler
57  * lin_state_t linState
58  * LIN_DRV_Init(instance, (lin_user_config_t *) &linUserConfig, (lin_state_t *) &linState)
59  *
60  * Implements : LIN_DRV_Init_Activity
61  *END**************************************************************************/
62 status_t LIN_DRV_Init(uint32_t instance,
63  lin_user_config_t * linUserConfig,
64  lin_state_t * linCurrentState)
65 {
67 
68 #if (LPUART_INSTANCE_COUNT > 0U)
69  retVal = LIN_LPUART_DRV_Init(instance, linUserConfig, linCurrentState);
70 #endif
71 
72  return retVal;
73 }
74 
75 /*FUNCTION**********************************************************************
76  *
77  * Function Name : LIN_DRV_Deinit
78  * Description : This function shuts down the LIN Hardware Interface by disabling interrupts and
79  * transmitter/receiver.
80  *
81  * Implements : LIN_DRV_Deinit_Activity
82  *END**************************************************************************/
83 status_t LIN_DRV_Deinit(uint32_t instance)
84 {
86 
87 #if (LPUART_INSTANCE_COUNT > 0U)
88  retVal = LIN_LPUART_DRV_Deinit(instance);
89 #endif
90 
91  return retVal;
92 }
93 
94 /*FUNCTION**********************************************************************
95  *
96  * Function Name : LIN_DRV_InstallCallback
97  * Description : This function installs the callback function that is used for LIN_DRV_IRQHandler.
98  * Pass in Null pointer as callback will uninstall.
99  *
100  * Implements : LIN_DRV_InstallCallback_Activity
101  *END**************************************************************************/
103  lin_callback_t function)
104 {
105  lin_callback_t retVal = NULL;
106 
107 #if (LPUART_INSTANCE_COUNT > 0U)
108  retVal = LIN_LPUART_DRV_InstallCallback(instance, function);
109 #endif
110 
111  return retVal;
112 }
113 
114 /*FUNCTION**********************************************************************
115  *
116  * Function Name : LIN_DRV_SendFrameDataBlocking
117  * Description : This function sends data out through the LIN Hardware Interface using
118  * blocking method. This function will calculate the checksum byte and send it with the
119  * frame data. Blocking means that the function does not return until the transmission is
120  * complete. This function checks if txSize is in range from 1 to 8.
121  * If not, it will return STATUS_ERROR. This function also checks if the isBusBusy
122  * is false, if not it will return STATUS_BUSY. The function does not return
123  * until the transmission is complete. If the transmission is successful, it
124  * will return STATUS_SUCCESS. If not, it will return STATUS_TIMEOUT.
125  *
126  * Implements : LIN_DRV_SendFrameDataBlocking_Activity
127  *END**************************************************************************/
129  const uint8_t * txBuff,
130  uint8_t txSize,
131  uint32_t timeoutMSec)
132 {
133  status_t retVal = STATUS_UNSUPPORTED;
134 
135 #if (LPUART_INSTANCE_COUNT > 0U)
136  retVal = LIN_LPUART_DRV_SendFrameDataBlocking(instance, txBuff, txSize, timeoutMSec);
137 #endif
138 
139  return retVal;
140 }
141 
142 /*FUNCTION**********************************************************************
143  *
144  * Function Name : LIN_DRV_SendFrameData
145  * Description : This function sends data out through the LIN Hardware Interface using
146  * non-blocking method. This function will calculate the checksum byte and send it with the
147  * frame data. The function will return immediately after calling this function. If txSize
148  * is equal to 0 or greater than 8 then the function will return STATUS_ERROR. If isBusBusy is
149  * currently true then the function will return STATUS_BUSY.
150  *
151  * Implements : LIN_DRV_SendFrameData_Activity
152  *END**************************************************************************/
153 status_t LIN_DRV_SendFrameData(uint32_t instance,
154  const uint8_t * txBuff,
155  uint8_t txSize)
156 {
157  status_t retVal = STATUS_UNSUPPORTED;
158 
159 #if (LPUART_INSTANCE_COUNT > 0U)
160  retVal = LIN_LPUART_DRV_SendFrameData(instance, txBuff, txSize);
161 #endif
162 
163  return retVal;
164 }
165 
166 /*FUNCTION**********************************************************************
167  *
168  * Function Name : LIN_DRV_GetTransmitStatus
169  * Description : This function returns whether the previous transmission has
170  * finished. When performing non-blocking transmit, the user can call this
171  * function to ascertain the state of the current transmission:
172  * in progress (or busy that STATUS_BUSY) or timeout (STATUS_TIMEOUT) or complete (success that is STATUS_SUCCESS).
173  * In addition, if the transmission is still in progress, the user can obtain the number
174  * of bytes that still needed to transmit.
175  *
176  * Implements : LIN_DRV_GetTransmitStatus_Activity
177  *END**************************************************************************/
179  uint8_t * bytesRemaining)
180 {
181  status_t retVal = STATUS_UNSUPPORTED;
182 
183 #if (LPUART_INSTANCE_COUNT > 0U)
184  retVal = LIN_LPUART_DRV_GetTransmitStatus(instance, bytesRemaining);
185 #endif
186 
187  return retVal;
188 }
189 
190 /*FUNCTION**********************************************************************
191  *
192  * Function Name : LIN_DRV_ReceiveFrameDataBlocking
193  * Description : This function receives data from LIN Hardware Interface module using blocking
194  * method. This function receives data from LPUART module using blocking
195  * method, the function does not return until the receive is complete. The interrupt
196  * handler LIN_LPUART_DRV_IRQHandler will check the checksum byte. If the checksum
197  * is correct, it will receive the frame data. If the checksum is incorrect, this
198  * function will return STATUS_TIMEOUT and data in rxBuff might be wrong. This function
199  * also check if rxSize is in range from 1 to 8. If not, it will return STATUS_ERROR.
200  * This function also checks if the isBusBusy is false, if not it will return
201  * STATUS_BUSY.
202  *
203  * Implements : LIN_DRV_ReceiveFrameDataBlocking_Activity
204  *END**************************************************************************/
206  uint8_t * rxBuff,
207  uint8_t rxSize,
208  uint32_t timeoutMSec)
209 {
210  status_t retVal = STATUS_UNSUPPORTED;
211 
212 #if (LPUART_INSTANCE_COUNT > 0U)
213  retVal = LIN_LPUART_DRV_RecvFrmDataBlocking(instance, rxBuff, rxSize, timeoutMSec);
214 #endif
215 
216  return retVal;
217 }
218 
219 /*FUNCTION**********************************************************************
220  *
221  * Function Name : LIN_DRV_ReceiveFrameData
222  * Description : This function receives data from LIN Hardware Interface using
223  * non-blocking method. This function will check the checksum byte. If the checksum is
224  * correct, it will receive it with the frame data.
225  * Non-blocking means that the function returns immediately.
226  * The application has to get the receive status to know when the reception is complete.
227  * The interrupt handler LIN_LPUART_DRV_IRQHandler will check the checksum byte. If the
228  * checksum is correct, it will receive the frame data. If the checksum is incorrect, this
229  * function will return STATUS_TIMEOUT and data in rxBuff might be wrong. This function also
230  * check if rxSize is in range from 1 to 8. If not, it will return STATUS_ERROR. This function
231  * also checks if the isBusBusy is false, if not it will return STATUS_BUSY.
232  *
233  * Implements : LIN_DRV_ReceiveFrameData_Activity
234  *END**************************************************************************/
236  uint8_t * rxBuff,
237  uint8_t rxSize)
238 {
239  status_t retVal = STATUS_UNSUPPORTED;
240 
241 #if (LPUART_INSTANCE_COUNT > 0U)
242  retVal = LIN_LPUART_DRV_RecvFrmData(instance, rxBuff, rxSize);
243 #endif
244 
245  return retVal;
246 }
247 
248 /*FUNCTION**********************************************************************
249  *
250  * Function Name : LIN_DRV_AbortTransferData
251  * Description : Aborts an on-going non-blocking transmission/reception.
252  * While performing a non-blocking transferring data, users can call this
253  * function to terminate immediately the transferring.
254  *
255  * Implements : LIN_DRV_AbortTransferData_Activity
256  *END**************************************************************************/
258 {
259  status_t retVal = STATUS_UNSUPPORTED;
260 
261 #if (LPUART_INSTANCE_COUNT > 0U)
262  retVal = LIN_LPUART_DRV_AbortTransferData(instance);
263 #endif
264 
265  return retVal;
266 }
267 
268 /*FUNCTION**********************************************************************
269  *
270  * Function Name : LIN_DRV_GetReceiveStatus
271  * Description : This function returns whether the data reception is complete.
272  * When performing non-blocking transmit, the user can call this function to
273  * ascertain the state of the current receive progress:
274  * in progress (STATUS_BUSY) or timeout (STATUS_TIMEOUT) or complete (STATUS_SUCCESS).
275  * In addition, if the reception is still in progress, the user can obtain the
276  * number of bytes that still needed to receive.
277  *
278  * Implements : LIN_DRV_GetReceiveStatus_Activity
279  *END**************************************************************************/
281  uint8_t * bytesRemaining)
282 {
283  status_t retVal = STATUS_UNSUPPORTED;
284 
285 #if (LPUART_INSTANCE_COUNT > 0U)
286  retVal = LIN_LPUART_DRV_GetReceiveStatus(instance, bytesRemaining);
287 #endif
288 
289  return retVal;
290 }
291 
292 /*FUNCTION**********************************************************************
293  *
294  * Function Name : LIN_DRV_GoToSleepMode
295  * Description : This function puts current LIN node to sleep mode.
296  * This function changes current node state to LIN_NODE_STATE_SLEEP_MODE.
297  *
298  * Implements : LIN_DRV_GoToSleepMode_Activity
299  *END**************************************************************************/
300 status_t LIN_DRV_GoToSleepMode(uint32_t instance)
301 {
302  status_t retVal = STATUS_UNSUPPORTED;
303 
304 #if (LPUART_INSTANCE_COUNT > 0U)
305  retVal = LIN_LPUART_DRV_GoToSleepMode(instance);
306 #endif
307 
308  return retVal;
309 }
310 
311 /*FUNCTION**********************************************************************
312  *
313  * Function Name : LIN_DRV_GotoIdleState
314  * Description : This function puts current node to Idle state.
315  *
316  * Implements : LIN_DRV_GoToIdleState_Activity
317  *END**************************************************************************/
318 status_t LIN_DRV_GotoIdleState(uint32_t instance)
319 {
320  status_t retVal = STATUS_UNSUPPORTED;
321 
322 #if (LPUART_INSTANCE_COUNT > 0U)
323  retVal = LIN_LPUART_DRV_GotoIdleState(instance);
324 #endif
325 
326  return retVal;
327 }
328 
329 /*FUNCTION**********************************************************************
330  *
331  * Function Name : LIN_DRV_SendWakeupSignal
332  * Description : This function sends a wakeup signal through the LPUART interface.
333  *
334  * Implements : LIN_DRV_SendWakeupSignal_Activity
335  *END**************************************************************************/
337 {
338  status_t retVal = STATUS_UNSUPPORTED;
339 
340 #if (LPUART_INSTANCE_COUNT > 0U)
341  retVal = LIN_LPUART_DRV_SendWakeupSignal(instance);
342 #endif
343 
344  return retVal;
345 }
346 
347 /*FUNCTION**********************************************************************
348  *
349  * Function Name : LIN_DRV_GetCurrentNodeState
350  * Description : This function gets the current LIN node state.
351  *
352  * Implements : LIN_DRV_GetCurrentNodeState_Activity
353  *END**************************************************************************/
355 {
357 
358 #if (LPUART_INSTANCE_COUNT > 0U)
359  retVal = LIN_LPUART_DRV_GetCurrentNodeState(instance);
360 #endif
361 
362  return retVal;
363 }
364 
365 /*FUNCTION**********************************************************************
366  *
367  * Function Name : LIN_DRV_TimeoutService
368  * Description : This is callback function for Timer Interrupt Handler.
369  * Users shall initialize a timer (for example FTM) in Output compare mode
370  * with period of 500 micro seconds. In timer IRQ handler, call this function.
371  *
372  * Implements : LIN_DRV_TimeoutService_Activity
373  *END**************************************************************************/
374 void LIN_DRV_TimeoutService(uint32_t instance)
375 {
376 #if (LPUART_INSTANCE_COUNT > 0U)
378 #endif
379 }
380 
381 /*FUNCTION**********************************************************************
382  *
383  * Function Name : LIN_DRV_SetTimeoutCounter
384  * Description : This function sets value for timeout counter that is used in
385  * LIN_DRV_TimeoutService
386  *
387  * Implements : LIN_DRV_SetTimeoutCounter_Activity
388  *END**************************************************************************/
389 void LIN_DRV_SetTimeoutCounter(uint32_t instance,
390  uint32_t timeoutValue)
391 {
392 #if (LPUART_INSTANCE_COUNT > 0U)
393  LIN_LPUART_DRV_SetTimeoutCounter(instance, timeoutValue);
394 #endif
395 }
396 
397 /*FUNCTION**********************************************************************
398  *
399  * Function Name : LIN_DRV_MasterSendHeader
400  * Description : This function sends frame header out through the LIN Hardware Interface
401  * using a non-blocking method. Non-blocking means that the function returns
402  * immediately. This function sends LIN Break field, sync field then the ID with
403  * correct parity. This function checks if the interface is Master, if not, it will
404  * return STATUS_ERROR.This function checks if id is in range from 0 to 0x3F, if not
405  * it will return STATUS_ERROR.
406  *
407  * Implements : LIN_DRV_MasterSendHeader_Activity
408  *END**************************************************************************/
410  uint8_t id)
411 {
412  status_t retVal = STATUS_UNSUPPORTED;
413 
414 #if (LPUART_INSTANCE_COUNT > 0U)
415  retVal = LIN_LPUART_DRV_MasterSendHeader(instance, id);
416 #endif
417 
418  return retVal;
419 }
420 
421 /*FUNCTION**********************************************************************
422  *
423  * Function Name : LIN_DRV_EnableIRQ
424  * Description : This function enables LIN hardware interrupts.
425  *
426  * Implements : LIN_DRV_EnableIRQ_Activity
427  *END**************************************************************************/
428 status_t LIN_DRV_EnableIRQ(uint32_t instance)
429 {
430  status_t retVal = STATUS_UNSUPPORTED;
431 
432 #if (LPUART_INSTANCE_COUNT > 0U)
433  retVal = LIN_LPUART_DRV_EnableIRQ(instance);
434 #endif
435 
436  return retVal;
437 }
438 
439 /*FUNCTION**********************************************************************
440  *
441  * Function Name : LIN_DRV_DisableIRQ
442  * Description : This function disables LIN hardware interrupts.
443  *
444  * Implements : LIN_DRV_DisableIRQ_Activity
445  *END**************************************************************************/
446 status_t LIN_DRV_DisableIRQ(uint32_t instance)
447 {
448  status_t retVal = STATUS_UNSUPPORTED;
449 
450 #if (LPUART_INSTANCE_COUNT > 0U)
451  retVal = LIN_LPUART_DRV_DisableIRQ(instance);
452 #endif
453 
454  return retVal;
455 }
456 
457 /*FUNCTION**********************************************************************
458  *
459  * Function Name : LIN_DRV_IRQHandler
460  * Description : Interrupt handler for LIN Hardware Interface.
461  * This is not a public API as it is called by IRQ whenever an interrupt
462  * occurs.
463  *
464  * Implements : LIN_DRV_IRQHandler_Activity
465  *END**************************************************************************/
466 void LIN_DRV_IRQHandler(uint32_t instance)
467 {
468 #if (LPUART_INSTANCE_COUNT > 0U)
469  LIN_LPUART_DRV_IRQHandler(instance);
470 #endif
471 }
472 
473  /*FUNCTION**********************************************************************
474  *
475  * Function Name : LIN_DRV_AutoBaudCapture
476  * Description : This function capture bits time to detect break char, calculate
477  * baudrate from sync bits and enable transceiver if autobaud successful.
478  * This function should only be used in Slave.
479  * The timer should be in mode input capture of both rising and falling edges.
480  * The timer input capture pin should be externally connected to RXD pin.
481  *
482  * Implements : LIN_DRV_AutoBaudCapture_Activity
483  *END**************************************************************************/
485 {
486  status_t retVal = STATUS_UNSUPPORTED;
487 
488 #if (LPUART_INSTANCE_COUNT > 0U)
489  retVal = LIN_LPUART_DRV_AutoBaudCapture(instance);
490 #endif
491 
492  return retVal;
493 }
494 
495 /*******************************************************************************
496  * EOF
497  ******************************************************************************/
lin_node_state_t
Define type for an enumerating LIN Node state. Implements : lin_node_state_t_Class.
Definition: lin_driver.h:97
status_t LIN_DRV_Init(uint32_t instance, lin_user_config_t *linUserConfig, lin_state_t *linCurrentState)
Initializes an instance LIN Hardware Interface for LIN Network.
Definition: lin_driver.c:62
status_t LIN_LPUART_DRV_Init(uint32_t instance, lin_user_config_t *linUserConfig, lin_state_t *linCurrentState)
Initializes an LIN_LPUART instance for LIN Network.
void LIN_DRV_IRQHandler(uint32_t instance)
Interrupt handler for LIN Hardware Interface.
Definition: lin_driver.c:466
status_t LIN_LPUART_DRV_SendWakeupSignal(uint32_t instance)
Sends a wakeup signal through the LIN_LPUART interface.
status_t LIN_LPUART_DRV_SendFrameDataBlocking(uint32_t instance, const uint8_t *txBuff, uint8_t txSize, uint32_t timeoutMSec)
Sends Frame data out through the LIN_LPUART module using blocking method. This function will calculat...
status_t LIN_LPUART_DRV_SendFrameData(uint32_t instance, const uint8_t *txBuff, uint8_t txSize)
Sends frame data out through the LIN_LPUART module using non-blocking method. This enables an a-sync ...
void(* lin_callback_t)(uint32_t instance, void *linState)
LIN Driver callback function type Implements : lin_callback_t_Class.
Definition: lin_driver.h:115
status_t LIN_DRV_ReceiveFrameData(uint32_t instance, uint8_t *rxBuff, uint8_t rxSize)
Receives frame data through the LIN Hardware Interface using non-blocking method. This function will ...
Definition: lin_driver.c:235
status_t LIN_LPUART_DRV_GoToSleepMode(uint32_t instance)
This function puts current node to sleep mode This function changes current node state to LIN_NODE_ST...
status_t LIN_DRV_SendWakeupSignal(uint32_t instance)
Sends a wakeup signal through the LIN Hardware Interface.
Definition: lin_driver.c:336
status_t LIN_DRV_Deinit(uint32_t instance)
Shuts down the LIN Hardware Interface by disabling interrupts and transmitter/receiver.
Definition: lin_driver.c:83
status_t LIN_DRV_DisableIRQ(uint32_t instance)
Disables LIN hardware interrupts.
Definition: lin_driver.c:446
status_t LIN_LPUART_DRV_GetTransmitStatus(uint32_t instance, uint8_t *bytesRemaining)
Get status of an on-going non-blocking transmission While sending frame data using non-blocking metho...
status_t LIN_LPUART_DRV_DisableIRQ(uint32_t instance)
Disables LIN_LPUART hardware interrupts.
void LIN_DRV_SetTimeoutCounter(uint32_t instance, uint32_t timeoutValue)
Set Value for Timeout Counter that is used in LIN_DRV_TimeoutService.
Definition: lin_driver.c:389
status_t LIN_LPUART_DRV_AutoBaudCapture(uint32_t instance)
LIN_LPUART capture time interval to set baudrate automatically when enable autobaud feature...
void LIN_LPUART_DRV_SetTimeoutCounter(uint32_t instance, uint32_t timeoutValue)
Set Value for Timeout Counter that is used in LIN_LPUART_DRV_TimeoutService.
status_t LIN_DRV_MasterSendHeader(uint32_t instance, uint8_t id)
Sends frame header out through the LIN Hardware Interface using a non-blocking method. This function sends LIN Break field, sync field then the ID with correct parity. This function checks if the interface is Master, if not, it will return STATUS_ERROR.This function checks if id is in range from 0 to 0x3F, if not it will return STATUS_ERROR.
Definition: lin_driver.c:409
lin_callback_t LIN_DRV_InstallCallback(uint32_t instance, lin_callback_t function)
Installs callback function that is used for LIN_DRV_IRQHandler.
Definition: lin_driver.c:102
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:31
status_t LIN_DRV_AbortTransferData(uint32_t instance)
Aborts an on-going non-blocking transmission/reception. While performing a non-blocking transferring ...
Definition: lin_driver.c:257
status_t LIN_DRV_GetTransmitStatus(uint32_t instance, uint8_t *bytesRemaining)
Get status of an on-going non-blocking transmission While sending frame data using non-blocking metho...
Definition: lin_driver.c:178
status_t LIN_DRV_AutoBaudCapture(uint32_t instance)
Captures time interval to capture baudrate automatically when enable autobaud feature. This function should only be used in Slave. The timer should be in input capture mode of both rising and falling edges. The timer input capture pin should be externally connected to RXD pin.
Definition: lin_driver.c:484
void LIN_DRV_TimeoutService(uint32_t instance)
Callback function for Timer Interrupt Handler Users may use (optional, not required) LIN_DRV_TimeoutS...
Definition: lin_driver.c:374
lin_node_state_t LIN_DRV_GetCurrentNodeState(uint32_t instance)
Get the current LIN node state.
Definition: lin_driver.c:354
status_t LIN_DRV_GetReceiveStatus(uint32_t instance, uint8_t *bytesRemaining)
Get status of an on-going non-blocking reception. This function returns whether the data reception is...
Definition: lin_driver.c:280
void LIN_LPUART_DRV_TimeoutService(uint32_t instance)
Callback function for Timer Interrupt Handler Users shall initialize a timer (for example FTM) in Out...
status_t LIN_LPUART_DRV_GetReceiveStatus(uint32_t instance, uint8_t *bytesRemaining)
Get status of an on-going non-blocking reception While receiving frame data using non-blocking method...
Runtime state of the LIN driver.
Definition: lin_driver.h:124
status_t LIN_DRV_SendFrameData(uint32_t instance, const uint8_t *txBuff, uint8_t txSize)
Sends frame data out through the LIN Hardware Interface using non-blocking method. This enables an a-sync method for transmitting data. Non-blocking means that the function returns immediately. The application has to get the transmit status to know when the transmit is complete. This function will calculate the checksum byte and send it with the frame data. The function will return immediately after calling this function. If txSize is equal to 0 or greater than 8 or node's current state is in SLEEP mode then the function will return STATUS_ERROR. If isBusBusy is currently true then the function will return LIN_BUS_BUSY.
Definition: lin_driver.c:153
LIN hardware configuration structure Implements : lin_user_config_t_Class.
Definition: lin_driver.h:66
status_t LIN_DRV_ReceiveFrameDataBlocking(uint32_t instance, uint8_t *rxBuff, uint8_t rxSize, uint32_t timeoutMSec)
Receives frame data through the LIN Hardware Interface using blocking method. This function receives ...
Definition: lin_driver.c:205
status_t LIN_LPUART_DRV_RecvFrmData(uint32_t instance, uint8_t *rxBuff, uint8_t rxSize)
Receives frame data through the LIN_LPUART module using non-blocking method. This function returns im...
status_t LIN_DRV_GoToSleepMode(uint32_t instance)
Puts current LIN node to sleep mode This function changes current node state to LIN_NODE_STATE_SLEEP_...
Definition: lin_driver.c:300
lin_node_state_t LIN_LPUART_DRV_GetCurrentNodeState(uint32_t instance)
Get the current LIN node state.
status_t LIN_LPUART_DRV_GotoIdleState(uint32_t instance)
Puts current LIN node to Idle state This function changes current node state to LIN_NODE_STATE_IDLE.
status_t LIN_LPUART_DRV_AbortTransferData(uint32_t instance)
Aborts an on-going non-blocking transmission/reception. While performing a non-blocking transferring ...
status_t LIN_LPUART_DRV_MasterSendHeader(uint32_t instance, uint8_t id)
Sends frame header out through the LIN_LPUART module using a non-blocking method. This function sends...
void LIN_LPUART_DRV_IRQHandler(uint32_t instance)
LIN_LPUART interrupt handler for RX_TX and Error interrupts.
status_t LIN_LPUART_DRV_EnableIRQ(uint32_t instance)
Enables LIN_LPUART hardware interrupts.
status_t LIN_LPUART_DRV_Deinit(uint32_t instance)
Shuts down the LIN_LPUART by disabling interrupts and transmitter/receiver.
status_t LIN_DRV_SendFrameDataBlocking(uint32_t instance, const uint8_t *txBuff, uint8_t txSize, uint32_t timeoutMSec)
Sends Frame data out through the LIN Hardware Interface using blocking method. This function will cal...
Definition: lin_driver.c:128
status_t LIN_LPUART_DRV_RecvFrmDataBlocking(uint32_t instance, uint8_t *rxBuff, uint8_t rxSize, uint32_t timeoutMSec)
Receives frame data through the LIN_LPUART module using blocking method. The function does not return...
status_t LIN_DRV_GotoIdleState(uint32_t instance)
Puts current LIN node to Idle state This function changes current node state to LIN_NODE_STATE_IDLE.
Definition: lin_driver.c:318
lin_callback_t LIN_LPUART_DRV_InstallCallback(uint32_t instance, lin_callback_t function)
Installs callback function that is used for LIN_LPUART_DRV_IRQHandler.
status_t LIN_DRV_EnableIRQ(uint32_t instance)
Enables LIN hardware interrupts.
Definition: lin_driver.c:428