Skip to content
Commit b6dc0a24 authored by Martí Bolívar's avatar Martí Bolívar Committed by Anas Nashif
Browse files

edtlib: improve enum support



Add enum_tokenizable and enum_upper_tokenizable to PropertySpec. These
allow a PropertySpec to declare that it both has an enumeration of
values and all of them are strings which are "tokenizable". Don't
bother extending Property with these; the user can access the
information through Property.spec now, so the extra delegation is
unnecessary.

See the docstrings for details on what "tokenizable" means. The basic
idea is that we should be able to use the DT binding's enum values as
C 'enum' enumerators in a "reasonable way".

Add val_as_token to Property. This produces a canonical token for the
property value.

Add tests for this feature in particular and property enumerations in
general.

Signed-off-by: default avatarMartí Bolívar <marti.bolivar@nordicsemi.no>
parent 88094ecf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment