scripts: dts: gen_defines: add `ENUM_VAL_<val>_EXISTS` define

Add a define of the form
`DT_N_<node-id>_P_<prop-id>_ENUM_VAL_<val>_EXISTS` for enumerated
devicetree properties. This enables the devicetree API to check whether
an enum is a given value directly, without resorting to error-prone
checks against the enum index.

Example generated defines (int and string):
	`#define DT_N_S_test_S_enum_4_P_val_ENUM_VAL_5_EXISTS 1`
	`#define DT_N_S_test_S_enum_6_P_val_ENUM_VAL_zero_EXISTS 1`

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
1 file changed