MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / _write_bits

Function _write_bits

modules/drivers/onewire/esp/owb_gpio.c:216–225  ·  view source on GitHub ↗

* @brief Write 1-Wire data byte. * NOTE: The data is shifted out of the low bits, eg. it is written in the order of lsb to msb * @param[in] bus Initialised bus instance. * @param[in] data Value to write. * @param[in] number_of_bits_to_read bits to write */

Source from the content-addressed store, hash-verified

214 * @param[in] number_of_bits_to_read bits to write
215 */
216static owb_status _write_bits(const OneWireBus * bus, uint8_t data, int number_of_bits_to_write)
217{
218 for (int i = 0; i < number_of_bits_to_write; ++i)
219 {
220 _write_bit(bus, data & 0x01);
221 data >>= 1;
222 }
223
224 return OWB_STATUS_OK;
225}
226
227/**
228 * @brief Read 1-Wire data byte from bus.

Callers

nothing calls this directly

Calls 1

_write_bitFunction · 0.85

Tested by

no test coverage detected