cancel
Showing results for 
Search instead for 
Did you mean: 

What is this C syntax?

xiewenliang
Associate II

The following is the code generated by X-CUBE-AI of STM32CubeIDE ,but I can't understand it.

 

/**  Array declarations section  **********************************************/
/* Array#0 */
AI_ARRAY_OBJ_DECLARE(
  input_1_output_array, AI_ARRAY_FORMAT_FLOAT|AI_FMT_FLAG_IS_IO,
  NULL, NULL, 4096, AI_STATIC)

/**  Tensor declarations section  *********************************************/
/* Tensor #0 */
AI_TENSOR_OBJ_DECLARE(
  input_1_output, AI_STATIC,
  0, 0x0,
  AI_SHAPE_INIT(4, 1, 1, 64, 64), AI_STRIDE_INIT(4, 4, 4, 4, 256),
  1, &input_1_output_array, NULL)

 

 

 

 

DER 

3 REPLIES 3

Look up the definition of the Macro or Function. Use a static analysis tool or find-in-files.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

Right-click -> Open Declaration to see the macro definition of AI_ARRAY_OBJ_DECLARE. Or hit F3 when your cursor is on it.

If you feel a post has answered your question, please click "Accept as Solution".

@xiewenliang wrote:

 I can't understand it.

 

 

 

DER 


What, exactly, don't you understand?

The syntax is simply using  Macros (#defines) with parameters.

See the section on the Preprocessor in any C reference.

Your IDE should be able to take you to the definitions of the Macros - then you can work out what it expands to.