Low-level driver

group LWOW_LL

Low-level device dependant functions.

struct lwow_ll_drv_t
#include <lwow.h>

1-Wire low-level driver structure

Public Members

uint8_t (*init)(void *arg)

Initialize low-level driver.

Param arg

[in] Custom argument passed to lwow_init function

Return

1 on success, 0 otherwise

uint8_t (*deinit)(void *arg)

De-initialize low-level driver.

Param arg

[in] Custom argument passed to lwow_init function

Return

1 on success, 0 otherwise

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

Set UART baudrate.

Param baud

[in] Baudrate to set in units of bauds, normally 9600 or 115200

Param arg

[in] Custom argument passed to lwow_init function

Return

1 on success, 0 otherwise

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

Param tx

[in] Data to transmit over UART

Param rx

[out] Array to write received data to

Param len

[in] Number of bytes to exchange

Param arg

[in] Custom argument passed to lwow_init function

Return

1 on success, 0 otherwise