FreeBSD kernel IICBUS device code
|
#include <sys/cdefs.h>
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <machine/bus.h>
#include <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
Go to the source code of this file.
Data Structures | |
struct | htu21_softc |
Macros | |
#define | HTU21_ADDR 0x40 |
#define | HTU21_GET_TEMP 0xe3 |
#define | HTU21_GET_HUM 0xe5 |
#define | HTU21_GET_TEMP_NH 0xf3 |
#define | HTU21_GET_HUM_NH 0xf5 |
#define | HTU21_WRITE_CFG 0xe6 |
#define | HTU21_READ_CFG 0xe7 |
#define | HTU21_RESET 0xfe |
#define | HTU2x_SERIAL0_0 0xfa |
#define | HTU2x_SERIAL0_1 0x0f |
#define | HTU2x_SERIAL1_0 0xfc |
#define | HTU2x_SERIAL1_1 0xc9 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static uint8_t | calc_crc (uint16_t data) |
static int | check_crc_16 (const uint8_t *data, uint8_t expected) |
static int | check_crc_8 (const uint8_t data, uint8_t expected) |
static int | htu21_get_measurement (device_t dev, uint8_t cmd, uint8_t *data, int count) |
static int | htu21_get_measurement_nohold (device_t dev, uint8_t cmd, uint8_t *data, int count) |
static int | htu21_temp_sysctl (SYSCTL_HANDLER_ARGS) |
static int | htu21_rh_sysctl (SYSCTL_HANDLER_ARGS) |
static int | htu21_get_cfg (device_t dev, uint8_t *cfg) |
static int | htu21_set_cfg (device_t dev, uint8_t cfg) |
static int | htu21_heater_sysctl (SYSCTL_HANDLER_ARGS) |
static int | htu21_power_sysctl (SYSCTL_HANDLER_ARGS) |
static int | htu21_get_serial (device_t dev) |
static void | htu21_start (void *arg) |
static int | htu21_probe (device_t dev) |
static int | htu21_attach (device_t dev) |
static int | htu21_detach (device_t dev) |
DRIVER_MODULE (htu21, iicbus, htu21_driver, htu21_devclass, 0, 0) | |
MODULE_DEPEND (htu21, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER) | |
MODULE_VERSION (htu21, 1) | |
IICBUS_FDT_PNP_INFO (compat_data) | |
Variables | |
static device_method_t | htu21_methods [] |
static driver_t | htu21_driver |
static devclass_t | htu21_devclass |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 92 of file htu21.c.
References data.
Referenced by check_crc_16(), and check_crc_8().
|
static |
Definition at line 108 of file htu21.c.
References calc_crc(), and data.
Referenced by htu21_get_serial(), htu21_rh_sysctl(), and htu21_temp_sysctl().
|
static |
Definition at line 117 of file htu21.c.
References calc_crc(), and data.
Referenced by htu21_get_serial().
DRIVER_MODULE | ( | htu21 | , |
iicbus | , | ||
htu21_driver | , | ||
htu21_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
Definition at line 487 of file htu21.c.
References dev, htu21_start(), htu21_softc::sc_addr, and htu21_softc::sc_dev.
|
static |
Definition at line 255 of file htu21.c.
References iic_msg::buf, dev, iic_msg::flags, HTU21_READ_CFG, IIC_INTRWAIT, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, iicbus_transfer_excl(), iic_msg::len, msgs, htu21_softc::sc_addr, and iic_msg::slave.
Referenced by htu21_heater_sysctl(), and htu21_power_sysctl().
|
static |
Definition at line 126 of file htu21.c.
References iic_msg::buf, data, dev, iic_msg::flags, IIC_INTRWAIT, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, iicbus_transfer_excl(), iic_msg::len, msgs, htu21_softc::sc_addr, and iic_msg::slave.
Referenced by htu21_rh_sysctl(), and htu21_temp_sysctl().
|
static |
Definition at line 149 of file htu21.c.
References iic_msg::buf, data, dev, iic_msg::flags, IIC_ENOACK, IIC_INTRWAIT, IIC_M_RD, IIC_M_WR, iicbus_transfer_excl(), iic_msg::len, msgs, htu21_softc::sc_addr, and iic_msg::slave.
Referenced by htu21_rh_sysctl(), and htu21_temp_sysctl().
|
static |
Definition at line 348 of file htu21.c.
References iic_msg::buf, check_crc_16(), check_crc_8(), data, dev, iic_msg::flags, HTU2x_SERIAL0_0, HTU2x_SERIAL0_1, HTU2x_SERIAL1_0, HTU2x_SERIAL1_1, IIC_INTRWAIT, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, iicbus_transfer_excl(), iic_msg::len, msgs, htu21_softc::sc_addr, htu21_softc::sc_serial, and iic_msg::slave.
Referenced by htu21_start().
|
static |
Definition at line 301 of file htu21.c.
References dev, htu21_get_cfg(), and htu21_set_cfg().
Referenced by htu21_start().
|
static |
Definition at line 326 of file htu21.c.
References dev, and htu21_get_cfg().
Referenced by htu21_start().
|
static |
Definition at line 462 of file htu21.c.
References addr, compat_data, dev, and HTU21_ADDR.
|
static |
Definition at line 220 of file htu21.c.
References check_crc_16(), dev, HTU21_GET_HUM, HTU21_GET_HUM_NH, htu21_get_measurement(), htu21_get_measurement_nohold(), htu21_softc::sc_errcount, and htu21_softc::sc_hold.
Referenced by htu21_start().
|
static |
Definition at line 280 of file htu21.c.
References iic_msg::buf, buf, dev, iic_msg::flags, HTU21_WRITE_CFG, IIC_INTRWAIT, IIC_M_WR, iicbus_transfer_excl(), iic_msg::len, htu21_softc::sc_addr, and iic_msg::slave.
Referenced by htu21_heater_sysctl().
|
static |
Definition at line 412 of file htu21.c.
References dev, htu21_get_serial(), htu21_heater_sysctl(), htu21_power_sysctl(), htu21_rh_sysctl(), htu21_temp_sysctl(), htu21_softc::sc_dev, htu21_softc::sc_errcount, htu21_softc::sc_hold, and htu21_softc::sc_serial.
Referenced by htu21_attach().
|
static |
Definition at line 185 of file htu21.c.
References check_crc_16(), dev, htu21_get_measurement(), htu21_get_measurement_nohold(), HTU21_GET_TEMP, HTU21_GET_TEMP_NH, htu21_softc::sc_errcount, and htu21_softc::sc_hold.
Referenced by htu21_start().
IICBUS_FDT_PNP_INFO | ( | compat_data | ) |
MODULE_DEPEND | ( | htu21 | , |
iicbus | , | ||
IICBUS_MINVER | , | ||
IICBUS_PREFVER | , | ||
IICBUS_MAXVER | |||
) |
MODULE_VERSION | ( | htu21 | , |
1 | |||
) |
|
static |
|
static |