Data Structures | Defines | Typedefs | Enumerations | Functions

adc.h File Reference

This file provides all the APIs provided by QADC64E module of Freescale MPC563 power-pc MCU. More...

#include "mpc563.h"
Include dependency graph for adc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  QADC_ConvModConf
 This structure holds all conversion configuration of any ADC converter module. More...
struct  QADC_CCW_ApplData
 This structure defines the data for each CCW and the Application call-back function for that conversion. More...
struct  QADC_CCW_ApplResultData
 This structure defines the data for reading the result of any ADC conversion. More...

Defines

#define QADC_PORT_A   0x0000
 This defines the PORT-A mask.
#define QADC_PORT_B   0x0080
 This defines the PORT-B mask.

Typedefs

typedef void(* ConvComplCB )(QADC_ConvMod_CCWs CCW_ID, U16 u16Data)
 Application callback function prototype to call after ADC conversion complete.

Enumerations

enum  QADC_Ports {
  QADC_PORT_A0 = QADC_PORT_A,
  QADC_PORT_A1,
  QADC_PORT_A2,
  QADC_PORT_A3,
  QADC_PORT_A4,
  QADC_PORT_A5,
  QADC_PORT_A6,
  QADC_PORT_A7,
  QADC_PORT_B0 = QADC_PORT_B,
  QADC_PORT_B1,
  QADC_PORT_B2,
  QADC_PORT_B3,
  QADC_PORT_B4,
  QADC_PORT_B5,
  QADC_PORT_B6,
  QADC_PORT_B7
}
enum  QADC_PortConfigType {
  QADC_CONFIG_IN,
  QADC_CONFIG_OUT
}
enum  QADC_PortVal {
  PORT_VAL_LOW,
  PORT_VAL_HIGH
}
enum  QADC_IO_OpStatus {
  QADC_IO_FAIL,
  QADC_IO_SUCCESS,
  QADC_IO_INVALID_CFG_TYPE,
  QADC_IO_INVALID_MOD_ID,
  QADC_IO_INVALID_PORT_ID
}
enum  QADC_OpMode {
  ADC_LEGACY_OP_MODE,
  ADC_ENHANCED_OP_MODE
}
enum  QADC_RegAcc {
  ADC_LIMITED_SUPV_ACC,
  ADC_FULL_SUPV_ACC
}
enum  QADC_ExtMuxSel {
  ADC_MUX_MODE_INT,
  ADC_MUX_MODE_EXT
}
 

This enum provides the External Multiplexed mode selection.

More...
enum  QADC_ExtTrig_Sel {
  ADC_ETRIG1_Q1_ETRIG2_Q2,
  ADC_ETRIG1_Q2_ETRIG2_Q1
}
 

This enum provides the ADC External trigger assignment.

More...
enum  QADC_Q1_SingleScanOpt {
  ADC_Q1_SINGLE_SCAN_DISABLE,
  ADC_Q1_SINGLE_SCAN_ENABLE
}
 

Provides Queue-1 Single scan operation status.

More...
enum  ADC_Q1_OpModes {
  ADC_OP_Q1_DISABLE,
  ADC_OP_Q1_SW_TRIG_SINGLE_SCAN,
  ADC_OP_Q1_EXT_TRIG_RISING_EDGE_SINGLE_SCAN,
  ADC_OP_Q1_EXT_TRIG_FALLING_EDGE_SINGLE_SCAN,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_128_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_256_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_512_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_1024_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_2048_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_4096_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_8192_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_16384_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_32768_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_65536_QCLK,
  ADC_OP_Q1_INTVAL_TIMER_SINGLE_SCAN_131072_QCLK,
  ADC_OP_Q1_EXT_GATED_SINGLE_SCAN,
  ADC_OP_Q1_RESERVED_1,
  ADC_OP_Q1_SW_TRIG_CONTINOUS_SCAN,
  ADC_OP_Q1_EXT_TRIG_RISING_EDGE_CONTINOUS_SCAN,
  ADC_OP_Q1_EXT_TRIG_FALLING_EDGE_CONTINOUS_SCAN,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_128_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_256_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_512_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_1024_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_2048_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_4096_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_8192_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_16384_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_32768_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_65536_QCLK,
  ADC_OP_Q1_PERIO_TIMER_CONT_SCAN_131072_QCLK,
  ADC_OP_Q1_EXT_GATED_CONTINOUS_SCAN
}
 

