Nut/OS  5.0.5
API Reference
One-Wire UART Driver
Collaboration diagram for One-Wire UART Driver:

Data Structures

struct  _NUTOWIINFO_UART
 OWI runtime control block container. More...

Defines

#define OWI_UART_WRITE_RST   0xf0
 Data to send on the UART for the OWI primitives.
#define OWI_UART_WRITE_ONE   0xff
 UART data for write '1' and read.
#define OWI_UART_WRITE_ZERO   0x00
 UART data for write '0'.
#define OWI_UART_READ_ONE   0x01
 Data to expect from the UART for the OWI primitives.
#define OWI_UART_BAUD_RESET   9600
 Baud rates to use for OWI primitives.
#define OWI_UART_BAUD_RWBIT   115200
 UART baudrate for RW bit.

Typedefs

typedef struct _NUTOWIINFO_UART NUTOWIINFO_UART

Functions

int NutRegisterOwiBus_Uart (NUTOWIBUS *bus, NUTDEVICE *uart, int pullup_port, uint_fast8_t pullup_pin)
 Register the One-Wire bus.

Define Documentation

#define OWI_UART_WRITE_RST   0xf0

Data to send on the UART for the OWI primitives.

UART data for presence impulse.

#define OWI_UART_WRITE_ONE   0xff

UART data for write '1' and read.

#define OWI_UART_WRITE_ZERO   0x00

UART data for write '0'.

#define OWI_UART_READ_ONE   0x01

Data to expect from the UART for the OWI primitives.

UART data received for read '1'.

#define OWI_UART_BAUD_RESET   9600

Baud rates to use for OWI primitives.

UART baudrate for presence impulse.

#define OWI_UART_BAUD_RWBIT   115200

UART baudrate for RW bit.


Typedef Documentation


Function Documentation

int NutRegisterOwiBus_Uart ( NUTOWIBUS bus,
NUTDEVICE uart,
int  pullup_port,
uint_fast8_t  pullup_pin 
)

Register the One-Wire bus.

Parameters:
busThe returned NUTOWIBUS.
uartThe UART device to use.
pullup_portIf given, port to control strong pull-up for parasitic powered devices.
pullup_pinThe pin to control strong pull-up for parasitic powered devices.
Returns:
OWI_SUCCESS on success, a negative value otherwise.

References _ioctl(), _O_BINARY, _O_RDWR, _open(), calloc, _NUTDEVICE::dev_name, _NUTOWIBUS::mode, NULL, NutRegisterDevice(), OWI_INVALID_HW, OWI_OUT_OF_MEM, OWI_SUCCESS, _NUTOWIBUS::owibus_info, _NUTOWIBUS::OwiReadBlock, _NUTOWIBUS::OwiTouchReset, _NUTOWIBUS::OwiWriteBlock, _NUTOWIINFO_UART::uart_fd, UART_SETREADTIMEOUT, and UART_SETSTOPBITS.

Here is the call graph for this function: