/* ** =================================================================== ** Method : SM1_Init (component SynchroMaster) ** ** Description : ** Initializes the associated peripheral(s) and the component ** internal variables. The method is called automatically as a ** part of the application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ void SM1_Init(void) { SerFlag = 0U; /* Reset all flags */ ErrFlag = 0U; /* Reset all flags in mirror */ SM1_InpLen = 0U; /* No char in the receive buffer */ InpIndexR = 0x00U; /* Set index on the first item in the receive buffer */ InpIndexW = 0x00U; SM1_OutLen = 0U; /* No char in the transmit buffer */ OutIndexR = 0x00U; /* Set index on the first item in the transmit buffer */ OutIndexW = 0x00U; SMasterLdd1_DeviceDataPtr = SMasterLdd1_Init(NULL); /* Calling init method of the inherited component */ (void)SMasterLdd1_ReceiveBlock(SMasterLdd1_DeviceDataPtr, &BufferRead, 1U); /* Receive one data byte */ }
/* ** =================================================================== ** Method : SM1_Init (component SynchroMaster) ** ** Description : ** Initializes the associated peripheral(s) and the component ** internal variables. The method is called automatically as a ** part of the application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ void SM1_Init(void) { SerFlag = 0U; /* Reset all flags */ ErrFlag = 0U; /* Reset all flags in mirror */ OnFreeTxBufSemaphore = FALSE; /* Clear the OnFreeTxBufSemaphore */ SpiClockfeatures = 0x00U; /* Initialize actual clock feature state */ SetAttributeCmd = FALSE; /* Disable settings SPI attribute in enable */ EnUser = TRUE; /* Enable device */ SM1_InpLen = 0U; /* No char in the receive buffer */ InpIndexR = 0x00U; /* Set index on the first item in the receive buffer */ InpIndexW = 0x00U; SM1_OutLen = 0U; /* No char in the transmit buffer */ OutIndexR = 0x00U; /* Set index on the first item in the transmit buffer */ OutIndexW = 0x00U; SMasterLdd1_DeviceDataPtr = SMasterLdd1_Init(NULL); /* Calling init method of the inherited component */ HWEnDi(); /* Enable/disable device according to the status flags */ }