Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
hmc5843.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  hmc5843_chip_info
 
struct  hmc5843_data
 

Macros

#define HMC5843_CONFIG_REG_A   0x00
 
#define HMC5843_CONFIG_REG_B   0x01
 
#define HMC5843_MODE_REG   0x02
 
#define HMC5843_DATA_OUT_X_MSB_REG   0x03
 
#define HMC5843_DATA_OUT_X_LSB_REG   0x04
 
#define HMC5843_DATA_OUT_Y_MSB_REG   0x05
 
#define HMC5843_DATA_OUT_Y_LSB_REG   0x06
 
#define HMC5843_DATA_OUT_Z_MSB_REG   0x07
 
#define HMC5843_DATA_OUT_Z_LSB_REG   0x08
 
#define HMC5883_DATA_OUT_Z_MSB_REG   0x05
 
#define HMC5883_DATA_OUT_Z_LSB_REG   0x06
 
#define HMC5883_DATA_OUT_Y_MSB_REG   0x07
 
#define HMC5883_DATA_OUT_Y_LSB_REG   0x08
 
#define HMC5843_STATUS_REG   0x09
 
#define HMC5843_ID_REG_A   0x0A
 
#define HMC5843_ID_REG_B   0x0B
 
#define HMC5843_ID_REG_C   0x0C
 
#define HMC5843_ID_REG_LENGTH   0x03
 
#define HMC5843_ID_STRING   "H43"
 
#define HMC5843_I2C_ADDRESS   0x1E
 
#define HMC5843_RANGE_GAIN_OFFSET   0x05
 
#define HMC5843_RANGE_GAIN_DEFAULT   0x01
 
#define HMC5843_RANGE_GAIN_MAX   0x07
 
#define HMC5843_DATA_READY   0x01
 
#define HMC5843_DATA_OUTPUT_LOCK   0x02
 
#define HMC5843_VOLTAGE_REGULATOR_ENABLED   0x04
 
#define HMC5843_MODE_CONVERSION_CONTINUOUS   0x00
 
#define HMC5843_MODE_CONVERSION_SINGLE   0x01
 
#define HMC5843_MODE_IDLE   0x02
 
#define HMC5843_MODE_SLEEP   0x03
 
#define HMC5843_MODE_MASK   0x03
 
#define HMC5843_RATE_OFFSET   0x02
 
#define HMC5843_RATE_BITMASK   0x1C
 
#define HMC5843_RATE_NOT_USED   0x07
 
#define HMC5843_MEAS_CONF_NORMAL   0x00
 
#define HMC5843_MEAS_CONF_POSITIVE_BIAS   0x01
 
#define HMC5843_MEAS_CONF_NEGATIVE_BIAS   0x02
 
#define HMC5843_MEAS_CONF_NOT_USED   0x03
 
#define HMC5843_MEAS_CONF_MASK   0x03
 
#define HMC5843_CHANNEL(axis, add)
 
#define HMC5843_PM_OPS   NULL
 

Enumerations

enum  hmc5843_ids { HMC5843_ID, HMC5883_ID, HMC5883L_ID }
 

Functions

 MODULE_DEVICE_TABLE (i2c, hmc5843_id)
 
 module_i2c_driver (hmc5843_driver)
 
 MODULE_AUTHOR ("Shubhrajyoti Datta <[email protected]")
 
 MODULE_DESCRIPTION ("HMC5843/5883/5883L driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define HMC5843_CHANNEL (   axis,
  add 
)
Value:
{ \
.type = IIO_MAGN, \
.modified = 1, \
.channel2 = IIO_MOD_##axis, \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = add \
}

Definition at line 562 of file hmc5843.c.

#define HMC5843_CONFIG_REG_A   0x00

Definition at line 30 of file hmc5843.c.

#define HMC5843_CONFIG_REG_B   0x01

Definition at line 31 of file hmc5843.c.

#define HMC5843_DATA_OUT_X_LSB_REG   0x04

Definition at line 34 of file hmc5843.c.

#define HMC5843_DATA_OUT_X_MSB_REG   0x03

Definition at line 33 of file hmc5843.c.

#define HMC5843_DATA_OUT_Y_LSB_REG   0x06

Definition at line 36 of file hmc5843.c.

#define HMC5843_DATA_OUT_Y_MSB_REG   0x05

Definition at line 35 of file hmc5843.c.

