Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
adc.h File Reference
#include <linux/mfd/pcf50633/core.h>
#include <linux/platform_device.h>

Go to the source code of this file.

Macros

#define PCF50633_REG_ADCC3   0x52
 
#define PCF50633_REG_ADCC2   0x53
 
#define PCF50633_REG_ADCC1   0x54
 
#define PCF50633_REG_ADCS1   0x55
 
#define PCF50633_REG_ADCS2   0x56
 
#define PCF50633_REG_ADCS3   0x57
 
#define PCF50633_ADCC1_ADCSTART   0x01
 
#define PCF50633_ADCC1_RES_8BIT   0x02
 
#define PCF50633_ADCC1_RES_10BIT   0x00
 
#define PCF50633_ADCC1_AVERAGE_NO   0x00
 
#define PCF50633_ADCC1_AVERAGE_4   0x04
 
#define PCF50633_ADCC1_AVERAGE_8   0x08
 
#define PCF50633_ADCC1_AVERAGE_16   0x0c
 
#define PCF50633_ADCC1_MUX_BATSNS_RES   0x00
 
#define PCF50633_ADCC1_MUX_BATSNS_SUBTR   0x10
 
#define PCF50633_ADCC1_MUX_ADCIN2_RES   0x20
 
#define PCF50633_ADCC1_MUX_ADCIN2_SUBTR   0x30
 
#define PCF50633_ADCC1_MUX_BATTEMP   0x60
 
#define PCF50633_ADCC1_MUX_ADCIN1   0x70
 
#define PCF50633_ADCC1_AVERAGE_MASK   0x0c
 
#define PCF50633_ADCC1_ADCMUX_MASK   0xf0
 
#define PCF50633_ADCC2_RATIO_NONE   0x00
 
#define PCF50633_ADCC2_RATIO_BATTEMP   0x01
 
#define PCF50633_ADCC2_RATIO_ADCIN1   0x02
 
#define PCF50633_ADCC2_RATIO_BOTH   0x03
 
#define PCF50633_ADCC2_RATIOSETTL_100US   0x04
 
#define PCF50633_ADCC3_ACCSW_EN   0x01
 
#define PCF50633_ADCC3_NTCSW_EN   0x04
 
#define PCF50633_ADCC3_RES_DIV_TWO   0x10
 
#define PCF50633_ADCC3_RES_DIV_THREE   0x00
 
#define PCF50633_ADCS3_REF_NTCSW   0x00
 
#define PCF50633_ADCS3_REF_ACCSW   0x10
 
#define PCF50633_ADCS3_REF_2V0   0x20
 
#define PCF50633_ADCS3_REF_VISA   0x30
 
#define PCF50633_ADCS3_REF_2V0_2   0x70
 
#define PCF50633_ADCS3_ADCRDY   0x80
 
#define PCF50633_ADCS3_ADCDAT1L_MASK   0x03
 
#define PCF50633_ADCS3_ADCDAT2L_MASK   0x0c
 
#define PCF50633_ADCS3_ADCDAT2L_SHIFT   2
 
#define PCF50633_ASCS3_REF_MASK   0x70
 

Functions

int pcf50633_adc_async_read (struct pcf50633 *pcf, int mux, int avg, void(*callback)(struct pcf50633 *, void *, int), void *callback_param)
 
int pcf50633_adc_sync_read (struct pcf50633 *pcf, int mux, int avg)
 

Macro Definition Documentation

#define PCF50633_ADCC1_ADCMUX_MASK   0xf0

Definition at line 41 of file adc.h.

#define PCF50633_ADCC1_ADCSTART   0x01

Definition at line 27 of file adc.h.

#define PCF50633_ADCC1_AVERAGE_16   0x0c

Definition at line 33 of file adc.h.

#define PCF50633_ADCC1_AVERAGE_4   0x04

Definition at line 31 of file adc.h.

#define PCF50633_ADCC1_AVERAGE_8   0x08

Definition at line 32 of file adc.h.

#define PCF50633_ADCC1_AVERAGE_MASK   0x0c

Definition at line 40 of file adc.h.