This enum provides all Queue-1 operation modes.

More...
enum  QADC_Q2_SingleScanOpt {
  ADC_Q2_SINGLE_SCAN_DISABLE,
  ADC_Q2_SINGLE_SCAN_ENABLE
}
 

Provides Queue-2 Single scan operation status.

More...
enum  ADC_Q2_OpModes {
  ADC_OP_Q2_DISABLE,
  ADC_OP_Q2_SW_TRIG_SINGLE_SCAN,
  ADC_OP_Q2_EXT_TRIG_RISING_EDGE_SINGLE_SCAN,
  ADC_OP_Q2_EXT_TRIG_FALLING_EDGE_SINGLE_SCAN,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_128_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_256_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_512_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_1024_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_2048_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_4096_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_8192_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_16384_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_32768_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_65536_QCLK,
  ADC_OP_Q2_INTVAL_TIMER_SINGLE_SCAN_131072_QCLK,
  ADC_OP_Q2_RESERVED_1,
  ADC_OP_Q2_RESERVED_2,
  ADC_OP_Q2_SW_TRIG_CONTINOUS_SCAN,
  ADC_OP_Q2_EXT_TRIG_RISING_EDGE_CONTINOUS_SCAN,
  ADC_OP_Q2_EXT_TRIG_FALLING_EDGE_CONTINOUS_SCAN,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_128_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_256_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_512_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_1024_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_2048_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_4096_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_8192_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_16384_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_32768_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_65536_QCLK,
  ADC_OP_Q2_PERIO_TIMER_CONT_SCAN_131072_QCLK,
  ADC_OP_Q2_EXT_GATED_CONTINOUS_SCAN,
  ADC_OP_Q2_RESERVED_3
}
 

This enum provides all Queue-2 operation modes.

More...
enum  QADC_Q2_ResumePos {
  ADC_Q2_RESUME_FROM_START_POS,
  ADC_Q2_RESUME_FROM_SUSPENDED_POS
}
 

This enum defines the Queue-2 CCW Resume position.

More...
enum  ADC_Q_Status {
  ADC_Q_IDLE,
  ADC_Q1_IDLE_Q2_PAUSED,
  ADC_Q1_IDLE_Q2_ACTIVE,
  ADC_Q1_IDLE_Q2_PENDING,
  ADC_Q1_PAUSED_Q2_IDLE,
  ADC_Q1_PAUSED_Q2_PAUSED,
  ADC_Q1_PAUSED_Q2_ACTIVE,
  ADC_Q1_PAUSED_Q2_PENDING,
  ADC_Q1_ACTIVE_Q2_IDLE,
  ADC_Q1_ACTIVE_Q2_PAUSED,
  ADC_Q1_ACTIVE_Q2_SUSPENDED,
  ADC_Q1_ACTIVE_Q2_PENDING,
  ADC_Q_STATUS_1,
  ADC_Q_STATUS_2,
  ADC_Q_STATUS_3,
  ADC_Q_STATUS_4
}
 

This enum provides Queue-1 and Queue-2 operation status.

More...
enum  QADC_CCW_PauseVal {
  ADC_PAUSE_DISABLE,
  ADC_PAUSE_ENABLE
}
 

Enum provides pause status after each CCW execution.

More...
enum  QADC_CCW_AmplBypassVal {
  ADC_AMPL_BYPASS_DISABLE,
  ADC_AMPL_BYPASS_ENABLE
}
enum  QADC_CCW_RefVal {
  ADC_REF_VRH,
  ADC_REF_ALTREF
}
enum  ADC_InputSampleTime {
  ADC_SAMPL_TIME_2_QCLK,
  ADC_SAMPL_TIME_4_QCLK,
  ADC_SAMPL_TIME_8_QCLK,
  ADC_SAMPL_TIME_16_QCLK
}
 

This enum provides possible sampling times for a conversion.

More...
enum  QADC_ResultFormat {
  ADC_RIGHT_JUST_UNSIGN,
  ADC_LEFT_JUST_SIGN,
  ADC_LEFT_JUST_UNSIGN
}
 

This typedefine enum provides the ADC conversion result read format.

More...
enum  QADC_Module_ID {
  ADC_MOD_A,
  ADC_MOD_B,
  ADC_TOT_MOD
}
 

This typedefine enum provides the ADC conversion modules.

