File syn_lintp.h¶
FileList > proto > syn_lintp.h
Go to the source code of this file
ISO 17987-2 (LIN Transport Layer & Network Layer Services / UDSonLIN). More...
#include "../common/syn_defs.h"#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_LINTP_Link LIN TP Link Context structure. |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_LINTP_State LIN TP Link State Machine State Enumeration. |
Public Functions¶
| Type | Name |
|---|---|
| bool | syn_lintp_get_tx_frame (SYN_LINTP_Link * link, uint8_t out_frame) Retrieve next queued 8-byte LIN diagnostic payload to transmit on bus (0x3C / 0x3D). |
| void | syn_lintp_init (SYN_LINTP_Link * link, uint8_t nad, uint8_t * rx_buf, size_t rx_size, uint8_t * tx_buf, size_t tx_size) Initialize LIN TP Link context. |
| bool | syn_lintp_is_tx_idle (const SYN_LINTP_Link * link) Check if LIN TP TX engine is idle and ready for new message. |
| void | syn_lintp_process_rx_frame (SYN_LINTP_Link * link, const uint8_t frame) Process an incoming 8-byte LIN diagnostic frame received from bus (0x3C / 0x3D). |
| ssize_t | syn_lintp_receive (SYN_LINTP_Link * link, uint8_t * out_buf, size_t max_len) Read a fully reassembled message payload from the LIN TP receiver. |
| SYN_Status | syn_lintp_send (SYN_LINTP_Link * link, uint8_t nad, const uint8_t * payload, size_t len) Queue a message for multi-frame or single-frame LIN TP transmission. |
| void | syn_lintp_set_padding (SYN_LINTP_Link * link, uint8_t pad_byte) Configure padding byte value for unused frame bytes. |
| void | syn_lintp_set_timeouts (SYN_LINTP_Link * link, uint32_t n_as_ms, uint32_t n_cr_ms) Configure LIN TP timeouts in milliseconds. |
| void | syn_lintp_step (SYN_LINTP_Link * link, uint32_t dt_ms) Step LIN TP timers by dt_ms. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_LINTP_NAD_BROADCAST 0x7F |
| define | SYN_LINTP_NAD_FUNCTIONAL 0x7E |
| define | SYN_LINTP_PCI_CF 0x02 |
| define | SYN_LINTP_PCI_FF 0x01 |
| define | SYN_LINTP_PCI_SF 0x00 |
| define | SYN_LIN_ID_MASTER_REQ 0x3C |
| define | SYN_LIN_ID_SLAVE_RESP 0x3D |
Detailed Description¶
Provides non-blocking, zero-allocation ISO 17987-2 LIN Transport Protocol segmentation and reassembly engine for multi-byte LIN payload transmission using Single Frame (SF), First Frame (FF), and Consecutive Frame (CF).
Operates without Flow Control (FC) frames per ISO 17987-2 & ISO 14229-7.
Public Types Documentation¶
enum SYN_LINTP_State¶
LIN TP Link State Machine State Enumeration.
enum SYN_LINTP_State {
SYN_LINTP_STATE_IDLE = 0,
SYN_LINTP_STATE_TRANSMITTING_FF,
SYN_LINTP_STATE_TRANSMITTING_CF,
SYN_LINTP_STATE_RECEIVING_CF
};
Public Functions Documentation¶
function syn_lintp_get_tx_frame¶
Retrieve next queued 8-byte LIN diagnostic payload to transmit on bus (0x3C / 0x3D).
Parameters:
linkPointer to LIN TP link context.out_frameArray of 8 bytes to receive frame data.
Returns:
true if a frame was ready and copied, false otherwise.
function syn_lintp_init¶
Initialize LIN TP Link context.
void syn_lintp_init (
SYN_LINTP_Link * link,
uint8_t nad,
uint8_t * rx_buf,
size_t rx_size,
uint8_t * tx_buf,
size_t tx_size
)
Parameters:
linkPointer to LIN TP link structure.nadNode Address (NAD) for this device (0x01..0x7D).rx_bufPointer to buffer for storing received payloads.rx_sizeSize of RX buffer.tx_bufPointer to buffer reserved for TX (optional context pointer).tx_sizeSize of TX buffer.
function syn_lintp_is_tx_idle¶
Check if LIN TP TX engine is idle and ready for new message.
Parameters:
linkPointer to LIN TP link context.
Returns:
true if idle, false if actively transmitting a message.
function syn_lintp_process_rx_frame¶
Process an incoming 8-byte LIN diagnostic frame received from bus (0x3C / 0x3D).
Parameters:
linkPointer to LIN TP link context.framePointer to 8-byte received LIN frame payload.
function syn_lintp_receive¶
Read a fully reassembled message payload from the LIN TP receiver.
Parameters:
linkPointer to LIN TP link context.out_bufBuffer to receive assembled payload.max_lenMaximum bytes to copy.
Returns:
Number of payload bytes read, 0 if no complete message ready, or negative error code.
function syn_lintp_send¶
Queue a message for multi-frame or single-frame LIN TP transmission.
SYN_Status syn_lintp_send (
SYN_LINTP_Link * link,
uint8_t nad,
const uint8_t * payload,
size_t len
)
Parameters:
linkPointer to LIN TP link context.nadDestination NAD.payloadPointer to payload bytes to send.lenPayload length in bytes (1..4095).
Returns:
SYN_OK on success, or error status code.
function syn_lintp_set_padding¶
Configure padding byte value for unused frame bytes.
Parameters:
linkPointer to LIN TP link context.pad_byteFill byte value (default 0xFF).
function syn_lintp_set_timeouts¶
Configure LIN TP timeouts in milliseconds.
Parameters:
linkPointer to LIN TP link context.n_as_msMax frame TX time (default 1000ms).n_cr_msMax time between consecutive RX frames (default 1000ms).
function syn_lintp_step¶
Step LIN TP timers by dt_ms.
Parameters:
linkPointer to LIN TP link context.dt_msMilliseconds elapsed since last step call.
Macro Definition Documentation¶
define SYN_LINTP_NAD_BROADCAST¶
Broadcast Diagnostic Address
define SYN_LINTP_NAD_FUNCTIONAL¶
Functional Diagnostic Address
define SYN_LINTP_PCI_CF¶
Consecutive Frame PCI type (0x2X)
define SYN_LINTP_PCI_FF¶
First Frame PCI type (0x1X)
define SYN_LINTP_PCI_SF¶
Single Frame PCI type (0x0X)
define SYN_LIN_ID_MASTER_REQ¶
Master Request LIN Frame ID
define SYN_LIN_ID_SLAVE_RESP¶
Slave Response LIN Frame ID
The documentation for this class was generated from the following file src/syntropic/proto/syn_lintp.h