mikroSDK Reference Manual
hal_one_wire.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (C) 2024 MikroElektronika d.o.o.
4** Contact: https://www.mikroe.com/contact
5**
6** This file is part of the mikroSDK package
7**
8** Commercial License Usage
9**
10** Licensees holding valid commercial NECTO compilers AI licenses may use this
11** file in accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The MikroElektronika Company.
14** For licensing terms and conditions see
15** https://www.mikroe.com/legal/software-license-agreement.
16** For further information use the contact form at
17** https://www.mikroe.com/contact.
18**
19**
20** GNU Lesser General Public License Usage
21**
22** Alternatively, this file may be used for
23** non-commercial projects under the terms of the GNU Lesser
24** General Public License version 3 as published by the Free Software
25** Foundation: https://www.gnu.org/licenses/lgpl-3.0.html.
26**
27** The above copyright notice and this permission notice shall be
28** included in all copies or substantial portions of the Software.
29**
30** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31** OF MERCHANTABILITY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
32** TO THE WARRANTIES FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
33** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
34** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
35** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
36** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37**
38****************************************************************************/
44#ifndef _HAL_ONE_WIRE_H_
45#define _HAL_ONE_WIRE_H_
46
47#ifdef __cplusplus
48extern "C"{
49#endif
50
51#include "hal_target.h"
52
57typedef struct {
58 uint8_t address[8];
60
72
80
185
222
258
297
345
392
433
483
527err_t hal_one_wire_write_byte( hal_one_wire_t *obj, uint8_t *write_data_buffer, size_t write_data_length );
528
578err_t hal_one_wire_read_byte( hal_one_wire_t *obj, uint8_t *read_data_buffer, size_t read_data_length );
579
586
593
600
607
614
621
628
636
643
644 // halonewiregroup
645 // halgroup
646 // pergroup
647
648#ifdef __cplusplus
649}
650#endif
651
652#endif // _HAL_ONE_WIRE_H_
653// ------------------------------------------------------------------------- END
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.
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.
void hal_one_wire_configure_default(hal_one_wire_t *obj)
Configures One Wire HAL configuration structure.
void one_wire_timing_value_j(void)
Configures device-specific timing "j" sequence value.
err_t hal_one_wire_open(hal_one_wire_t *obj)
Opens One Wire HAL object.
void one_wire_timing_value_i(void)
Configures device-specific timing "i" sequence value.
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.
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.
void one_wire_timing_value_f(void)
Configures device-specific timing "f" sequence value.
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.
void one_wire_timing_value_h(void)
Configures device-specific timing "h" sequence value.
err_t hal_one_wire_skip_rom(hal_one_wire_t *obj)
Access device's level functions without transmitting ROM information.
void one_wire_timing_value_b(void)
Configures device-specific timing "b" sequence value.
void one_wire_timing_value_c(void)
Configures device-specific timing "c" sequence value.
void one_wire_timing_value_e(void)
Configures device-specific timing "e" sequence value.
void one_wire_timing_value_a(void)
Configures device-specific timing "a" sequence value.
void one_wire_timing_value_d(void)
Configures device-specific timing "d" sequence value.
err_t hal_one_wire_reset(hal_one_wire_t *obj)
Resets One Wire bus.
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.
hal_one_wire_err_t
Definition hal_one_wire.h:76
@ HAL_ONE_WIRE_ERROR
Definition hal_one_wire.h:78
@ HAL_ONE_WIRE_SUCCESS
Definition hal_one_wire.h:77
HAL target macros and typedefs.
int32_t err_t
Definition hal_target.h:64
hal_ll_pin_name_t hal_pin_name_t
Definition hal_target.h:60
Structure for storing One Wire device address.
Definition hal_one_wire.h:57
One Wire HAL initialization configuration structure.
Definition hal_one_wire.h:68
hal_pin_name_t data_pin
Definition hal_one_wire.h:69
bool state
Definition hal_one_wire.h:70