AnsweredAssumed Answered

HOW TO COMPLETE THE ARGUMENTS OF A GENERATED FONCTION ?

Question asked by Bele Robert on Nov 5, 2014
Latest reply on Nov 7, 2014 by Adrian Cano

/* I Use for the Fist time KDSK with Processor Expert. I was able to easily create a project, create and configure LDD Component, Generated software,built the project, define and use new fonction, use generated events files

   BUT I D'ONT UNDERSTAND HOW TO COMPLETE THE ARGUMENTS OF A GENERATED FONCTION.

For exemple I create a Master SPI LDD COmponent called My_SPI and I try to use the generated fileMy_SPI_SendBlock(); Below are 4 diefferents Try all Wrong.

   */

 

#ifdef MY_SPI_TRY1

/*Fonction is copy and paste from file My_SPI.h*/

** ===================================================================

** Method : My_SPI_SendBlock (component SPIMaster_LDD)

*/

/*!

** @brief

** This method sends a block of characters. The method returns

** ERR_BUSY when the previous block transmission is not

** completed. The method <CancelBlockTransmission> can be used

** to cancel a transmit operation.

** @param

** DeviceDataPtr - Device data structure

** pointer returned by <Init> method.

** @param

** BufferPtr - Pointer to the block of data

** to send.

** @param

** Size - Number of characters in the buffer.

** @return

** - Error code, possible codes:

** ERR_OK - OK

** ERR_SPEED - This device does not work in

** the active clock configuration

** ERR_DISABLED - Component is disabled

** ERR_BUSY - The previous transmit request is

** pending

*/

/* ===================================================================*/

uint16_t Size=3;

LDD_TError My_SPI_SendBlock(LDD_TDeviceData *DeviceDataPtr, LDD_TData *Com_depart_SPIPtr, uint16_t Size);

/*1) This Solution is accepted by the build Project Process but looks like a new protype and not a parameter allocation */

#endif // MY_SPI_TRY1

 

#ifdef MY_SPI_TRY2

/*Fonction is copy and paste from file My_SPI.h*/

uint16_t Size=3;

LDD_TError My_SPI_SendBlock(LDD_TDeviceData *DeviceDataPtr, LDD_TData *Com_depart_SPI[0]Ptr, uint16_t Size);

/*2) This Solution is rejected by the build Project Process: expected ';', ',' or ')' */

#endif // MY_SPI_TRY2

 

#ifdef MY_SPI_TRY3

/*Fonction is copy and paste from file My_SPI.h*/

LDD_TError My_SPI_SendBlock(#ifdef MY_SPI_TRY3

LDD_TError My_SPI_SendBlock(LDD_TDeviceData *DeviceDataPtr, LDD_TData *Com_depart_SPIPtr, 3);

   /*3) This Solution is rejected by the build Project Process: expected declaration specifiers or '...' before numeric constant */

#endif // MY_SPI_TRY3);

 

#ifdef MY_SPI_TRY4

/*Fonction is drag from Component file My_SPI:SPIMaster_LDD*/

My_SPI_SendBlock(LDD_TDeviceData *DeviceDataPtr, LDD_TData *Com_depart_SPIPtr, 3);

/*4) This Solution is rejected by the build Project Process:

expected expression before 'LDD_TDeviceData'

too few arguments to function 'My_SPI_SendBlock' */

#endif // MY_SPI_TRY4

 

  /* I find out no documentation to explain how to use these parameters. Could somebody help me. Thanks a lot .Robert */

Outcomes