Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sca3000.h File Reference

Go to the source code of this file.

Data Structures

struct  sca3000_state
 
struct  sca3000_chip_info
 

Macros

#define SCA3000_WRITE_REG(a)   (((a) << 2) | 0x02)
 
#define SCA3000_READ_REG(a)   ((a) << 2)
 
#define SCA3000_REG_ADDR_REVID   0x00
 
#define SCA3000_REVID_MAJOR_MASK   0xf0
 
#define SCA3000_REVID_MINOR_MASK   0x0f
 
#define SCA3000_REG_ADDR_STATUS   0x02
 
#define SCA3000_LOCKED   0x20
 
#define SCA3000_EEPROM_CS_ERROR   0x02
 
#define SCA3000_SPI_FRAME_ERROR   0x01
 
#define SCA3000_REG_ADDR_X_MSB   0x05
 
#define SCA3000_REG_ADDR_Y_MSB   0x07
 
#define SCA3000_REG_ADDR_Z_MSB   0x09
 
#define SCA3000_REG_ADDR_RING_OUT   0x0f
 
#define SCA3000_REG_ADDR_TEMP_MSB   0x13
 
#define SCA3000_REG_ADDR_MODE   0x14
 
#define SCA3000_MODE_PROT_MASK   0x28
 
#define SCA3000_RING_BUF_ENABLE   0x80
 
#define SCA3000_RING_BUF_8BIT   0x40
 
#define SCA3000_FREE_FALL_DETECT   0x10
 
#define SCA3000_MEAS_MODE_NORMAL   0x00
 
#define SCA3000_MEAS_MODE_OP_1   0x01
 
#define SCA3000_MEAS_MODE_OP_2   0x02
 
#define SCA3000_MEAS_MODE_MOT_DET   0x03
 
#define SCA3000_REG_ADDR_BUF_COUNT   0x15
 
#define SCA3000_REG_ADDR_INT_STATUS   0x16
 
#define SCA3000_INT_STATUS_THREE_QUARTERS   0x80
 
#define SCA3000_INT_STATUS_HALF   0x40
 
#define SCA3000_INT_STATUS_FREE_FALL   0x08
 
#define SCA3000_INT_STATUS_Y_TRIGGER   0x04
 
#define SCA3000_INT_STATUS_X_TRIGGER   0x02
 
#define SCA3000_INT_STATUS_Z_TRIGGER   0x01
 
#define SCA3000_REG_ADDR_CTRL_SEL   0x18
 
#define SCA3000_REG_CTRL_SEL_I2C_DISABLE   0x01
 
#define SCA3000_REG_CTRL_SEL_MD_CTRL   0x02
 
#define SCA3000_REG_CTRL_SEL_MD_Y_TH   0x03
 
#define SCA3000_REG_CTRL_SEL_MD_X_TH   0x04
 
#define SCA3000_REG_CTRL_SEL_MD_Z_TH   0x05
 
#define SCA3000_REG_CTRL_SEL_OUT_CTRL   0x0B
 
#define SCA3000_OUT_CTRL_PROT_MASK   0xE0
 
#define SCA3000_OUT_CTRL_BUF_X_EN   0x10
 
#define SCA3000_OUT_CTRL_BUF_Y_EN   0x08
 
#define SCA3000_OUT_CTRL_BUF_Z_EN   0x04
 
#define SCA3000_OUT_CTRL_BUF_DIV_4   0x02
 
#define SCA3000_OUT_CTRL_BUF_DIV_2   0x01
 
#define SCA3000_MD_CTRL_PROT_MASK   0xC0
 
#define SCA3000_MD_CTRL_OR_Y   0x01
 
#define SCA3000_MD_CTRL_OR_X   0x02
 
#define SCA3000_MD_CTRL_OR_Z   0x04
 
#define SCA3000_MD_CTRL_AND_Y   0x08
 
#define SCA3000_MD_CTRL_AND_X   0x10
 
#define SAC3000_MD_CTRL_AND_Z   0x20
 
#define SCA3000_REG_ADDR_UNLOCK   0x1e
 
#define SCA3000_REG_ADDR_INT_MASK   0x21
 
#define SCA3000_INT_MASK_PROT_MASK   0x1C
 
#define SCA3000_INT_MASK_RING_THREE_QUARTER   0x80
 
#define SCA3000_INT_MASK_RING_HALF   0x40
 