More...
enum  QADC_Drv_Status {
  ADC_DRV_UNINIT,
  ADC_DRV_INIT,
  ADC_UNKNOWN_STATE
}
 

This enum typedefine provides various status of ADC driver module.

More...
enum  QADC_DrvOpStatus {
  ADC_OP_FAIL,
  ADC_OP_SUCCESS,
  ADC_OP_INVALID_MOD_ID,
  ADC_OP_INVALID_CCW_ID,
  ADC_OP_INVALID_DATA,
  ADC_OP_UNSUPP_STATE,
  ADC_OP_UNSUPP_RD_FMT
}
 

This enum typedefine provides various operation states if the ADC driver.

More...
enum  QADC_ConvMod_CCWs {
  ADC_MOD_CCW_0,
  ADC_MOD_CCW_1,
  ADC_MOD_CCW_2,
  ADC_MOD_CCW_3,
  ADC_MOD_CCW_4,
  ADC_MOD_CCW_5,
  ADC_MOD_CCW_6,
  ADC_MOD_CCW_7,
  ADC_MOD_CCW_8,
  ADC_MOD_CCW_9,
  ADC_MOD_CCW_10,
  ADC_MOD_CCW_11,
  ADC_MOD_CCW_12,
  ADC_MOD_CCW_13,
  ADC_MOD_CCW_14,
  ADC_MOD_CCW_15,
  ADC_MOD_CCW_16,
  ADC_MOD_CCW_17,
  ADC_MOD_CCW_18,
  ADC_MOD_CCW_19,
  ADC_MOD_CCW_20,
  ADC_MOD_CCW_21,
  ADC_MOD_CCW_22,
  ADC_MOD_CCW_23,
  ADC_MOD_CCW_24,
  ADC_MOD_CCW_25,
  ADC_MOD_CCW_26,
  ADC_MOD_CCW_27,
  ADC_MOD_CCW_28,
  ADC_MOD_CCW_29,
  ADC_MOD_CCW_30,
  ADC_MOD_CCW_31,
  ADC_MOD_CCW_32,
  ADC_MOD_CCW_33,
  ADC_MOD_CCW_34,
  ADC_MOD_CCW_35,
  ADC_MOD_CCW_36,
  ADC_MOD_CCW_37,
  ADC_MOD_CCW_38,
  ADC_MOD_CCW_39,
  ADC_MOD_CCW_40,
  ADC_MOD_CCW_41,
  ADC_MOD_CCW_42,
  ADC_MOD_CCW_43,
  ADC_MOD_CCW_44,
  ADC_MOD_CCW_45,
  ADC_MOD_CCW_46,
  ADC_MOD_CCW_47,
  ADC_MOD_CCW_48,
  ADC_MOD_CCW_49,
  ADC_MOD_CCW_50,
  ADC_MOD_CCW_51,
  ADC_MOD_CCW_52,
  ADC_MOD_CCW_53,
  ADC_MOD_CCW_54,
  ADC_MOD_CCW_55,
  ADC_MOD_CCW_56,
  ADC_MOD_CCW_57,
  ADC_MOD_CCW_58,
  ADC_MOD_CCW_59,
  ADC_MOD_CCW_60,
  ADC_MOD_CCW_61,
  ADC_MOD_CCW_62,
  ADC_MOD_CCW_63,
  ADC_MOD_CCW_TOT
}
 

This enum typedefine provides all the CCW IDs registered for both ADC converter module A and B.

More...
enum  ADC_ApplCBMasks {
  ADC_CB_NONE = 0x0000,
  ADC_CB_PAUSE_MSK = 0x8000,
  ADC_CB_COMPL_MSK = 0x4000,
  ADC_CB_PAUSE_COMPL_MASK = 0xC000
}
 

This enum provides mask settings for calling application call-back functions.

More...
enum  ADC_INT_Type {
  ADC_Q1_COMPL_STATUS,
  ADC_Q1_PAUSE_STATUS,
  ADC_Q2_COMPL_STATUS,
  ADC_Q2_PAUSE_STATUS,
  ADC_Q1_TRIG_OVERRUN,
  ADC_Q2_TRIG_OVERRUN
}
 

This enum holds different interrupt status supported.

More...

Functions

QADC_DrvOpStatus ADC_Init (QADC_ConvModConf *ModConf)
 This API will initialize a ADC converter module and start its operation.
