Blame view

include/w1.h 893 Bytes
d3e19cf91   Maxime Ripard   w1: Add 1-Wire uc...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  /* SPDX-License-Identifier:	GPL-2.0+
   *
   * Copyright (c) 2015 Free Electrons
   * Copyright (c) 2015 NextThing Co
   *
   */
  
  #ifndef __W1_H
  #define __W1_H
  
  #include <dm.h>
  
  #define W1_FAMILY_DS24B33	0x23
  #define W1_FAMILY_DS2431	0x2d
f9c87adc4   Martin Fuzzey   w1-eeprom: Add su...
15
  #define W1_FAMILY_DS2502	0x09
84e55bdd8   Eugen Hristev   W1-EEPROM: add sa...
16
  #define W1_FAMILY_EEP_SANDBOX	0xfe
d3e19cf91   Maxime Ripard   w1: Add 1-Wire uc...
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  
  struct w1_device {
  	u64	id;
  };
  
  struct w1_ops {
  	u8	(*read_byte)(struct udevice *dev);
  	bool	(*reset)(struct udevice *dev);
  	u8	(*triplet)(struct udevice *dev, bool bdir);
  	void	(*write_byte)(struct udevice *dev, u8 byte);
  };
  
  int w1_get_bus(int busnum, struct udevice **busp);
  u8 w1_get_device_family(struct udevice *dev);
  
  int w1_read_buf(struct udevice *dev, u8 *buf, unsigned int count);
  int w1_read_byte(struct udevice *dev);
  int w1_reset_select(struct udevice *dev);
  int w1_write_buf(struct udevice *dev, u8 *buf, unsigned int count);
  int w1_write_byte(struct udevice *dev, u8 byte);
  
  #endif