0

i have bus object which has many elements inside and which in turn are bus objects again. can anyone tell me is there a way to generate a bus header files with typedef struct from this busobject instead of doing it manually using a script? is there a direct function or way to do this?

so for example i have a bus object a with elements d,e which are again bus objects and then they finally have two bus elements each d_a,d_b,e_a,e_b. Now is there a function or simple way to process the bus object a so that i get the output as:

typedef struct
{
uint8 d_a;
uint8 d_b;
}d;

typedef struct
{
uint8 e_a;
uint8 e_b;
}e;

typedef struct
{
d d;
e e;
}a;

which is the bus header.

Arun Kumar
  • 103
  • 13

1 Answers1

0

You need to set the bus DataScope to Exported. One way to do this is to go into your workspace and double click any defined bus. This will open the bus editor GUI. When you click on a bus name there will be a a menu with different options: Name, Data scope, header file, Alignment.

Use the drop down menu for Data Scope to select Exported. Now the code generator will create a header file. You can specify the filename of this header file by typing foo.h in the Header file field. If you leave it blank Matlab will create a header file using the bus name.