QADC_DrvOpStatus ADC_AddCCW (QADC_CCW_ApplData *CCW_Conf)
QADC_DrvOpStatus ADC_Read (QADC_CCW_ApplResultData *ResultData)
 This API will read ADC conversion result value for the request client ID/ (CCW) as per the described result format.
void ADC_ConvStop (QADC_Module_ID ModID)
void ADC_Off (QADC_Module_ID ModID)
Bool ADC_InterruptStatus (QADC_Module_ID ModID, ADC_INT_Type IntType)
void ADC_ClearInterrupt (QADC_Module_ID ModID, ADC_INT_Type IntType)
QADC_IO_OpStatus QADC_PortConfig (QADC_Module_ID ModID, QADC_Ports PortID, QADC_PortConfigType Type)
 This API will help in configuraing any port A pins of any ADC converetr module in Input/ Output mode. Port B is always configured in input mode.
QADC_IO_OpStatus QADC_PortSet (QADC_Module_ID ModID, QADC_Ports PortID, QADC_PortVal Value)
 This API will help to set the value of any pin of port A to the defined value.
QADC_IO_OpStatus QADC_PortGet (QADC_Module_ID ModID, QADC_Ports PortID, QADC_PortVal *Value)
 This API will help to get the value of any pin of port A and B.

Detailed Description

This file provides all the APIs provided by QADC64E module of Freescale MPC563 power-pc MCU.

Version:
1.0A - Initial Draft
Date:
25 June 2010
Version:
1.1A - Design changed to support run-time CCW addition and configuration
Date:
16 July 2010

Definition in file adc.h.


Define Documentation

#define QADC_PORT_A   0x0000

This defines the PORT-A mask.

Definition at line 26 of file adc.h.

#define QADC_PORT_B   0x0080

This defines the PORT-B mask.

Definition at line 29 of file adc.h.


Typedef Documentation

typedef void(* ConvComplCB)(QADC_ConvMod_CCWs CCW_ID, U16 u16Data)

Application callback function prototype to call after ADC conversion complete.

Definition at line 577 of file adc.h.


Enumeration Type Documentation

This enum provides mask settings for calling application call-back functions.

Enumerator:
ADC_CB_NONE 

This will disable to call the application registered call-back function afetr ADC conversion completes

ADC_CB_PAUSE_MSK 

This mask will work if you have enabled Pause settings for this CCW. As the queue execution will enter into pause state after execution of the CCW, the MCU will call the registered call-back function for this CCW

ADC_CB_COMPL_MSK 

This mask will enable to call the application registered call-back function for this CCW, after the whole ADC CCW queue execution will complete

ADC_CB_PAUSE_COMPL_MASK 

This mask will enable to call the application registered call-back function after the pause and queue completion

Definition at line 581 of file adc.h.

This enum holds different interrupt status supported.

Enumerator:
ADC_Q1_COMPL_STATUS 

QADC Queue-1 completion interrupt status

ADC_Q1_PAUSE_STATUS 

QADC Queue-1 pause interrupt status

ADC_Q2_COMPL_STATUS 

QADC Queue-2 completion interrupt status

ADC_Q2_PAUSE_STATUS 

QADC Queue-2 pause interrupt status

ADC_Q1_TRIG_OVERRUN 

QADC Queue-1 overrun interrupt status

ADC_Q2_TRIG_OVERRUN 

QADC Queue-2 overrun interrupt status

Definition at line 601 of file adc.h.

This enum typedefine provides all the CCW IDs registered for both ADC converter module A and B.

