• 大小: 653KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-18
  • 语言: 其他
  • 标签: lin  

资源简介

飞思卡尔lin主节点与从节点源码,已调通,适合汽车行业LIN总线

资源截图

代码片段和文件信息

#define LINPROT_C
/******************************************************************************
*
*       Copyright (C) 2003 Motorola Inc.
*       All Rights Reserved
*
* Filename:     $RCSfile: linapi.cv $
* Author:       $Author: ttz778 $
* Locker:       $Locker:  $
* State:        $State: Exp $
* Revision:     $Revision: 1.0 $
*
* Functions:    LIN API realization
*
* History:      Use the RCS command log to display revision history
*               information.
*
* Description:  Some Motorola and VCT API functions realization
*
* Notes:        Realization of another API functions -- in another modules
*
******************************************************************************/

#include se.h>

#if defined(LINAPI_1_0)

/***************************************************************************
 * Function :   l_ifc_ioctl_sci0
 *
 * Description: Protocol-specific functionality.
 * 
 * Returns:     depends on the operation
 *
 * Notes:       Operations:
 *  l_op_getrxerr   -- Provide the Receive Errors counter of the LIN Driver 
 *  l_op_gettxerr   -- Provide the Transmit Errors counter of the LIN Driver 
 *  l_op_clrrxerr   -- Clear the Receive Errors counter of the LIN Driver 
 *  l_op_clrtxerr   -- Clear the Transmit Errors counter of the LIN Driver 
 *  l_op_wakeup     -- Issues the LIN bus wakeup frame transmission 
 *  l_op_getidle    -- Check 揘o-Bus-Activity?condition 
 *  l_op_idleclock  -- Update 揘o-Bus-Activity?condition counter by 1 
 *
 **************************************************************************/
void l_ifc_ioctl_sci0(i_ioctl_op op void *pv)
{
    LIN_BYTE        intMask;

    LIN_DBG_SET_PORT_7;

    intMask = LIN_DisableInt();         /* Disable interrupts */

    /* OPTIM:
        switch  -- for COSMIC08 (5 bytes less);
        if      -- for HICROSS08 */

    if (op == l_op_getrxerr)
    {
        *( (LINErrCounterType*) pv) = LIN_ErrRxCounter;
    }

    else if (op == l_op_gettxerr)
    {
        *( (LINErrCounterType*) pv) = LIN_ErrTxCounter;
    }

    else if (op == l_op_clrrxerr)
    {
        LIN_ErrRxCounter = 0;
    }

    else if (op == l_op_clrtxerr)
    {
        LIN_ErrTxCounter = 0;
    }

    else if (op == l_op_wakeup)
    {
        /* possible only if we are connected and doing nothing */
        if ( ( (LIN_StateFlags & LIN_FLAG_DISCONNECT)  == 0 ) && 
             ( (LIN_StateFlags & LIN_FLAG_IGNORE) != 0 ) )
        {
            LIN_StateFlags = LIN_FLAG_WAKEUP_TIMEOUT;

            /* send Wakeup message */    
            LIN_SCISendWakeup();

            /* wait for Tx completed interrupt. All others interrupt should be ignored */
            /* timeout is not required */
            
            *( (l_bool*) pv) = 0;    /* success */
        }
        else
        {
            *( (l_bool*) pv) = ~0;   /* pending or SCI disconnected*/
        }
    }

    else if (op == l_op_get

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     103476  2005-10-12 13:34  AN3147SW\SW\LIN_Master_9S12C32\bin\LIN_master_9S12C32.abs

     文件         12  2005-06-17 09:38  AN3147SW\SW\LIN_Master_9S12C32\bin\LIN_master_9S12C32.bpt

     文件         21  2005-06-17 09:38  AN3147SW\SW\LIN_Master_9S12C32\bin\LIN_master_9S12C32.mrk

     文件       6958  2005-10-12 13:34  AN3147SW\SW\LIN_Master_9S12C32\bin\LIN_master_9S12C32.sx

     文件       2658  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\cmd\p&e_erase_unsecure_hcs12.cmd

     文件        281  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\cmd\p&e_postload.cmd

     文件        371  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\cmd\p&e_preload.cmd

     文件         63  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\cmd\p&e_reset.cmd

     文件         59  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\cmd\p&e_startup.cmd

     文件         75  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\cmd\p&e_vppoff.cmd

     文件         76  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\cmd\p&e_vppon.cmd

     文件      10105  2005-06-16 09:41  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\Project.pmp

     文件         60  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\bar_0.gif

     文件         53  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\bar_l.gif

     文件         71  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\bar_p.gif

     文件         56  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\bar_r.gif

     文件       3212  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\fs_logo.png

     文件       1788  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\LINlogo.gif

     文件        279  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\main.css

     文件      24636  2005-06-28 13:33  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\OUTcontrol.html

     文件      36592  2005-06-16 13:29  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\WLcontrol.html

     文件      16651  2005-07-07 09:38  AN3147SW\SW\LIN_Master_9S12C32\FreeMaster\src\WLparamConfig.html

     文件       3552  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\linapi.h

     文件       1041  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\linbase.h

     文件       2195  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\lincfg.h

     文件       3957  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\lindbg.h

     文件       2331  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\lindef.h

     文件       2980  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\linerr.h

     文件       1224  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\lininit.h

     文件       2654  2005-05-16 09:01  AN3147SW\SW\LIN_Master_9S12C32\lin_inc\linmsg.h

............此处省略220个文件信息

评论

共有 条评论