MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ofw_parse_delay

Function ofw_parse_delay

components/drivers/spi/dev_spi_dm.c:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17#ifdef RT_USING_OFW
18static void ofw_parse_delay(struct rt_ofw_node *np, struct rt_spi_delay *delay,
19 const char *prop)
20{
21 rt_uint32_t value;
22
23 if (!rt_ofw_prop_read_u32(np, prop, &value))
24 {
25 if (value > RT_UINT16_MAX)
26 {
27 delay->value = RT_DIV_ROUND_UP(value, 1000);
28 delay->unit = RT_SPI_DELAY_UNIT_USECS;
29 }
30 else
31 {
32 delay->value = value;
33 delay->unit = RT_SPI_DELAY_UNIT_NSECS;
34 }
35 }
36}
37
38rt_err_t spi_device_ofw_parse(struct rt_spi_device *spi_dev)
39{

Callers 1

spi_device_ofw_parseFunction · 0.85

Calls 1

rt_ofw_prop_read_u32Function · 0.85

Tested by

no test coverage detected