Enumerator:
ADC_MOD_CCW_0 
ADC_MOD_CCW_1 
ADC_MOD_CCW_2 
ADC_MOD_CCW_3 
ADC_MOD_CCW_4 
ADC_MOD_CCW_5 
ADC_MOD_CCW_6 
ADC_MOD_CCW_7 
ADC_MOD_CCW_8 
ADC_MOD_CCW_9 
ADC_MOD_CCW_10 
ADC_MOD_CCW_11 
ADC_MOD_CCW_12 
ADC_MOD_CCW_13 
ADC_MOD_CCW_14 
ADC_MOD_CCW_15 
ADC_MOD_CCW_16 
ADC_MOD_CCW_17 
ADC_MOD_CCW_18 
ADC_MOD_CCW_19 
ADC_MOD_CCW_20 
ADC_MOD_CCW_21 
ADC_MOD_CCW_22 
ADC_MOD_CCW_23 
ADC_MOD_CCW_24 
ADC_MOD_CCW_25 
ADC_MOD_CCW_26 
ADC_MOD_CCW_27 
ADC_MOD_CCW_28 
ADC_MOD_CCW_29 
ADC_MOD_CCW_30 
ADC_MOD_CCW_31 
ADC_MOD_CCW_32 
ADC_MOD_CCW_33 
ADC_MOD_CCW_34 
ADC_MOD_CCW_35 
ADC_MOD_CCW_36 
ADC_MOD_CCW_37 
ADC_MOD_CCW_38 
ADC_MOD_CCW_39 
ADC_MOD_CCW_40 
ADC_MOD_CCW_41 
ADC_MOD_CCW_42 
ADC_MOD_CCW_43 
ADC_MOD_CCW_44 
ADC_MOD_CCW_45 
ADC_MOD_CCW_46 
ADC_MOD_CCW_47 
ADC_MOD_CCW_48 
ADC_MOD_CCW_49 
ADC_MOD_CCW_50 
ADC_MOD_CCW_51 
ADC_MOD_CCW_52 
ADC_MOD_CCW_53 
ADC_MOD_CCW_54 
ADC_MOD_CCW_55 
ADC_MOD_CCW_56 
ADC_MOD_CCW_57 
ADC_MOD_CCW_58 
ADC_MOD_CCW_59 
ADC_MOD_CCW_60 
ADC_MOD_CCW_61 
ADC_MOD_CCW_62 
ADC_MOD_CCW_63 
ADC_MOD_CCW_TOT 

Definition at line 468 of file adc.h.

This enum typedefine provides various status of ADC driver module.

Enumerator:
ADC_DRV_UNINIT 

This indicates that driver is not initialized

ADC_DRV_INIT 

This indicates that driver is initialized but not ready for conversion

ADC_UNKNOWN_STATE 

Unknown ADC converter state

Definition at line 434 of file adc.h.

This enum typedefine provides various operation states if the ADC driver.

Enumerator:
ADC_OP_FAIL 

Driver operation failed due to unknwon reason

ADC_OP_SUCCESS 

Driver operation success

ADC_OP_INVALID_MOD_ID 

Driver operation failed due to invalid ADC converter module ID

ADC_OP_INVALID_CCW_ID 

Driver operation failed due to invalid CCW ID

ADC_OP_INVALID_DATA 

Driver operation failed due to invalid user provided data

ADC_OP_UNSUPP_STATE 

Driver operation failed as the current state of driver does not support the requested action

ADC_OP_UNSUPP_RD_FMT 

Read operation failed, as the read format provided is not supported

Definition at line 447 of file adc.h.

Enumerator:
QADC_IO_FAIL 
QADC_IO_SUCCESS 
QADC_IO_INVALID_CFG_TYPE 
QADC_IO_INVALID_MOD_ID 
QADC_IO_INVALID_PORT_ID 

Definition at line 63 of file adc.h.

This typedefine enum provides the ADC conversion modules.

Enumerator:
ADC_MOD_A 

This is channel-A ADC converter.

ADC_MOD_B 

This is channel-B ADC converter.

ADC_TOT_MOD 

Defines the total no of ADC converters supported.

Definition at line 421 of file adc.h.

Enumerator:
QADC_CONFIG_IN 
QADC_CONFIG_OUT 

Definition at line 51 of file adc.h.

enum QADC_Ports
Enumerator:
QADC_PORT_A0 
QADC_PORT_A1 
QADC_PORT_A2 
QADC_PORT_A3 
QADC_PORT_A4 
QADC_PORT_A5 
QADC_PORT_A6 
QADC_PORT_A7 
QADC_PORT_B0 
QADC_PORT_B1 
QADC_PORT_B2 
QADC_PORT_B3 
QADC_PORT_B4 
QADC_PORT_B5 
QADC_PORT_B6 
QADC_PORT_B7 

Definition at line 31 of file adc.h.

Enumerator:
PORT_VAL_LOW 
PORT_VAL_HIGH 

Definition at line 57 of file adc.h.

This typedefine enum provides the ADC conversion result read format.

Enumerator:
ADC_RIGHT_JUST_UNSIGN 

Read the result in right justified unsigned format.

ADC_LEFT_JUST_SIGN 

Read the result in left justified signed format.