#define PCF50633_ADCC1_AVERAGE_NO   0x00

Definition at line 30 of file adc.h.

#define PCF50633_ADCC1_MUX_ADCIN1   0x70

Definition at line 39 of file adc.h.

#define PCF50633_ADCC1_MUX_ADCIN2_RES   0x20

Definition at line 36 of file adc.h.

#define PCF50633_ADCC1_MUX_ADCIN2_SUBTR   0x30

Definition at line 37 of file adc.h.

#define PCF50633_ADCC1_MUX_BATSNS_RES   0x00

Definition at line 34 of file adc.h.

#define PCF50633_ADCC1_MUX_BATSNS_SUBTR   0x10

Definition at line 35 of file adc.h.

#define PCF50633_ADCC1_MUX_BATTEMP   0x60

Definition at line 38 of file adc.h.

#define PCF50633_ADCC1_RES_10BIT   0x00

Definition at line 29 of file adc.h.

#define PCF50633_ADCC1_RES_8BIT   0x02

Definition at line 28 of file adc.h.

#define PCF50633_ADCC2_RATIO_ADCIN1   0x02

Definition at line 45 of file adc.h.

#define PCF50633_ADCC2_RATIO_BATTEMP   0x01

Definition at line 44 of file adc.h.

#define PCF50633_ADCC2_RATIO_BOTH   0x03

Definition at line 46 of file adc.h.

#define PCF50633_ADCC2_RATIO_NONE   0x00

Definition at line 43 of file adc.h.

#define PCF50633_ADCC2_RATIOSETTL_100US   0x04

Definition at line 47 of file adc.h.

#define PCF50633_ADCC3_ACCSW_EN   0x01

Definition at line 49 of file adc.h.

#define PCF50633_ADCC3_NTCSW_EN   0x04

Definition at line 50 of file adc.h.

#define PCF50633_ADCC3_RES_DIV_THREE   0x00

Definition at line 52 of file adc.h.

#define PCF50633_ADCC3_RES_DIV_TWO   0x10

Definition at line 51 of file adc.h.

#define PCF50633_ADCS3_ADCDAT1L_MASK   0x03

Definition at line 61 of file adc.h.

#define PCF50633_ADCS3_ADCDAT2L_MASK   0x0c

Definition at line 62 of file adc.h.

#define PCF50633_ADCS3_ADCDAT2L_SHIFT   2

Definition at line 63 of file adc.h.

#define PCF50633_ADCS3_ADCRDY   0x80

Definition at line 59 of file adc.h.

#define PCF50633_ADCS3_REF_2V0   0x20

Definition at line 56 of file adc.h.

#define PCF50633_ADCS3_REF_2V0_2   0x70

Definition at line 58 of file adc.h.

#define PCF50633_ADCS3_REF_ACCSW   0x10

Definition at line 55 of file adc.h.

#define PCF50633_ADCS3_REF_NTCSW   0x00

Definition at line 54 of file adc.h.

#define PCF50633_ADCS3_REF_VISA   0x30

Definition at line 57 of file adc.h.

#define PCF50633_ASCS3_REF_MASK   0x70

Definition at line 64 of file adc.h.

#define PCF50633_REG_ADCC1   0x54

Definition at line 22 of file adc.h.

#define PCF50633_REG_ADCC2   0x53

Definition at line 21 of file adc.h.

#define PCF50633_REG_ADCC3   0x52

Definition at line 20 of file adc.h.

#define PCF50633_REG_ADCS1   0x55

Definition at line 23 of file adc.h.

#define PCF50633_REG_ADCS2   0x56

Definition at line 24 of file adc.h.

#define PCF50633_REG_ADCS3   0x57

Definition at line 25 of file adc.h.

Function Documentation

int pcf50633_adc_async_read ( struct pcf50633 pcf,
int  mux,
int  avg,
void(*)(struct pcf50633 *, void *, int callback,
void callback_param 
)

Definition at line 139 of file pcf50633-adc.c.

int pcf50633_adc_sync_read ( struct pcf50633 pcf,
int  mux,
int  avg 
)

Definition at line 121 of file pcf50633-adc.c.