Driver improvements (#535)
- New drivers: - SD SPI - spi_peripheral - touch_placeholder - display_placeholder - Devicetree compiler: - Implement phandle-arrays - Implement device addresses - Add placeholder drivers to all devices with a SPI display - SPI driver: add `cs-pins` and set them to high on driver start - FileSystem: add `file_system_set_owner()` and `file_system_get_owner()` - File locking is now checking if the related `FileSystem` is part of a shared SPI bus - Add `device_get_child_count()` - SDMMC driver: Remove default of `slot` value - Fix for Crowpanel Basic 3.5" display (add delay to booting) - Fix for LilyGO T-HMI SD card mounting (delayed mounting by disabling it initially in the dts)
This commit is contained in:
committed by
GitHub
parent
e50659a3fb
commit
599fa46766
@@ -29,6 +29,7 @@ class DtsTransformer(Transformer):
|
||||
def device(self, tokens: list):
|
||||
node_name = None
|
||||
node_alias = None
|
||||
node_address = None
|
||||
status = None
|
||||
properties = list()
|
||||
child_devices = list()
|
||||
@@ -37,6 +38,8 @@ class DtsTransformer(Transformer):
|
||||
node_name = item.value
|
||||
elif type(item) is Token and item.type == 'NODE_ALIAS':
|
||||
node_alias = item.value
|
||||
elif type(item) is Token and item.type == 'NODE_ADDRESS':
|
||||
node_address = item.value
|
||||
elif type(item) is DeviceProperty:
|
||||
if item.name == "status":
|
||||
status = item.value
|
||||
@@ -44,7 +47,7 @@ class DtsTransformer(Transformer):
|
||||
properties.append(item)
|
||||
elif type(item) is Device:
|
||||
child_devices.append(item)
|
||||
return Device(node_name, node_alias, status, properties, child_devices)
|
||||
return Device(node_name, node_alias, node_address, status, properties, child_devices)
|
||||
def device_property(self, objects: List[object]):
|
||||
name = objects[0]
|
||||
# Boolean property has no value as the value is implied to be true
|
||||
@@ -67,6 +70,10 @@ class DtsTransformer(Transformer):
|
||||
if isinstance(object[0], PropertyValue):
|
||||
return object[0]
|
||||
return PropertyValue(type="value", value=object[0])
|
||||
def phandle_array_entry(self, tokens: list):
|
||||
return tokens[0]
|
||||
def phandle_array(self, tokens: list):
|
||||
return PropertyValue(type="phandle-array", value=tokens)
|
||||
def array(self, object):
|
||||
return PropertyValue(type="array", value=object)
|
||||
def VALUE(self, token: Token):
|
||||
|
||||
Reference in New Issue
Block a user