mikroSDK Reference Manual
|
One Wire Master Driver API Reference. More...
Functions list | |
err_t | one_wire_open (one_wire_t *obj) |
Opens One Wire Driver object. More... | |
void | one_wire_configure_default (one_wire_t *obj) |
Configures One Wire Driver configuration structure. More... | |
err_t | one_wire_reset (one_wire_t *obj) |
Resets One Wire bus. More... | |
err_t | one_wire_read_rom (one_wire_t *obj, one_wire_rom_address_t *device_rom_address) |
Reads device's ROM information. More... | |
err_t | one_wire_skip_rom (one_wire_t *obj) |
Access device's level functions without transmitting ROM information. More... | |
err_t | one_wire_match_rom (one_wire_t *obj, one_wire_rom_address_t *device_rom_address) |
Select a specific One Wire capable device on bus. More... | |
err_t | one_wire_search_first_device (one_wire_t *obj, one_wire_rom_address_t *one_wire_device_list) |
Search One Wire capable device on bus. More... | |
err_t | one_wire_search_next_device (one_wire_t *obj, one_wire_rom_address_t *one_wire_device_list) |
Search One Wire capable devices on bus. More... | |
err_t | one_wire_write_byte (one_wire_t *obj, uint8_t *write_data_buffer, size_t write_data_length) |
Writes byte to One Wire bus. More... | |
err_t | one_wire_read_byte (one_wire_t *obj, uint8_t *read_data_buffer, size_t read_data_length) |
Reads byte from One Wire bus. More... | |
One Wire Master Driver API header. Contains all enums, structures and function declarations available for One Wire Master module.
err_t one_wire_open | ( | one_wire_t * | obj | ) |
Opens One Wire driver object on selected pin. Enables appropriate PORT clock, configures pin to have digital output functionality, makes sure that HIGH voltage state is applied on pin before any One Wire actions.
[in,out] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
driver
structure has been adequately populated beforehand. Example
void one_wire_configure_default | ( | one_wire_t * | obj | ) |
Configures One Wire configuration structure to default initialization values. Take into consideration that this is just structure variable initial values setting. User must redefine only one value - data_pin.
[in,out] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
Default values:
Function | Default value |
---|---|
Data pin | 0xFFFFFFFF (invalid pin) |
state | Pin state, do not alter. |
Example
err_t one_wire_reset | ( | one_wire_t * | obj | ) |
Host shall send reset sequence and devices shall go into reset state.
[in,out] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
Example
err_t one_wire_read_rom | ( | one_wire_t * | obj, |
one_wire_rom_address_t * | device_rom_address | ||
) |
Allows the host to read eight-bit family code, 48-bit serial number, and eight-bit CRC.
IMPORTANT - THIS FUNCTION IS TO BE ISSUED ONLY IF WE ARE DEALING WITH ONE DEVICE ONLY. THIS FUNCTION AUTOMATICALLY RESETS ONE WIRE BUS.
[in] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
[out] | *device_rom_address | Buffer for One Wire device ROM information. |
Example
err_t one_wire_skip_rom | ( | one_wire_t * | obj | ) |
Allows the host to access device functions without providing the 64-bit ROM identification number.
IMPORTANT - THIS FUNCTION IS TO BE ISSUED ONLY IF WE ARE DEALING WITH ONE DEVICE ONLY. THIS FUNCTION AUTOMATICALLY RESETS ONE WIRE BUS.
[in] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
Example
err_t one_wire_match_rom | ( | one_wire_t * | obj, |
one_wire_rom_address_t * | device_rom_address | ||
) |
Select a One Wire device with specific ID.
[in] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
[in] | device_rom_address | Buffer for One Wire device ROM information. |
Example
err_t one_wire_search_first_device | ( | one_wire_t * | obj, |
one_wire_rom_address_t * | one_wire_device_list | ||
) |
Search and list 1st device that is One Wire capable.
[in] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
[out] | *one_wire_device_list | Buffer for One Wire device ROM information. |
Example
err_t one_wire_search_next_device | ( | one_wire_t * | obj, |
one_wire_rom_address_t * | one_wire_device_list | ||
) |
Search devices that are One Wire capable.
[in] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
[out] | *one_wire_device_list | Buffer for One Wire device ROM information. |
Example
err_t one_wire_write_byte | ( | one_wire_t * | obj, |
uint8_t * | write_data_buffer, | ||
size_t | write_data_length | ||
) |
Writes byte to One Wire bus.
[in] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
[in] | *write_data_buffer | Data transmit buffer. |
[in] | write_data_length | Number of bytes to write from data transmit buffer. |
Example
err_t one_wire_read_byte | ( | one_wire_t * | obj, |
uint8_t * | read_data_buffer, | ||
size_t | read_data_length | ||
) |
Reads byte from One Wire bus.
[in] | *obj | One Wire driver object. See one_wire_t structure definition for detailed explanation. |
[out] | *read_data_buffer | Data receive buffer. |
[in] | read_data_length | Number of bytes to be read. |
Example