AnsweredAssumed Answered

MKE06-SPI0configure

Question asked by bincheng tao on Jun 3, 2019
Latest reply on Jun 6, 2019 by Robin_Shen

Component documentation - Typical Usage

#define BLOCK_SIZE 4  uint8_t OutData[BLOCK_SIZE] = "0123"; uint8_t InpData[BLOCK_SIZE]; volatile LDD_SPIMASTER_TError ComError = 0U; LDD_TError Error; LDD_TDeviceData *MySPIPtr;  void main(void) {   ...   MySPIPtr = SM1_Init(NULL);                               /* Initialization of SM1 component */   SM1_SelectConfiguration(MySPIPtr, 1U, 1U);               /* Select chip select 1 and attribute set 1 */   Error = SM1_ReceiveBlock(MySPIPtr, InpData, BLOCK_SIZE); /* Request data block reception */   Error = SM1_SendBlock(MySPIPtr, OutData, BLOCK_SIZE);    /* Start transmission/reception */   while (!SM1_GetBlockReceivedStatus(MySPIPtr)) {          /* Wait until data block is transmitted/received */     SM1_Main(MySPIPtr);   }   SM1_SelectConfiguration(MySPIPtr, 0U, 0U);               /* Select chip select 0 and attribute set 0 */   Error = SM1_ReceiveBlock(MySPIPtr, InpData, BLOCK_SIZE); /* Request data block reception */   Error = SM1_SendBlock(MySPIPtr, OutData, BLOCK_SIZE);    /* Start transmission/reception */   while (!SM1_GetBlockReceivedStatus(MySPIPtr)) {          /* Wait until data block is transmitted/received */     SM1_Main(MySPIPtr);   } }

Content of Event.c:

extern volatile LDD_SPIMASTER_TError ComError; extern LDD_TError Error; extern LDD_TDeviceData *MySPIPtr;  void SM1_OnError(LDD_TUserData *UserDataPtr) {   Error = SM1_GetError(MySPIPtr, (LDD_SPIMASTER_TError *)&ComError); /* Get communication errors if occured */ }

Why  SM1_OnError  and SM1_GetError not generate

According to the routine, did not achieve the expected function, how to solve?

Outcomes