mikroSDK Reference Manual
|
One Wire Hardware Abstraction Layer API Reference. More...
Functions list | |
err_t | hal_one_wire_open (hal_one_wire_t *obj) |
Opens One Wire HAL object. More... | |
void | hal_one_wire_configure_default (hal_one_wire_t *obj) |
Configures One Wire HAL configuration structure. More... | |
err_t | hal_one_wire_reset (hal_one_wire_t *obj) |
Resets One Wire bus. More... | |
err_t | hal_one_wire_read_rom (hal_one_wire_t *obj, hal_one_wire_rom_address_t *device_rom_address) |
Reads device's ROM information. More... | |
err_t | hal_one_wire_skip_rom (hal_one_wire_t *obj) |
Access device's level functions without transmitting ROM information. More... | |
err_t | hal_one_wire_match_rom (hal_one_wire_t *obj, hal_one_wire_rom_address_t *device_rom_address) |
Select a specific One Wire capable device on bus. More... | |
err_t | hal_one_wire_search_first_device (hal_one_wire_t *obj, hal_one_wire_rom_address_t *one_wire_device_list) |
Search One Wire capable device on bus. More... | |
err_t | hal_one_wire_search_next_device (hal_one_wire_t *obj, hal_one_wire_rom_address_t *one_wire_device_list) |
Search One Wire capable devices on bus. More... | |
err_t | hal_one_wire_write_byte (hal_one_wire_t *obj, uint8_t *write_data_buffer, size_t write_data_length) |
Writes byte to One Wire bus. More... | |
err_t | hal_one_wire_read_byte (hal_one_wire_t *obj, uint8_t *read_data_buffer, size_t read_data_length) |
Reads byte from One Wire bus. More... | |
void | one_wire_timing_value_a (void) |
Configures device-specific timing "a" sequence value. More... | |
void | one_wire_timing_value_b (void) |
Configures device-specific timing "b" sequence value. More... | |
void | one_wire_timing_value_c (void) |
Configures device-specific timing "c" sequence value. More... | |
void | one_wire_timing_value_d (void) |
Configures device-specific timing "d" sequence value. More... | |
void | one_wire_timing_value_e (void) |
Configures device-specific timing "e" sequence value. More... | |
void | one_wire_timing_value_f (void) |
Configures device-specific timing "f" sequence value. More... | |
void | one_wire_timing_value_h (void) |
Configures device-specific timing "h" sequence value. More... | |
void | one_wire_timing_value_i (void) |
Configures device-specific timing "i" sequence value. More... | |
void | one_wire_timing_value_j (void) |
Configures device-specific timing "j" sequence value. More... | |
API for configuring and manipulating One Wire HAL module.
err_t hal_one_wire_open | ( | hal_one_wire_t * | obj | ) |
Opens One Wire HAL 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 HAL object. See hal_one_wire_t structure definition for detailed explanation. |
hal
structure has been adequately populated beforehand. Example
void hal_one_wire_configure_default | ( | hal_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 HAL object. See hal_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 hal_one_wire_reset | ( | hal_one_wire_t * | obj | ) |
Host shall send reset sequence and devices shall go into reset state.
[in,out] | *obj | One Wire HAL object. See hal_one_wire_t structure definition for detailed explanation. |
Example
err_t hal_one_wire_read_rom | ( | hal_one_wire_t * | obj, |
hal_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.
[in] | *obj | One Wire HAL object. See one_wire_t structure definition for detailed explanation. |
[out] | *device_rom_address | Buffer for One Wire device ROM information. |
Example
err_t hal_one_wire_skip_rom | ( | hal_one_wire_t * | obj | ) |
Allows the host to access device functions without providing the 64-bit ROM identification number.
[in] | *obj | One Wire HAL object. See hal_one_wire_t structure definition for detailed explanation. |
Example
err_t hal_one_wire_match_rom | ( | hal_one_wire_t * | obj, |
hal_one_wire_rom_address_t * | device_rom_address | ||
) |
Select a One Wire device with specific ID.
[in] | *obj | One Wire HAL object. See hal_one_wire_t structure definition for detailed explanation. |
[in] | device_rom_address | Buffer for One Wire device ROM information. |
Example
err_t hal_one_wire_search_first_device | ( | hal_one_wire_t * | obj, |
hal_one_wire_rom_address_t * | one_wire_device_list | ||
) |
Search and list 1st device that is One Wire capable.
[in] | *obj | One Wire HAL object. See hal_one_wire_t structure definition for detailed explanation. |
[out] | *one_wire_device_list | Buffer for One Wire device ROM information. |
Example
err_t hal_one_wire_search_next_device | ( | hal_one_wire_t * | obj, |
hal_one_wire_rom_address_t * | one_wire_device_list | ||
) |
Search devices that is One Wire capable.
[in] | *obj | One Wire HAL object. See hal_one_wire_t structure definition for detailed explanation. |
[out] | *one_wire_device_list | Buffer for One Wire device ROM information. |
Example
err_t hal_one_wire_write_byte | ( | hal_one_wire_t * | obj, |
uint8_t * | write_data_buffer, | ||
size_t | write_data_length | ||
) |
Writes byte to One Wire bus.
[in] | obj | One Wire HAL object. See hal_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 hal_one_wire_read_byte | ( | hal_one_wire_t * | obj, |
uint8_t * | read_data_buffer, | ||
size_t | read_data_length | ||
) |
Reads byte from One Wire bus.
[in] | *obj | One Wire HAL object. See hal_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
void one_wire_timing_value_a | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_b | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_c | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_d | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_e | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_f | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_h | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_i | ( | void | ) |
Configures custom One Wire delay.
void one_wire_timing_value_j | ( | void | ) |
Configures custom One Wire delay.