Lines Matching +full:host +full:- +full:slave

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
40 * only a single slave is present.
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.
143 * @retval -errno Negative error code on error.
151 * @brief Unlock the 1-wire bus.
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
188 * @retval 1 If at least one slave answers with a present pulse.
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.
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.
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
373 * This command allows the bus master to read the ROM code from a single slave
375 * This command should be used when there is only a single slave device on the
382 * codes) of all slave devices on the bus.
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. */
468 * @param rom found The ROM of the found slave.
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.
486 * @retval -ENODEV In case no slave responds to reset.
487 * @retval -errno Other negative error code in case of invalid crc and
493 * @brief Select a specific slave by broadcasting a selected ROM.
495 * This routine allows the 1-Wire bus master to select a slave
497 * this single selected slave.
501 * Once a slave has been selected, to reduce the communication overhead, the
503 * selected 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.
515 * @brief Select the slave last addressed with a Match ROM or Search ROM command.
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.
534 * But it can also be used to concurrently write to all slave devices.
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.
562 * Then writes given data and reads the response back from the slave.
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
584 * If a callback is passed, the callback is called for each found slave.
587 * https://www.analog.com/en/resources/app-notes/1wire-search-algorithm.html
596 * for each found slave.
601 * @retval -errno Negative error code on error.
608 * @brief Search for 1-Wire slave on bus.
611 * unique 64-bit registration number.
615 * for each found slave.
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
637 * for each found slave.
642 * @retval -errno Negative error code on error.
666 * @param rom64 Unsigned 64 bit integer representing the ROM in host endianness.
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…