#define HMC5843_DATA_OUT_Z_LSB_REG   0x08

Definition at line 38 of file hmc5843.c.

#define HMC5843_DATA_OUT_Z_MSB_REG   0x07

Definition at line 37 of file hmc5843.c.

#define HMC5843_DATA_OUTPUT_LOCK   0x02

Definition at line 76 of file hmc5843.c.

#define HMC5843_DATA_READY   0x01

Definition at line 75 of file hmc5843.c.

#define HMC5843_I2C_ADDRESS   0x1E

Definition at line 61 of file hmc5843.c.

#define HMC5843_ID_REG_A   0x0A

Definition at line 45 of file hmc5843.c.

#define HMC5843_ID_REG_B   0x0B

Definition at line 46 of file hmc5843.c.

#define HMC5843_ID_REG_C   0x0C

Definition at line 47 of file hmc5843.c.

#define HMC5843_ID_REG_LENGTH   0x03

Definition at line 59 of file hmc5843.c.

#define HMC5843_ID_STRING   "H43"

Definition at line 60 of file hmc5843.c.

#define HMC5843_MEAS_CONF_MASK   0x03

Definition at line 104 of file hmc5843.c.

#define HMC5843_MEAS_CONF_NEGATIVE_BIAS   0x02

Definition at line 102 of file hmc5843.c.

#define HMC5843_MEAS_CONF_NORMAL   0x00

Definition at line 100 of file hmc5843.c.

#define HMC5843_MEAS_CONF_NOT_USED   0x03

Definition at line 103 of file hmc5843.c.

#define HMC5843_MEAS_CONF_POSITIVE_BIAS   0x01

Definition at line 101 of file hmc5843.c.

#define HMC5843_MODE_CONVERSION_CONTINUOUS   0x00

Definition at line 83 of file hmc5843.c.

#define HMC5843_MODE_CONVERSION_SINGLE   0x01

Definition at line 84 of file hmc5843.c.

#define HMC5843_MODE_IDLE   0x02

Definition at line 85 of file hmc5843.c.

#define HMC5843_MODE_MASK   0x03

Definition at line 87 of file hmc5843.c.

#define HMC5843_MODE_REG   0x02

Definition at line 32 of file hmc5843.c.

#define HMC5843_MODE_SLEEP   0x03

Definition at line 86 of file hmc5843.c.

#define HMC5843_PM_OPS   NULL

Definition at line 740 of file hmc5843.c.

#define HMC5843_RANGE_GAIN_DEFAULT   0x01

Definition at line 69 of file hmc5843.c.

#define HMC5843_RANGE_GAIN_MAX   0x07

Definition at line 70 of file hmc5843.c.

#define HMC5843_RANGE_GAIN_OFFSET   0x05

Definition at line 68 of file hmc5843.c.

#define HMC5843_RATE_BITMASK   0x1C

Definition at line 94 of file hmc5843.c.

#define HMC5843_RATE_NOT_USED   0x07

Definition at line 95 of file hmc5843.c.

#define HMC5843_RATE_OFFSET   0x02

Definition at line 93 of file hmc5843.c.

#define HMC5843_STATUS_REG   0x09

Definition at line 44 of file hmc5843.c.

#define HMC5843_VOLTAGE_REGULATOR_ENABLED   0x04

Definition at line 78 of file hmc5843.c.

#define HMC5883_DATA_OUT_Y_LSB_REG   0x08

Definition at line 43 of file hmc5843.c.

#define HMC5883_DATA_OUT_Y_MSB_REG   0x07

Definition at line 42 of file hmc5843.c.

#define HMC5883_DATA_OUT_Z_LSB_REG   0x06

Definition at line 41 of file hmc5843.c.

#define HMC5883_DATA_OUT_Z_MSB_REG   0x05

Definition at line 40 of file hmc5843.c.

Enumeration Type Documentation

Enumerator:
HMC5843_ID 
HMC5883_ID 
HMC5883L_ID 

Definition at line 49 of file hmc5843.c.

Function Documentation

MODULE_AUTHOR ( )
MODULE_DESCRIPTION ( "HMC5843/5883/5883L driver"  )
MODULE_DEVICE_TABLE ( i2c  ,
hmc5843_id   
)
module_i2c_driver ( hmc5843_driver  )
MODULE_LICENSE ( "GPL"  )