Data Structures | |
struct | _NUTOWIBUS |
The OWIBUS structure. More... | |
Modules | |
One-Wire Bit-Banging Driver | |
Array of delay values for the different command phases. | |
One-Wire UART Driver | |
Defines | |
#define | OWI_READ_ROM 0x33 |
One-Wire command codes for devices. | |
#define | OWI_OVERDRIVE_SKIP_ROM 0x3c |
As OWI_SKIP_ROM, but with command phase in fast mode. | |
#define | OWI_CONVERT_T 0x44 |
DS18B20: Start conversion on selected device(s). | |
#define | OWI_MATCH_ROM 0x55 |
Qualify command to single device. | |
#define | OWI_OVERDRIVE_MATCH_ROM 0x69 |
As OWI_MATCH_ROM but with command phase in fast mode. | |
#define | OWI_SKIP_ROM 0xCC |
Qualify command as broadcast. | |
#define | OWI_READ 0xBE |
Read data from addressed device. | |
#define | OWI_SEARCH_ROM 0xF0 |
Prepare devices for ID search. | |
#define | OWI_LAST_DEVICE 0x00 |
Constanst used for OwiRomSearch. | |
#define | OWI_SEARCH_FIRST 0xFF |
Start value for ID search. | |
#define | OWI_OVERDRIVE 0x1 |
OWI bus modes. | |
#define | OWI_PULLUP 0x2 |
Active pull-up for loaded buses. | |
Typedefs | |
typedef struct _NUTOWIBUS | NUTOWIBUS |
Enumerations | |
enum | OWI_ERRORS { OWI_SUCCESS = 0, OWI_PRESENCE_ERR = -1, OWI_INVALID_HW = -2, OWI_OUT_OF_MEM = -3, OWI_HW_ERROR = -4, OWI_DATA_ERROR = -5, OWI_NOT_IMPLEMENTED = -6 } |
OWI return codes. More... | |
enum | OWIBUS_MODE { OWI_MODE_NORMAL = 0, OWI_MODE_OVERDRIVE = 1, OWI_MODE_NONE = 2 } |
OWI speed modes. More... | |
enum | STM32_OWITIMER_COMMANDS { OWI_CMD_RESET = 0, OWI_CMD_RWBIT = 1, OWI_CMD_NONE = 2 } |
OWI transactions. More... | |
enum | STM32_OWITIMER_PHASES { OWI_PHASE_SETUP = 0, OWI_PHASE_SYNC_PULSE = 1, OWI_PHASE_RW = 2, OWI_PHASE_RELEASE = 3, OWI_PHASE_NONE = 4 } |
OWI transactions phases. More... | |
Functions | |
int | OwiRomSearch (NUTOWIBUS *bus, uint8_t *diff, uint64_t *hid) |
Search the connected One-Wire bus for devices. | |
int | OwiCommand (NUTOWIBUS *bus, uint8_t cmd, uint64_t *hid) |
Send a command to the connected devices. | |
int | OwiReadBlock (NUTOWIBUS *bus, uint8_t *data, uint_fast8_t len) |
Read a block of data. | |
int | OwiWriteBlock (NUTOWIBUS *bus, uint8_t *data, uint_fast8_t len) |
Write a block of data. | |
int | OwiSetMode (NUTOWIBUS *bus, uint_fast8_t mode) |
Set/Reset One-Wire Mode(s) | |
int | OwiGetMode (NUTOWIBUS *bus) |
int | OWIGetMode (NUTOWIBUS *bus) |
Set/Reset One-Wire Mode(s) | |
Variables | |
const uint16_t | owi_timervalues_250ns [OWI_MODE_NONE][OWI_CMD_NONE][OWI_PHASE_NONE] |
#define OWI_READ_ROM 0x33 |
One-Wire command codes for devices.
Read 64-bit serial ID (single device only).
#define OWI_OVERDRIVE_SKIP_ROM 0x3c |
As OWI_SKIP_ROM, but with command phase in fast mode.
Referenced by OwiSetMode().
#define OWI_CONVERT_T 0x44 |
DS18B20: Start conversion on selected device(s).
#define OWI_MATCH_ROM 0x55 |
Qualify command to single device.
Referenced by OwiCommand().
#define OWI_OVERDRIVE_MATCH_ROM 0x69 |
As OWI_MATCH_ROM but with command phase in fast mode.
#define OWI_SKIP_ROM 0xCC |
Qualify command as broadcast.
Referenced by OwiCommand().
#define OWI_READ 0xBE |
Read data from addressed device.
#define OWI_SEARCH_ROM 0xF0 |
Prepare devices for ID search.
Referenced by OwiRomSearch().
#define OWI_LAST_DEVICE 0x00 |
#define OWI_SEARCH_FIRST 0xFF |
Start value for ID search.
#define OWI_OVERDRIVE 0x1 |
#define OWI_PULLUP 0x2 |
Active pull-up for loaded buses.
typedef struct _NUTOWIBUS NUTOWIBUS |
enum OWI_ERRORS |
OWI return codes.
enum OWIBUS_MODE |
OWI transactions phases.
Search the connected One-Wire bus for devices.
bus | Specifies the One-Wire bus. |
diff | On entry, pointer to either OWI_SEARCH_FIRST or the device found in the last call. On exit, pointer to either OWI_LAST_DEVICE or the diff to use in the next call. |
value | Pointer to the Hardware ID found. |
References OWI_DATA_ERROR, OWI_LAST_DEVICE, OWI_SEARCH_ROM, _NUTOWIBUS::OwiReadBlock, _NUTOWIBUS::OwiTouchReset, and _NUTOWIBUS::OwiWriteBlock.
Send a command to the connected devices.
bus | Specifies the One-Wire bus. |
cmd | Command to send. |
hid | Device to select or NULL for broadcast. |
References OWI_MATCH_ROM, OWI_SKIP_ROM, _NUTOWIBUS::OwiTouchReset, and _NUTOWIBUS::OwiWriteBlock.
int OwiReadBlock | ( | NUTOWIBUS * | bus, |
uint8_t * | data, | ||
uint_fast8_t | len | ||
) |
Read a block of data.
bus | Specifies the One-Wire bus. |
data | Data read. |
len | Number of bits to read. |
References _NUTOWIBUS::OwiReadBlock.
int OwiWriteBlock | ( | NUTOWIBUS * | bus, |
uint8_t * | data, | ||
uint_fast8_t | len | ||
) |
Write a block of data.
bus | Specifies the One-Wire bus. |
data | Data to write. |
len | Number of bits to write. |
References _NUTOWIBUS::OwiWriteBlock.
int OwiSetMode | ( | NUTOWIBUS * | bus, |
uint_fast8_t | mode | ||
) |
Set/Reset One-Wire Mode(s)
bus | Specifies the One-Wire bus. |
mode | Bitmask of mode to set, at present only OWI_OVERDRIVE |
References _NUTOWIBUS::mode, OWI_OVERDRIVE, OWI_OVERDRIVE_SKIP_ROM, _NUTOWIBUS::OwiTouchReset, and _NUTOWIBUS::OwiWriteBlock.
int OwiGetMode | ( | NUTOWIBUS * | bus | ) |
int OWIGetMode | ( | NUTOWIBUS * | bus | ) |
Set/Reset One-Wire Mode(s)
bus | Specifies the One-Wire bus. |
References _NUTOWIBUS::mode.
const uint16_t owi_timervalues_250ns[OWI_MODE_NONE][OWI_CMD_NONE][OWI_PHASE_NONE] |
{ { { 4 * 3, 4 * (3 + 480), 4 * (3 + 480 + 70), 4 * (3 + 480 + 70 + 410) }, { 4 * 3, 4 * (3 + 6), 4 * (3 + 6 + 9), 4 * (3 + 6 + 9 + 51) } }, { { 10, 10 + 280, 10 + 280 + 34, 10 + 280 + 34 + 160 }, { 10, 10 + 4, 10 + 4 + 30, 10 + 4 + 30 + 30 } } }