#define SCA3000_INT_MASK_ALL_INTS   0x02
 
#define SCA3000_INT_MASK_ACTIVE_HIGH   0x01
 
#define SCA3000_INT_MASK_ACTIVE_LOW   0x00
 
#define SCA3000_REG_ADDR_CTRL_DATA   0x22
 
#define SCA3000_OP_MODE_BYPASS   0x01
 
#define SCA3000_OP_MODE_NARROW   0x02
 
#define SCA3000_OP_MODE_WIDE   0x04
 
#define SCA3000_MAX_TX   6
 
#define SCA3000_MAX_RX   2
 

Functions

int sca3000_read_data_short (struct sca3000_state *st, u8 reg_address_high, int len)
 
int sca3000_write_reg (struct sca3000_state *st, u8 address, u8 val)
 

Macro Definition Documentation

#define SAC3000_MD_CTRL_AND_Z   0x20

Definition at line 122 of file sca3000.h.

#define SCA3000_EEPROM_CS_ERROR   0x02

Definition at line 50 of file sca3000.h.

#define SCA3000_FREE_FALL_DETECT   0x10

Definition at line 71 of file sca3000.h.

#define SCA3000_INT_MASK_ACTIVE_HIGH   0x01

Definition at line 136 of file sca3000.h.

#define SCA3000_INT_MASK_ACTIVE_LOW   0x00

Definition at line 137 of file sca3000.h.

#define SCA3000_INT_MASK_ALL_INTS   0x02

Definition at line 135 of file sca3000.h.

#define SCA3000_INT_MASK_PROT_MASK   0x1C

Definition at line 130 of file sca3000.h.

#define SCA3000_INT_MASK_RING_HALF   0x40

Definition at line 133 of file sca3000.h.

#define SCA3000_INT_MASK_RING_THREE_QUARTER   0x80

Definition at line 132 of file sca3000.h.

#define SCA3000_INT_STATUS_FREE_FALL   0x08

Definition at line 89 of file sca3000.h.

#define SCA3000_INT_STATUS_HALF   0x40

Definition at line 87 of file sca3000.h.

#define SCA3000_INT_STATUS_THREE_QUARTERS   0x80

Definition at line 86 of file sca3000.h.

#define SCA3000_INT_STATUS_X_TRIGGER   0x02

Definition at line 91 of file sca3000.h.

#define SCA3000_INT_STATUS_Y_TRIGGER   0x04

Definition at line 90 of file sca3000.h.

#define SCA3000_INT_STATUS_Z_TRIGGER   0x01

Definition at line 92 of file sca3000.h.

#define SCA3000_LOCKED   0x20

Definition at line 49 of file sca3000.h.

#define SCA3000_MAX_RX   2

Definition at line 157 of file sca3000.h.

#define SCA3000_MAX_TX   6

Definition at line 156 of file sca3000.h.

#define SCA3000_MD_CTRL_AND_X   0x10

Definition at line 121 of file sca3000.h.

#define SCA3000_MD_CTRL_AND_Y   0x08

Definition at line 120 of file sca3000.h.

#define SCA3000_MD_CTRL_OR_X   0x02

Definition at line 117 of file sca3000.h.

#define SCA3000_MD_CTRL_OR_Y   0x01

Definition at line 116 of file sca3000.h.

#define SCA3000_MD_CTRL_OR_Z   0x04

Definition at line 118 of file sca3000.h.

#define SCA3000_MD_CTRL_PROT_MASK   0xC0

Definition at line 115 of file sca3000.h.

#define SCA3000_MEAS_MODE_MOT_DET   0x03

Definition at line 80 of file sca3000.h.

#define SCA3000_MEAS_MODE_NORMAL   0x00

Definition at line 72 of file sca3000.h.

#define SCA3000_MEAS_MODE_OP_1   0x01

Definition at line 73 of file sca3000.h.

#define SCA3000_MEAS_MODE_OP_2   0x02

Definition at line 74 of file sca3000.h.

#define SCA3000_MODE_PROT_MASK   0x28

Definition at line 64 of file sca3000.h.

#define SCA3000_OP_MODE_BYPASS   0x01

Definition at line 153 of file sca3000.h.

#define SCA3000_OP_MODE_NARROW   0x02

Definition at line 154 of file sca3000.h.

#define SCA3000_OP_MODE_WIDE   0x04

