Lines Matching +full:master +full:- +full:bus

5  * SPDX-License-Identifier: Apache-2.0
10 * @brief Public 1-Wire Driver APIs
27 * @brief 1-Wire Interface
28 * @defgroup w1_interface 1-Wire Interface
38 * Count the number of slaves expected on the bus.
39 * This can be used to decide if the bus has a multidrop topology or
46 (FOR_EACH(F1, (+), DT_SUPPORTS_DEP_ORDS(node_id)) - 1)
53 * @brief Defines the 1-Wire master settings types, which are runtime configurable.
74 /** Configuration common to all 1-Wire master implementations. */
80 /** Data common to all 1-Wire master implementations. */
118 struct w1_master_data *ctrl_data = (struct w1_master_data *)dev->data; in z_impl_w1_change_bus_lock()
119 const struct w1_driver_api *api = (const struct w1_driver_api *)dev->api; in z_impl_w1_change_bus_lock()
121 if (api->change_bus_lock) { in z_impl_w1_change_bus_lock()
122 return api->change_bus_lock(dev, lock); in z_impl_w1_change_bus_lock()
126 return k_mutex_lock(&ctrl_data->bus_lock, K_FOREVER); in z_impl_w1_change_bus_lock()
128 return k_mutex_unlock(&ctrl_data->bus_lock); in z_impl_w1_change_bus_lock()
134 * @brief Lock the 1-wire bus to prevent simultaneous access.
136 * This routine locks the bus to prevent simultaneous access from different
137 * threads. The calling thread waits until the bus becomes available.
143 * @retval -errno Negative error code on error.
151 * @brief Unlock the 1-wire bus.
153 * This routine unlocks the bus to permit access to bus line.
158 * @retval -errno Negative error code on error.
166 * @brief 1-Wire data link layer
167 * @defgroup w1_data_link 1-Wire data link layer
173 * @brief Reset the 1-Wire bus to prepare slaves for communication.
175 * This routine resets all 1-Wire bus slaves such that they are
189 * @retval -errno Negative error code on error.
195 const struct w1_driver_api *api = (const struct w1_driver_api *)dev->api; in z_impl_w1_reset_bus()
197 return api->reset_bus(dev); in z_impl_w1_reset_bus()
201 * @brief Read a single bit from the 1-Wire bus.
206 * @retval -errno Negative error code on error.
212 const struct w1_driver_api *api = (const struct w1_driver_api *)dev->api; in z_impl_w1_read_bit()
214 return api->read_bit(dev); in z_impl_w1_read_bit()
218 * @brief Write a single bit to the 1-Wire bus.
224 * @retval -errno Negative error code on error.
230 const struct w1_driver_api *api = (const struct w1_driver_api *)dev->api; in z_impl_w1_write_bit()
232 return api->write_bit(dev, bit); in z_impl_w1_write_bit()
236 * @brief Read a single byte from the 1-Wire bus.
241 * @retval -errno Negative error code on error.
247 const struct w1_driver_api *api = (const struct w1_driver_api *)dev->api; in z_impl_w1_read_byte()
249 return api->read_byte(dev); in z_impl_w1_read_byte()
253 * @brief Write a single byte to the 1-Wire bus.
259 * @retval -errno Negative error code on error.
265 const struct w1_driver_api *api = (const struct w1_driver_api *)dev->api; in z_impl_w1_write_byte()
267 return api->write_byte(dev, byte); in z_impl_w1_write_byte()
271 * @brief Read a block of data from the 1-Wire bus.
278 * @retval -errno Negative error code on error.
283 * @brief Write a block of data from the 1-Wire bus.
290 * @retval -errno Negative error code on error.
296 * @brief Get the number of slaves on the bus.
300 * @retval slave_count Positive Number of connected 1-Wire slaves on success.
301 * @retval -errno Negative error code on error.
308 (const struct w1_master_config *)dev->config; in z_impl_w1_get_slave_count()
310 return ctrl_cfg->slave_count; in z_impl_w1_get_slave_count()
314 * @brief Configure parameters of the 1-Wire master.
317 * but master devices may not support all types.
324 * @retval -ENOTSUP The master doesn't support the configuration of the supplied type.
325 * @retval -EIO General input / output error, failed to configure master devices.
333 const struct w1_driver_api *api = (const struct w1_driver_api *)dev->api; in z_impl_w1_configure()
335 return api->configure(dev, type, value); in z_impl_w1_configure()
343 * @brief 1-Wire network layer
344 * @defgroup w1_network 1-Wire network layer
350 * @name 1-Wire ROM Commands
355 * This command allows the bus master to read the slave devices without
361 * This command allows the bus master to address a specific slave device by
367 * This command allows the bus master to resume a previous read out from where
373 * This command allows the bus master to read the ROM code from a single slave
376 * bus.
381 * This command allows the bus master to discover the addresses (i.e., ROM
382 * codes) of all slave devices on the bus.
387 * This command allows the bus master to identify which devices have experienced
393 * This command allows the bus master to address all devices on the bus and then
399 * This command allows the bus master to address a specific device and switch it
411 /** Seed value used to calculate the 1-Wire 8-bit crc. */
413 /** Polynomial used to calculate the 1-Wire 8-bit crc. */
415 /** Seed value used to calculate the 1-Wire 16-bit crc. */
417 /** Polynomial used to calculate the 1-Wire 16-bit crc. */
435 /** @brief The 1-Wire family code identifying the slave device type.
438 …* https://www.analog.com/en/resources/technical-articles/1wire-software-resource-guide-device-desc…
442 /** The serial together with the family code composes the unique 56-bit id */
444 /** 8-bit checksum of the 56-bit unique id. */
449 * @brief Node specific 1-wire configuration struct.
452 * the bus to address the specific slave using the selected speed.
455 /** Unique 1-Wire ROM. */
474 * @brief Read Peripheral 64-bit ROM.
476 * This procedure allows the 1-Wire bus master to read the peripherals’
477 * 64-bit ROM without using the Search ROM procedure.
479 * connected to the bus.
486 * @retval -ENODEV In case no slave responds to reset.
487 * @retval -errno Other negative error code in case of invalid crc and
495 * This routine allows the 1-Wire bus master to select a slave
506 * @param[in] config Pointer to the slave specific 1-Wire config.
509 * @retval -ENODEV In case no slave responds to reset.
510 * @retval -errno Other negative error code on error.
517 * This routine allows the 1-Wire bus master to re-select a slave
523 * @retval -ENODEV In case no slave responds to reset.
524 * @retval -errno Other negative error code on error.
531 * This routine sets up the bus slaves to receive a command.
532 * It is usually used when there is only one peripheral on the bus
537 * @param[in] config Pointer to the slave specific 1-Wire config.
540 * @retval -ENODEV In case no slave responds to reset.
541 * @retval -errno Other negative error code on error.
550 * @param[in] config Pointer to the slave specific 1-Wire config.
553 * @retval -ENODEV In case no slave responds to reset.
554 * @retval -errno Other negative error code on error.
559 * @brief Write then read data from the 1-Wire slave with matching ROM.
565 * @param[in] config Pointer to the slave specific 1-Wire config.
572 * @retval -ENODEV In case no slave responds to reset.
573 * @retval -errno Other negative error code on error.
580 * @brief Search 1-wire slaves on the bus.
582 * This function searches slaves on the 1-wire bus, with the possibility
587 * https://www.analog.com/en/resources/app-notes/1wire-search-algorithm.html
601 * @retval -errno Negative error code on error.
608 * @brief Search for 1-Wire slave on bus.
610 * This routine can discover unknown slaves on the bus by scanning for the
611 * unique 64-bit registration number.
620 * @retval -errno Negative error code on error.
630 * @brief Search for 1-Wire slaves with an active alarm.
632 * This routine searches 1-Wire slaves on the bus, which currently have
642 * @retval -errno Negative error code on error.
675 * @brief Compute CRC-8 chacksum as defined in the 1-Wire specification.
677 * The 1-Wire of CRC 8 variant is using 0x31 as its polynomial with the initial
679 * This CRC is used to check the correctness of the unique 56-bit ROM.
692 * @brief Compute 1-Wire variant of CRC 16
694 * The 16-bit 1-Wire crc variant is using the reflected polynomial function
697 * "UNDERSTANDING AND USING CYCLIC REDUNDANCY CHECKS WITH MAXIM 1-WIRE AND IBUTTON PRODUCTS"
698 …nalog.com/en/resources/technical-articles/understanding-and-using-cyclic-redundancy-checks-with-ma…