Low-level driver

group OW_LL

Low-level device dependant functions.

struct ow_ll_drv_t
#include <ow.h>

1-Wire low-level driver structure

Public Members

uint8_t (*init)(void *arg)

Initialize low-level driver.

Return

1 on success, 0 otherwise

Parameters
  • [in] arg: Custom argument passed to ow_init function

uint8_t (*deinit)(void *arg)

De-initialize low-level driver.

Return

1 on success, 0 otherwise

Parameters
  • [in] arg: Custom argument passed to ow_init function

uint8_t (*set_baudrate)(uint32_t baud, void *arg)

Set UART baudrate.

Return

1 on success, 0 otherwise

Parameters
  • [in] baud: Baudrate to set in units of bauds, normally 9600 or 115200

  • [in] arg: Custom argument passed to ow_init function

uint8_t (*tx_rx)(const uint8_t *tx, uint8_t *rx, size_t len, void *arg)

Transmit and receive bytes over UART hardware (or custom implementation)

Bytes array for tx is already prepared to be directly transmitted over UART hardware, no data manipulation is necessary.

At the same time, library must read received data on RX port and put it to rx data array, one by one, up to len number of bytes

Return

1 on success, 0 otherwise

Parameters
  • [in] tx: Data to transmit over UART

  • [out] rx: Array to write received data to

  • [in] len: Number of bytes to exchange

  • [in] arg: Custom argument passed to ow_init function