S32 SDK
lin_common_api.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Freescale Semiconductor, Inc.
3  * Copyright 2016 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 
19 #ifndef LIN_COMMON_API_H
20 #define LIN_COMMON_API_H
21 
27 #include "lin.h"
28 
29 /*******************************************************************************
30  * Definitions
31  ******************************************************************************/
32 /* Define word status macro */
33 #define SAVE_CONFIG_SET 0x0040U
34 #define EVENT_TRIGGER_COLLISION_SET 0x0020U
35 #define BUS_ACTIVITY_SET 0x0010U
36 #define GO_TO_SLEEP_SET 0x0008U
37 #define OVERRUN 0x0004U
38 #define SUCCESSFULL_TRANSFER 0x0002U
39 #define ERROR_IN_RESPONSE 0x0001U
41 /*******************************************************************************
42  * API
43  ******************************************************************************/
44 
55 l_bool l_sys_init(void);
56 
59 #if (SUPPORT_MASTER_MODE == 1U)
60 
77 l_u8 l_sch_tick(l_ifc_handle iii);
78 
90 void l_sch_set(l_ifc_handle iii,
91  l_schedule_handle schedule_iii,
92  l_u8 entry);
93 
94 #endif /* End (SUPPORT_MASTER_MODE == 1U) */
95 
114 l_bool l_ifc_init(l_ifc_handle iii);
115 
116 #if (SUPPORT_MASTER_MODE == 1U)
117 
131 void l_ifc_goto_sleep(l_ifc_handle iii);
132 
133 #endif /* End (SUPPORT_MASTER_MODE == 1U) */
134 
141 void l_ifc_wake_up(l_ifc_handle iii);
142 
149 l_u16 l_ifc_read_status(l_ifc_handle iii);
150 
163 l_u16 l_sys_irq_disable(l_ifc_handle iii);
164 
171 void l_sys_irq_restore(l_ifc_handle iii);
172 
175 #endif /* LIN_COMMON_API_H */
176 
179 /******************************************************************************/
180 /* EOF */
181 /******************************************************************************/
l_u8 l_sch_tick(l_ifc_handle iii)
This function follows a schedule. When a frame becomes due, its transmission is initiated. When the end of the current schedule is reached, this function starts again at the beginning of the schedule.
void l_sch_set(l_ifc_handle iii, l_schedule_handle schedule_iii, l_u8 entry)
Set up the next schedule to be followed by the l_sch_tick function for a certain interface. The new schedule will be activated as soon as the current schedule reaches its next schedule entry point.
void l_ifc_wake_up(l_ifc_handle iii)
Transmit the wake up signal.
void l_sys_irq_restore(l_ifc_handle iii)
Enable LIN related IRQ.
l_bool l_ifc_init(l_ifc_handle iii)
Initialize the controller specified by name, i.e. sets up internal functions such as the baud rate...
l_bool l_sys_init(void)
This function performs the initialization of the LIN core; is the first call a user must use in the L...
unsigned char l_u8
Unsigned 8 bit integer Implements : l_u8_Class.
Definition: lin_types.h:30
void l_ifc_goto_sleep(l_ifc_handle iii)
Request slave nodes on the cluster connected to the interface to enter bus sleep mode by issuing one ...
bool l_bool
0 is false, and non-zero (>0) is true Implements : l_bool_Class
Definition: lin_types.h:48
l_u16 l_ifc_read_status(l_ifc_handle iii)
This function will return the status of the previous communication.
unsigned short int l_u16
Unsigned 16 bit integer Implements : l_u16_Class.
Definition: lin_types.h:36
l_u16 l_sys_irq_disable(l_ifc_handle iii)
Disable LIN related IRQ.