Functions | |
l_bool | l_ifc_init (l_ifc_handle iii, mtb_stc_lin_context_t *context, cyhal_gpio_t tx, cyhal_gpio_t rx) |
The function initializes the LIN Slave middleware instance specified by the context. More... | |
void | l_ifc_wake_up (l_ifc_handle iii, const mtb_stc_lin_context_t *context) |
This function transmits one wake-up signal. More... | |
mtb_lin_status_t | l_ifc_ioctl (l_ifc_handle iii, l_ioctl_op op, void *pv, mtb_stc_lin_context_t *context) |
This function controls functionality not covered by the other API calls. More... | |
void | l_ifc_rx (l_ifc_handle iii, mtb_stc_lin_context_t *context) |
The application program is responsible for binding the interrupt and for setting the correct interface handle. More... | |
void | l_ifc_tx (l_ifc_handle iii, mtb_stc_lin_context_t *context) |
The application program is responsible for binding the interrupt and for setting the correct interface handle. More... | |
void | l_ifc_aux (l_ifc_handle iii, mtb_stc_lin_context_t *context) |
This function may be used to synchronize the break/sync field sequence transmitted by Master node on the interface specified by iii. More... | |
l_u16 | l_ifc_read_status (l_ifc_handle iii, mtb_stc_lin_context_t *context) |
This function is defined by the LIN specification. More... | |
mtb_lin_status_t | mtb_lin_config_check_nad (l_u8 nad, const mtb_stc_lin_config_t *config) |
This function validates if preserved Node Address values are not used as NAD for Slave node. More... | |
l_bool l_ifc_init | ( | l_ifc_handle | iii, |
mtb_stc_lin_context_t * | context, | ||
cyhal_gpio_t | tx, | ||
cyhal_gpio_t | rx | ||
) |
The function initializes the LIN Slave middleware instance specified by the context.
iii | The name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle. |
context | The pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure. |
tx | The TX pin name. |
rx | The RX pin name. |
void l_ifc_wake_up | ( | l_ifc_handle | iii, |
const mtb_stc_lin_context_t * | context | ||
) |
This function transmits one wake-up signal.
The wake-up signal is transmitted directly when this function is called. When you call this API function, the application is blocked until the wake-up signal is transmitted to the LIN bus. The Cy_SysLib_Delay() function is used as the timing source. The delay is calculated based on the clock configuration.
iii | The name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle. |
context | The pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure. |
mtb_lin_status_t l_ifc_ioctl | ( | l_ifc_handle | iii, |
l_ioctl_op | op, | ||
void * | pv, | ||
mtb_stc_lin_context_t * | context | ||
) |
This function controls functionality not covered by the other API calls.
It is used for protocol specific parameters or hardware specific functionality. An example of such functionality can be switching on/off the wake-up signal detection.
iii | The name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle. |
op | The operation to be applied Parameters of l_ifc_ioctl. |
pv | The pointer to the optional parameter. See Parameters of l_ifc_ioctl. |
context | The pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure. |
void l_ifc_rx | ( | l_ifc_handle | iii, |
mtb_stc_lin_context_t * | context | ||
) |
The application program is responsible for binding the interrupt and for setting the correct interface handle.
It may be called from a user-defined interrupt handler triggered by a UART when it receives one character of data.
iii | The name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle. |
context | The pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure. |
void l_ifc_tx | ( | l_ifc_handle | iii, |
mtb_stc_lin_context_t * | context | ||
) |
The application program is responsible for binding the interrupt and for setting the correct interface handle.
It may be called from a user-defined interrupt handler triggered by a UART when it has transmitted one character of data. In this case, the function will perform necessary operations on the UART control registers
iii | The name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle. |
context | The pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure. |
void l_ifc_aux | ( | l_ifc_handle | iii, |
mtb_stc_lin_context_t * | context | ||
) |
This function may be used to synchronize the break/sync field sequence transmitted by Master node on the interface specified by iii.
It may, for example, be called from a user-defined interrupt handler raised upon a flank detection on a hardware pin connected to the interface iii.
iii | The name of the interface handle See l_ifc_handle. |
context | The pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure. |
l_u16 l_ifc_read_status | ( | l_ifc_handle | iii, |
mtb_stc_lin_context_t * | context | ||
) |
This function is defined by the LIN specification.
This returns the status of the specified LIN interface and clears all status bits for that interface. See Section 7.2.5.8 of the LIN 2.1 specification.
iii | The name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle. |
context | The pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure. |
Bits | Meaning ----------— |
---|---|
[15:8] | Last Received PID |
[7] | 0 |
[6] | Save Configuration flag |
[5] | 0 |
[4] | Bus Activity flag |
[3] | Go To Sleep flag |
[2] | Overrun flag |
[1] | Successful Transfer flag |
[0] | Error in Response flag |
mtb_lin_status_t mtb_lin_config_check_nad | ( | l_u8 | nad, |
const mtb_stc_lin_config_t * | config | ||
) |
This function validates if preserved Node Address values are not used as NAD for Slave node.
For more details about allowable NAD, see specification LIN 2.2A, chapter 4.2.3.2 NAD.
nad | This field defines Node Address for validation. |
config | The pointer to the LIN configuration structure. |