ADC_LEFT_JUST_UNSIGN 

Read the result in left justified unsigned format.

Definition at line 409 of file adc.h.


Function Documentation

QADC_DrvOpStatus ADC_AddCCW ( QADC_CCW_ApplData CCW_Conf )
void ADC_ClearInterrupt ( QADC_Module_ID  ModID,
ADC_INT_Type  IntType 
)
void ADC_ConvStop ( QADC_Module_ID  ModID )
QADC_DrvOpStatus ADC_Init ( QADC_ConvModConf ModConf )

This API will initialize a ADC converter module and start its operation.

Parameters:
ModConf- QADC converter module configuration data
Returns:
Driver operation status
  • ADC_OP_FAIL - Module Initialization failed
  • ADC_OP_INVALID_MOD_ID - Invalid Module ID
  • ADC_OP_SUCCESS - Module Initialized successfully
  • The followwing actions will be taken on each ADC converetr module
    • If the Module ID is valid,
      • It resets the ADC converter module status to uninitialized mode
      • Get the register array address for the ADC converter module
      • Update the Operation mode, Register access level from application
      • Update Queue-1 and Queue-2 interrupt priority
      • Update external MUX selection, presclar clock high and low time, and External Triggering types for Queue-1 and Queue-2
      • Update Queue-1 operational mode and single scan option
      • Update Queue-2 operational mode, single scan option, operation resume type and Queue-2 begin location in the queue
      • Configure the ADC converter module to Initialized mode

Definition at line 110 of file adc.c.

References ADC_DISABLE_STOP_MODE, ADC_DRV_INIT, ADC_DRV_UNINIT, ADC_ENABLE_FREEZE, ADC_MODE_LOCK_DISABLE, ADC_MODE_LOCK_ENABLE, ADC_OP_FAIL, ADC_OP_INVALID_MOD_ID, ADC_OP_SUCCESS, ADC_Q1_COMP_INT_ENABLE, ADC_Q1_PAUSE_INT_ENABLE, ADC_Q2_COMP_INT_ENABLE, ADC_Q2_PAUSE_INT_ENABLE, ADC_TOT_MOD, QADC64_tag::B, QADC_ConvModConf::ExtMux, QADC_ConvModConf::ExtTrigType, QADC_ConvModConf::ModID, QADC_ConvModConf::OpMode, QADC_ConvModConf::Q1_OpMode, QADC_ConvModConf::Q2_OpMode, QADC_ConvModConf::Q2_ResumeType, QADC64_tag::QACR0, QADC64_tag::QACR1, QADC64_tag::QACR2, QADC64_tag::QADC64INT, QADC64_tag::QADC64MCR, QADC_ConvModConf::RegAcc, QADC_ConvModConf::u8PresclClkHighTime, QADC_ConvModConf::u8PresclClkLowTime, QADC_ConvModConf::u8Q1IntPrio, QADC_ConvModConf::u8Q2Begin, and QADC_ConvModConf::u8Q2IntPrio.

Bool ADC_InterruptStatus ( QADC_Module_ID  ModID,
ADC_INT_Type  IntType 
)
void ADC_Off ( QADC_Module_ID  ModID )
QADC_DrvOpStatus ADC_Read ( QADC_CCW_ApplResultData ResultData )

This API will read ADC conversion result value for the request client ID/ (CCW) as per the described result format.

Parameters:
ResultData- Structure to hold user request data to read the ADC conversion result
Returns:
Operation status
  • ADC_OP_FAIL - Operation failed due to unknown reason
  • ADC_OP_SUCCESS - Operation success
  • ADC_OP_UNSUPP_RD_FMT - Unsupported result read format
  • ADC_OP_UNSUPP_STATE - Current state of driver does not allow this action. The analog conversion for the drive should be active before calling this API
  • ADC_OP_INVALID_CCW_ID - Invalid CCW ID provided by the user
  • ADC_OP_INVALID_MOD_ID - Invalid ADC converter module ID provided by the user
  • ADC_OP_INVALID_DATA - Invalid user Data
Note:
This API will only process the request, if the ADC conversion is started

Definition at line 197 of file adc.c.

