mikroSDK Reference Manual
hal_one_wire.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2023 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
48 extern "C"{
49 #endif
50 
51 #include "hal_target.h"
52 
57 typedef struct {
58  uint8_t address[8];
60 
68 typedef struct {
69  hal_pin_name_t data_pin;
70  bool state;
72 
76 typedef enum {
78  HAL_ONE_WIRE_ERROR = (-1)
80 
185 
222 
258 
297 
345 
392 
433 
483 
527 err_t hal_one_wire_write_byte( hal_one_wire_t *obj, uint8_t *write_data_buffer, size_t write_data_length );
528 
578 err_t hal_one_wire_read_byte( hal_one_wire_t *obj, uint8_t *read_data_buffer, size_t read_data_length );
579 
585 void one_wire_timing_value_a( void );
586 
592 void one_wire_timing_value_b( void );
593 
599 void one_wire_timing_value_c( void );
600 
606 void one_wire_timing_value_d( void );
607 
613 void one_wire_timing_value_e( void );
614 
620 void one_wire_timing_value_f( void );
621 
627 void one_wire_timing_value_h( void );
628 
635 void one_wire_timing_value_i( void );
636 
642 void one_wire_timing_value_j( void );
643  // halonewiregroup // halgroup // pergroup
647 
648 #ifdef __cplusplus
649 }
650 #endif
651 
652 #endif // _HAL_ONE_WIRE_H_
653 // ------------------------------------------------------------------------- END
hal_one_wire_skip_rom
err_t hal_one_wire_skip_rom(hal_one_wire_t *obj)
Access device's level functions without transmitting ROM information.
HAL_ONE_WIRE_ERROR
Definition: hal_one_wire.h:77
hal_one_wire_write_byte
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.
one_wire_timing_value_j
void one_wire_timing_value_j(void)
Configures device-specific timing "j" sequence value.
hal_one_wire_match_rom
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.
one_wire_timing_value_b
void one_wire_timing_value_b(void)
Configures device-specific timing "b" sequence value.
HAL_ONE_WIRE_SUCCESS
Definition: hal_one_wire.h:76
one_wire_timing_value_h
void one_wire_timing_value_h(void)
Configures device-specific timing "h" sequence value.
one_wire_timing_value_i
void one_wire_timing_value_i(void)
Configures device-specific timing "i" sequence value.
hal_one_wire_search_next_device
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.
hal_target.h
HAL target macros and typedefs.
hal_pin_name_t
hal_ll_pin_name_t hal_pin_name_t
Definition: hal_target.h:59
one_wire_timing_value_c
void one_wire_timing_value_c(void)
Configures device-specific timing "c" sequence value.
hal_one_wire_reset
err_t hal_one_wire_reset(hal_one_wire_t *obj)
Resets One Wire bus.
hal_one_wire_read_byte
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.
hal_one_wire_search_first_device
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.
hal_one_wire_rom_address_t
Structure for storing One Wire device address.
Definition: hal_one_wire.h:56
hal_one_wire_read_rom
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.
one_wire_timing_value_e
void one_wire_timing_value_e(void)
Configures device-specific timing "e" sequence value.
hal_one_wire_configure_default
void hal_one_wire_configure_default(hal_one_wire_t *obj)
Configures One Wire HAL configuration structure.
one_wire_timing_value_a
void one_wire_timing_value_a(void)
Configures device-specific timing "a" sequence value.
hal_one_wire_t
One Wire HAL initialization configuration structure.
Definition: hal_one_wire.h:67
one_wire_timing_value_f
void one_wire_timing_value_f(void)
Configures device-specific timing "f" sequence value.
err_t
int32_t err_t
Definition: hal_target.h:63
hal_one_wire_open
err_t hal_one_wire_open(hal_one_wire_t *obj)
Opens One Wire HAL object.
hal_one_wire_err_t
hal_one_wire_err_t
Definition: hal_one_wire.h:75
one_wire_timing_value_d
void one_wire_timing_value_d(void)
Configures device-specific timing "d" sequence value.