Definition at line 155 of file sca3000.h.

#define SCA3000_OUT_CTRL_BUF_DIV_2   0x01

Definition at line 110 of file sca3000.h.

#define SCA3000_OUT_CTRL_BUF_DIV_4   0x02

Definition at line 109 of file sca3000.h.

#define SCA3000_OUT_CTRL_BUF_X_EN   0x10

Definition at line 106 of file sca3000.h.

#define SCA3000_OUT_CTRL_BUF_Y_EN   0x08

Definition at line 107 of file sca3000.h.

#define SCA3000_OUT_CTRL_BUF_Z_EN   0x04

Definition at line 108 of file sca3000.h.

#define SCA3000_OUT_CTRL_PROT_MASK   0xE0

Definition at line 105 of file sca3000.h.

#define SCA3000_READ_REG (   a)    ((a) << 2)

Definition at line 42 of file sca3000.h.

#define SCA3000_REG_ADDR_BUF_COUNT   0x15

Definition at line 82 of file sca3000.h.

#define SCA3000_REG_ADDR_CTRL_DATA   0x22

Definition at line 140 of file sca3000.h.

#define SCA3000_REG_ADDR_CTRL_SEL   0x18

Definition at line 95 of file sca3000.h.

#define SCA3000_REG_ADDR_INT_MASK   0x21

Definition at line 129 of file sca3000.h.

#define SCA3000_REG_ADDR_INT_STATUS   0x16

Definition at line 84 of file sca3000.h.

#define SCA3000_REG_ADDR_MODE   0x14

Definition at line 63 of file sca3000.h.

#define SCA3000_REG_ADDR_REVID   0x00

Definition at line 44 of file sca3000.h.

#define SCA3000_REG_ADDR_RING_OUT   0x0f

Definition at line 58 of file sca3000.h.

#define SCA3000_REG_ADDR_STATUS   0x02

Definition at line 48 of file sca3000.h.

#define SCA3000_REG_ADDR_TEMP_MSB   0x13

Definition at line 61 of file sca3000.h.

#define SCA3000_REG_ADDR_UNLOCK   0x1e

Definition at line 127 of file sca3000.h.

#define SCA3000_REG_ADDR_X_MSB   0x05

Definition at line 54 of file sca3000.h.

#define SCA3000_REG_ADDR_Y_MSB   0x07

Definition at line 55 of file sca3000.h.

#define SCA3000_REG_ADDR_Z_MSB   0x09

Definition at line 56 of file sca3000.h.

#define SCA3000_REG_CTRL_SEL_I2C_DISABLE   0x01

Definition at line 97 of file sca3000.h.

#define SCA3000_REG_CTRL_SEL_MD_CTRL   0x02

Definition at line 98 of file sca3000.h.

#define SCA3000_REG_CTRL_SEL_MD_X_TH   0x04

Definition at line 100 of file sca3000.h.

#define SCA3000_REG_CTRL_SEL_MD_Y_TH   0x03

Definition at line 99 of file sca3000.h.

#define SCA3000_REG_CTRL_SEL_MD_Z_TH   0x05

Definition at line 101 of file sca3000.h.

#define SCA3000_REG_CTRL_SEL_OUT_CTRL   0x0B

Definition at line 104 of file sca3000.h.

#define SCA3000_REVID_MAJOR_MASK   0xf0

Definition at line 45 of file sca3000.h.

#define SCA3000_REVID_MINOR_MASK   0x0f

Definition at line 46 of file sca3000.h.

#define SCA3000_RING_BUF_8BIT   0x40

Definition at line 67 of file sca3000.h.

#define SCA3000_RING_BUF_ENABLE   0x80

Definition at line 66 of file sca3000.h.

#define SCA3000_SPI_FRAME_ERROR   0x01

Definition at line 51 of file sca3000.h.

#define SCA3000_WRITE_REG (   a)    (((a) << 2) | 0x02)

Definition at line 41 of file sca3000.h.

Function Documentation

int sca3000_read_data_short ( struct sca3000_state st,
u8  reg_address_high,
int  len 
)

Definition at line 89 of file sca3000_core.c.

int sca3000_write_reg ( struct sca3000_state st,
u8  address,
u8  val 
)

sca3000_write_reg() write a single register : address of register on chip : value to be written to register

The main lock must be held.

Definition at line 82 of file sca3000_core.c.