References ADC_DRV_INIT, ADC_LEFT_JUST_SIGN, ADC_LEFT_JUST_UNSIGN, ADC_MOD_CCW_TOT, ADC_OP_FAIL, ADC_OP_INVALID_CCW_ID, ADC_OP_INVALID_DATA, ADC_OP_INVALID_MOD_ID, ADC_OP_SUCCESS, ADC_OP_UNSUPP_RD_FMT, ADC_OP_UNSUPP_STATE, ADC_RIGHT_JUST_UNSIGN, ADC_TOT_MOD, QADC64_tag::LJSRR, QADC64_tag::LJURR, QADC_CCW_ApplResultData::ModID, QADC_CCW_ApplResultData::QueueID, QADC64_tag::R, QADC_CCW_ApplResultData::ReadFormat, QADC64_tag::RJURR, and QADC_CCW_ApplResultData::u16Data.

QADC_IO_OpStatus QADC_PortConfig ( QADC_Module_ID  ModID,
QADC_Ports  PortID,
QADC_PortConfigType  Type 
)

This API will help in configuraing any port A pins of any ADC converetr module in Input/ Output mode. Port B is always configured in input mode.

Parameters:
ModID- ADC converter module ID
PortID- Port ID to be configured
Type- Configuration type (Output/Input mode)
Returns:
Operation status
  • QADC_IO_INVALID_CFG_TYPE - Invalid configuration type selected
  • QADC_IO_INVALID_PORT_ID - Invalid port ID selected
  • QADC_IO_INVALID_MOD_ID - Invalid Module ID selected

Definition at line 270 of file adc.c.

References ADC_TOT_MOD, QADC64_tag::B, QADC64_tag::DDRQA, QADC_CONFIG_IN, QADC_CONFIG_OUT, QADC_IO_INVALID_CFG_TYPE, QADC_IO_INVALID_MOD_ID, QADC_IO_INVALID_PORT_ID, QADC_IO_SUCCESS, QADC_PORT_A0, QADC_PORT_A1, QADC_PORT_A2, QADC_PORT_A3, QADC_PORT_A4, QADC_PORT_A5, QADC_PORT_A6, and QADC_PORT_A7.

QADC_IO_OpStatus QADC_PortGet ( QADC_Module_ID  ModID,
QADC_Ports  PortID,
QADC_PortVal Value 
)

This API will help to get the value of any pin of port A and B.

Parameters:
ModID- ADC converter module ID
PortID- Port ID to be configured
Value- Value of the port to be set
Returns:
Operation status
  • QADC_IO_INVALID_CFG_TYPE - Invalid configuration type selected
  • QADC_IO_INVALID_PORT_ID - Invalid port ID selected
  • QADC_IO_INVALID_MOD_ID - Invalid Module ID selected

Definition at line 392 of file adc.c.

References ADC_TOT_MOD, QADC64_tag::B, QADC64_tag::PORTQA, QADC64_tag::PORTQB, QADC_IO_INVALID_MOD_ID, QADC_IO_INVALID_PORT_ID, QADC_IO_SUCCESS, QADC_PORT_A0, QADC_PORT_A1, QADC_PORT_A2, QADC_PORT_A3, QADC_PORT_A4, QADC_PORT_A5, QADC_PORT_A6, QADC_PORT_A7, QADC_PORT_B0, QADC_PORT_B1, QADC_PORT_B2, QADC_PORT_B3, QADC_PORT_B4, QADC_PORT_B5, QADC_PORT_B6, and QADC_PORT_B7.

QADC_IO_OpStatus QADC_PortSet ( QADC_Module_ID  ModID,
QADC_Ports  PortID,
QADC_PortVal  Value 
)

This API will help to set the value of any pin of port A to the defined value.

Parameters:
ModID- ADC converter module ID
PortID- Port ID to be configured
Value- Value of the port to be set
Returns:
Operation status
  • QADC_IO_INVALID_CFG_TYPE - Invalid configuration type selected
  • QADC_IO_INVALID_PORT_ID - Invalid port ID selected
  • QADC_IO_INVALID_MOD_ID - Invalid Module ID selected

Definition at line 334 of file adc.c.

References ADC_TOT_MOD, QADC64_tag::B, QADC64_tag::PORTQA, QADC_IO_INVALID_MOD_ID, QADC_IO_INVALID_PORT_ID, QADC_IO_SUCCESS, QADC_PORT_A0, QADC_PORT_A1, QADC_PORT_A2, QADC_PORT_A3, QADC_PORT_A4, QADC_PORT_A5, QADC_PORT_A6, and QADC_PORT_A7.