5 #ifndef OPENTITAN_SW_DEVICE_LIB_UJSON_EXAMPLE_H_
6 #define OPENTITAN_SW_DEVICE_LIB_UJSON_EXAMPLE_H_
7 #include "sw/device/lib/ujson/ujson_derive.h"
12 #define MODULE_ID MAKE_MODULE_ID('e', 'x', 'j')
26 #define STRUCT_FOO(field, string) \
28 field(bar, uint32_t) \
30 UJSON_SERDE_STRUCT(Foo, foo, STRUCT_FOO);
42 #define STRUCT_COORD(field, string) \
45 UJSON_SERDE_STRUCT(Coord, coord, STRUCT_COORD);
47 #define STRUCT_RECT(field, string) \
48 field(top_left, coord) \
49 field(bottom_right, coord)
50 UJSON_SERDE_STRUCT(Rect, rect, STRUCT_RECT);
62 #define STRUCT_MATRIX(field, string) \
63 field(k, int32_t, 3, 5)
64 UJSON_SERDE_STRUCT(Matrix, matrix, STRUCT_MATRIX);
78 #define ENUM_DIRECTION(_, value) \
83 UJSON_SERDE_ENUM(Direction, direction, ENUM_DIRECTION);
95 #define ENUM_FUZZY_BOOL(_, value) \
98 C_ONLY(UJSON_SERDE_ENUM(FuzzyBool, fuzzy_bool, ENUM_FUZZY_BOOL, WITH_UNKNOWN));
105 #define STRUCT_MISC(field, string) \
107 field(status, status_t)
108 UJSON_SERDE_STRUCT(Misc, misc_t, STRUCT_MISC);