Skip to the content.

1-wire Master Drivers

1. Kernel driver ds2482

支持芯片:

Maxim DS2482-100, Maxim DS2482-800

前缀: ‘ds2482’

扫描地址: None

数据表:

http://datasheets.maxim-ic.com/en/ds/DS2482-100.pdf

http://datasheets.maxim-ic.com/en/ds/DS2482-800.pdf

作者: Ben Gardner bgardner@wabtec.com

1.1 Description

Maxim/Dallas Semiconductor DS2482 是一款 I2C 器件,提供一条 (DS2482-100) 或八条 (DS2482-800) 1 线总线。

1.2 General Remarks

有效地址是 0x18, 0x19, 0x1a, and 0x1b.

但是,如果不写入 i2c 总线,则无法检测到该设备,因此不进行任何检测。 您应该显式实例化该设备。

$ modprobe ds2482
$ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device

2. Kernel driver ds2490

支持芯片:

Maxim DS2490 based

作者: Evgeniy Polyakov johnpol@2ka.mipt.ru

2.1 Description

Maxim/Dallas Semiconductor DS2490 是一款可以构建 USB <-> W1 桥接器的芯片。

DS9490(R)是一款USB<->W1总线主控器件,具有0x81系列ID集成芯片和DS2490低级运算芯片。

注意事项和限制。

2008/6/3 David Fries David@Fries.net

3. Kernel driver mxc_w1

支持芯片:

Freescale MX27, MX31 and probably other i.MX SoCs

Datasheets:

http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1

http://cache.freescale.com/files/dsp/doc/archive/MCIMX27.pdf?fsrch=1&WT_TYPE=Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation

作者:

最初基于 Freescale 代码,由 Sascha Hauer 为主线准备 s.hauer@pengutronix.de

4. Kernel driver for omap HDQ/1-wire module

支持芯片:

HDQ/1-wire controller on the TI OMAP 2430/3430 platforms.

有关 HDQ 基础知识的有用链接:

http://focus.ti.com/lit/an/slua408a/slua408a.pdf

4.1 Description

TI OMAP2430/3430 平台的 HDQ/1-Wire 模块实现 Benchmark HDQ 和 Dallas Semiconductor 1-Wire 协议的主功能的硬件协议。 这些协议使用单线在主设备(HDQ/1-Wire 控制器)和从设备(HDQ/1-Wire 外部兼容设备)之间进行通信。

HDQ/1-Wire 模块的典型应用是与电池监视器(电量计)集成电路的通信。

该控制器支持 HDQ 和 1-wire 模式下的操作。 HDQ 和 1-wire 模式的本质区别在于从设备如何响应初始化脉冲。在 HDQ 模式下,固件不需要主机向从设备创建初始化脉冲。但是,从设备可以通过使用 初始化脉冲(也称为中断脉冲)。从机不会像 1-Wire 协议中那样响应存在脉冲。

4.2 Remarks

驱动程序(drivers/w1/masters/omap_hdq.c)支持控制器的HDQ模式。 在这种模式下,由于我们无法读取遵守 W1 规范的 ID(family:id:crc),因此可以将模块参数传递给驱动程序,该驱动程序将用于计算 CRC 并将适当的从站 ID 传回给驱动程序 W1核心。

默认情况下,主驱动程序和 BQ 从机 i/f 驱动程序(drivers/w1/slaves/w1_bq27000.c) 将 ID 设置为 1。请注意,如果需要,请使用不同的 ID 加载两个模块,但请注意所使用的 ID 主驱动程序和从驱动程序加载应该相同。

e.g:

insmod omap_hdq.ko W1_ID=2
insmod w1_bq27000.ko F_ID=2

该驱动程序还支持 1 线模式。 在此模式下,无需传递从站 ID 作为参数。 驱动程序将使用 SEARCH_ROM 过程自动检测连接到总线的从机。 可以通过在 DT 中将“ti,mode”属性设置为“1w”来选择 1 线模式(有关更多详细信息,请参阅 Documentation/devicetree/bindings/w1/omap-hdq.txt)。 默认情况下,驱动程序处于 HDQ 模式。

5. Kernel driver w1-gpio

作者: Ville Syrjala syrjala@sci.fi

5.1 Description

GPIO 1 线总线主驱动器。 驱动程序使用 GPIO API 来控制线路,并且可以使用 GPIO 机器描述符表指定 GPIO 引脚。 也可以使用设备树定义主设备,请参阅 Documentation/devicetree/bindings/w1/w1-gpio.yaml

5.2 Example (mach-at91)

#include <linux/gpio/machine.h>
#include <linux/w1-gpio.h>

static struct gpiod_lookup_table foo_w1_gpiod_table = {
      .dev_id = "w1-gpio",
      .table = {
              GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0,
                      GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN),
      },
};

static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
      .ext_pullup_enable_pin  = -EINVAL,
};

static struct platform_device foo_w1_device = {
      .name                   = "w1-gpio",
      .id                     = -1,
      .dev.platform_data      = &foo_w1_gpio_pdata,
};

...
      at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1);
      at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1);
      gpiod_add_lookup_table(&foo_w1_gpiod_table);
      platform_device_register(&foo_w1_device);