linux/drivers/mxc/pmic/mc13783/pmic_adc_defs.h File Reference

This header contains all defines for PMIC(mc13783) ADC driver. More...

Data Structures

struct  t_adc_param
struct  t_monitoring_param

Typedefs

typedef enum adc_state t_adc_state
typedef enum reading_mode t_reading_mode
typedef enum check_mode t_check_mode

Enumerations

enum  adc_state {
  ADC_FREE,
  ADC_USED,
  ADC_MONITORING
}
enum  reading_mode {
  M_LITHIUM_CELL = 0x000001,
  M_CHARGE_CURRENT = 0x000002,
  M_BATTERY_CURRENT = 0x000004,
  M_THERMISTOR = 0x000008,
  M_DIE_TEMPERATURE = 0x000010,
  M_UID = 0x000020,
  M_LITHIUM_CELL = 0x000001,
  M_CHARGE_CURRENT = 0x000002,
  M_BATTERY_CURRENT = 0x000004
}
enum  check_mode {
  CHECK_LOW,
  CHECK_HIGH,
  CHECK_LOW_OR_HIGH
}

Functions

static int pmic_adc_filter (t_touch_screen *ts_curr)
int mc13783_adc_request (bool read_ts)
void update_buffer (void)
int mc13783_adc_release (int adc_index)
t_reading_mode mc13783_set_read_mode (t_channel channel)
PMIC_STATUS mc13783_adc_read_ts (t_touch_screen *touch_sample, int wait_tsi)

Detailed Description

This header contains all defines for PMIC(mc13783) ADC driver.


Typedef Documentation

typedef enum adc_state t_adc_state

Define state mode of ADC.

typedef enum check_mode t_check_mode

This enumeration, is used to configure the monitoring mode.

This enumeration, is used to configure the mode of ADC.


Enumeration Type Documentation

enum adc_state

Define state mode of ADC.

Enumerator:
ADC_FREE 

Free.

ADC_USED 

Used.

ADC_MONITORING 

Monitoring

enum check_mode

This enumeration, is used to configure the monitoring mode.

Enumerator:
CHECK_LOW 

Comparator low level

CHECK_HIGH 

Comparator high level

CHECK_LOW_OR_HIGH 

Comparator low or high level

This enumeration, is used to configure the mode of ADC.

Enumerator:
M_LITHIUM_CELL 

Enables lithium cell reading

M_CHARGE_CURRENT 

Enables charge current reading

M_BATTERY_CURRENT 

Enables battery current reading

M_THERMISTOR 

Enables thermistor reading

M_DIE_TEMPERATURE 

Enables die temperature reading

M_UID 

Enables UID reading


Function Documentation

PMIC_STATUS mc13783_adc_read_ts ( t_touch_screen ts_value,
int  wait_tsi 
)

This function read the touch screen value.

Parameters:
touch_sample return value of touch screen
wait_tsi if true, this function is synchronous (wait in TSI event).
Returns:
This function returns 0.

This function read the touch screen value.

Parameters:
ts_value return value of touch screen
wait_tsi if true, this function is synchronous (wait in TSI event).
Returns:
This function returns 0.

References t_touch_screen::contact_resistance, mc13783_adc_convert(), mc13783_adc_init_param(), t_adc_param::read_ts, suspend_flag, t_adc_param::ts_value, t_adc_param::wait_tsi, t_touch_screen::x_position, t_touch_screen::x_position1, t_touch_screen::x_position2, t_touch_screen::x_position3, t_touch_screen::y_position, t_touch_screen::y_position1, t_touch_screen::y_position2, and t_touch_screen::y_position3.

Referenced by pmic_adc_get_touch_sample().

int mc13783_adc_release ( int  adc_index  ) 

This function release an ADC.

Parameters:
adc_index index of ADC to be released.
Returns:
This function returns 0 if successful.

References ADC_FREE, ADC_MONITORING, ADC_USED, suspend_flag, suspendq, and swait.

Referenced by mc13783_adc_convert(), and pmic_adc_deactive_comparator().

int mc13783_adc_request ( bool  read_ts  ) 

This function request a ADC.

Returns:
This function returns index of ADC to be used (0 or 1) if successful. return -1 if error.

References ADC_USED.

Referenced by mc13783_adc_convert(), and pmic_adc_active_comparator().

t_reading_mode mc13783_set_read_mode ( t_channel  channel  ) 

This function select the required read_mode for a specific channel.

Parameters:
channel The channel to be sampled
Returns:
This function returns the requires read_mode

References M_BATTERY_CURRENT, M_CHARGE_CURRENT, M_DIE_TEMPERATURE, M_LITHIUM_CELL, M_THERMISTOR, and M_UID.

Referenced by pmic_adc_convert(), and pmic_adc_convert_8x().

static int pmic_adc_filter ( t_touch_screen ts_curr  )  [static]

This function performs filtering and rejection of excessive noise prone samples.

Parameters:
ts_curr Touch screen value
Returns:
This function returns 0 on success, -1 otherwise.
void update_buffer ( void   ) 

This function is used to update buffer of touch screen value in read mode.

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen