William Kane / Generic

Dependents:   LaserioLib

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers abcc_handler_ser.c Source File

abcc_handler_ser.c

00001 /*******************************************************************************
00002 ********************************************************************************
00003 **                                                                            **
00004 ** ABCC Driver version 4.01.01 (2015-12-14)                                   **
00005 **                                                                            **
00006 ** Delivered with:                                                            **
00007 **    ABP         7.16.01 (2015-10-14)                                        **
00008 **                                                                            */
00009 /*******************************************************************************
00010 ********************************************************************************
00011 ** COPYRIGHT NOTIFICATION (c) 2013 HMS Industrial Networks AB                 **
00012 **                                                                            **
00013 ** This code is the property of HMS Industrial Networks AB.                   **
00014 ** The source code may not be reproduced, distributed, or used without        **
00015 ** permission. When used together with a product from HMS, permission is      **
00016 ** granted to modify, reproduce and distribute the code in binary form        **
00017 ** without any restrictions.                                                  **
00018 **                                                                            **
00019 ** THE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. HMS DOES NOT    **
00020 ** WARRANT THAT THE FUNCTIONS OF THE CODE WILL MEET YOUR REQUIREMENTS, OR     **
00021 ** THAT THE OPERATION OF THE CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR     **
00022 ** THAT DEFECTS IN IT CAN BE CORRECTED.                                       **
00023 ********************************************************************************
00024 ********************************************************************************
00025 ** This file implements the ABCC_DunDriver() and ABCC_ISR() routine for serial
00026 ** operating mode.
00027 ********************************************************************************
00028 ********************************************************************************
00029 */
00030 #include "abcc_drv_cfg.h"
00031 
00032 #if( ABCC_CFG_DRV_SERIAL )
00033 
00034 #include "abcc_td.h"
00035 #include "../abcc_drv_if.h"
00036 #include "abp.h"
00037 #include "abcc.h"
00038 #include "../abcc_link.h"
00039 #include "abcc_sys_adapt.h"
00040 #include "../abcc_debug_err.h"
00041 #include "../abcc_handler.h"
00042 #include "../abcc_timer.h"
00043 
00044 /*******************************************************************************
00045 ** Public Globals
00046 ********************************************************************************
00047 */
00048 
00049 /*******************************************************************************
00050 ** Private Globals
00051 ********************************************************************************
00052 */
00053 
00054 /*******************************************************************************
00055 ** Public Functions
00056 ********************************************************************************
00057 */
00058 
00059 /*------------------------------------------------------------------------------
00060 ** ABCC_RunDriver()
00061 **------------------------------------------------------------------------------
00062 */
00063 ABCC_ErrorCodeType ABCC_SerRunDriver( void )
00064 {
00065    ABCC_MainStateType eMainState;
00066 
00067    eMainState = ABCC_GetMainState();
00068 
00069    if (  eMainState < ABCC_DRV_SETUP )
00070    {
00071       if ( eMainState != ABCC_DRV_ERROR )
00072       {
00073          ABCC_ERROR(ABCC_SEV_WARNING, ABCC_EC_INCORRECT_STATE, 0);
00074          ABCC_SetMainStateError();
00075       }
00076       return( ABCC_EC_INCORRECT_STATE );
00077    }
00078 
00079    ABCC_LinkRunDriverRx();
00080    ABCC_TriggerRdPdUpdate();
00081    ABCC_TriggerAnbStatusUpdate();
00082    ABCC_TriggerReceiveMessage();
00083 
00084    ABCC_CheckWrPdUpdate();
00085    ABCC_LinkCheckSendMessage();
00086    pnABCC_DrvRunDriverTx();
00087 
00088    return( ABCC_EC_NO_ERROR );
00089 }
00090 #endif /* End of #if( ABCC_CFG_DRV_SERIAL ) */
00091 
00092 /*******************************************************************************
00093 ** Public Services
00094 ********************************************************************************
00095 */
00096 
00097 /*******************************************************************************
00098 ** Tasks
00099 ********************************************************************************
00100 */