XDK API  3.6.0
Documentation
Data Structures | Typedefs | Enumerations | Functions
Mcu_Adc.h File Reference

Add a brief description here. More...

#include "BCDS_HAL.h"
#include "BCDS_Basics.h"
#include "em_adc.h"
+ Include dependency graph for Mcu_Adc.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  Mcu_Adc_ConfigScan_S
 struct to configure ADC in scan mode More...
 
struct  Mcu_Adc_ConfigSingle_S
 struct to configure ADC in single mode More...
 
struct  Mcu_Adc_Event_S
 Structure to represent the events that can be received from the ADC in the callback function. More...
 
union  Mcu_Adc_Event_U
 union to combine event bit field structure with a uint32_t value More...
 

Typedefs

typedef enum Adc_AcqTime_E Adc_AcqTime_T
 
typedef enum Adc_Channel_E Adc_Channel_T
 
typedef enum Adc_Reference_E Adc_Reference_T
 
typedef enum Adc_Resolution_E Adc_Resolution_T
 
typedef HWHandle_T ADC_T
 ADC_T is a generic hardware handle,which is void pointer guaranteed to store pointer to integer. More...
 
typedef void(* Mcu_Adc_Callback_T )(ADC_T adc, Mcu_Adc_Event_T event, uint16_t *bufferPtr)
 Application callback template. More...
 
typedef struct Mcu_Adc_ConfigScan_S Mcu_Adc_ConfigScan_T
 
typedef struct
Mcu_Adc_ConfigScan_S
Mcu_Adc_ConfigScanPtr_T
 
typedef struct
Mcu_Adc_ConfigSingle_S 
Mcu_Adc_ConfigSingle_T
 
typedef struct
Mcu_Adc_ConfigSingle_S
Mcu_Adc_ConfigSinglePtr_T
 
typedef struct Mcu_Adc_Event_S Mcu_Adc_Event_T
 

Enumerations

enum  Adc_AcqTime_E
 Enumerator to represent the Acquisition time. More...
 
enum  Adc_Channel_E
 Enumerator to represent the Input channel, This is applicable for single trigger mode only. More...
 
enum  Adc_Reference_E
 Enumerator to represent the reference voltage. More...
 
enum  Adc_Resolution_E
 Enumerator to represent the resolution. More...
 
enum  Adc_ScanChannelMask_E
 Constant values to represent the Input channel, This is applicable for scan trigger mode only. More...
 

Functions

Retcode_T Mcu_Adc_DeInitialize (ADC_T adc)
 De-initialize and powers down the ADC interface. More...
 
Retcode_T Mcu_Adc_Initialize (ADC_T adc, Mcu_Adc_Callback_T callback)
 Initialize the ADC Interface. More...
 
Retcode_T Mcu_Adc_StartScan (ADC_T adc, Mcu_Adc_ConfigScanPtr_T configScan)
 Start Scan Mode on ADC Interface & Start the PRS Timer as producer. More...
 
Retcode_T Mcu_Adc_StartSingle (ADC_T adc, Mcu_Adc_ConfigSinglePtr_T configStart)
 Start Single Mode on ADC Interface. More...
 
Retcode_T Mcu_Adc_StopScan (ADC_T adc)
 Stop the Scan mode on ADC Interface and stops the PRS timer used for sampling adc channels. More...
 

Detailed Description

Put here the documentation of this header file. Explain the interface exposed by this header, e.g. what is the purpose of use, how to use it, etc.

Typedef Documentation

typedef HWHandle_T ADC_T
typedef void(* Mcu_Adc_Callback_T)(ADC_T adc, Mcu_Adc_Event_T event, uint16_t *bufferPtr)
Parameters
[in]adcMCU handle for ADC
[in]eventRepresents the various application events
[in]bufferPtrRepresents the pointer value of the result buffer for processing

Enumeration Type Documentation

Enumerator
ADC_ACQ_TIME_1 

1 clock cycle.

ADC_ACQ_TIME_2 

2 clock cycle.

ADC_ACQ_TIME_4 

4 clock cycle.

ADC_ACQ_TIME_8 

8 clock cycle.

ADC_ACQ_TIME_16 

16 clock cycle.

ADC_ACQ_TIME_32 

32 clock cycle.

ADC_ACQ_TIME_64 

64 clock cycle.

ADC_ACQ_TIME_128 

128 clock cycle.

ADC_ACQ_TIME_256 

256 Clock cycle.

Enumerator
ADC_ENABLE_CH4 
ADC_ENABLE_CH5 
ADC_ENABLE_CH6 
ADC_ENABLE_CH7 
ADC_ENABLE_TEMP 
ADC_ENABLE_VDDDIV3 
ADC_ENABLE_VDD 
ADC_ENABLE_VSS 
ADC_ENABLE_VREFDIV2 
ADC_ENABLE_CH_MAX 
Enumerator
ADC_REF_1V25 

Internal 1.25V reference.

ADC_REF_2V5 
ADC_REF_VDD 

Internal 2.5V reference.

ADC_REF_5VDIFF 

Buffered VDD.

ADC_REF_ExtSingle 

Internal differential 5V reference.

ADC_REF_ExtDiff 

Single ended ext. ref. from pin 6.

ADC_REF_2xVDD 

Differential ext. ref. from pin 6 and 7.

Enumerator
ADC_RESOLUTION_12BIT 

12 bit sampling.

ADC_RESOLUTION_8BIT 

8 bit sampling.

ADC_RESOLUTION_6BIT 

6 bit sampling.

ADC_RESOLUTION_OVS 

Oversampling.

Note
For multiple channel selection User needs to bitwise OR the respective Scan channels mentioned below for Proper operation
Enumerator
ADC_ENABLE_CH4_SCAN 
ADC_ENABLE_CH5_SCAN 
ADC_ENABLE_CH6_SCAN 

Function Documentation

Retcode_T Mcu_Adc_DeInitialize ( ADC_T  adc)
Parameters
[in]adc: ADC handle.
Return values
RETCODE_OKupon successful execution, error otherwise

De-initialize and powers down the ADC interface.

+ Here is the caller graph for this function:

Retcode_T Mcu_Adc_Initialize ( ADC_T  adc,
Mcu_Adc_Callback_T  callback 
)
Parameters
[in]adc: ADC handle.
[in]callback: Function pointer to a callback function which handles the ADC events.
Return values
RETCODE_OKupon successful execution, error otherwise

Initialize the ADC Interface.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Retcode_T Mcu_Adc_StartScan ( ADC_T  adc,
Mcu_Adc_ConfigScanPtr_T  configScan 
)
Parameters
[in]adc: ADC handle.
[in]configScan: Structure which holds the configurations related to scan mode.

The sampling rate must be limited to minimum and maximum range mentioned by macro ADC_MIN_SAMPLING_FREQUENCY and ADC_MAX_SAMPLING_FREQUENCY respectively

Return values
RETCODE_OKupon successful execution, error otherwise

Start Scan Mode on ADC Interface & Start the PRS Timer as producer.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Retcode_T Mcu_Adc_StartSingle ( ADC_T  adc,
Mcu_Adc_ConfigSinglePtr_T  configStart 
)
Parameters
[in]adc: ADC handle.
[in]configStart: Structure which holds the configurations related to single mode.
Return values
RETCODE_OKupon successful execution, error otherwise

Start Single Mode on ADC Interface.

+ Here is the caller graph for this function:

Retcode_T Mcu_Adc_StopScan ( ADC_T  adc)
Parameters
[in]adc: ADC handle.
Return values
RETCODE_OKupon successful execution, error otherwise

Stop the Scan mode on ADC Interface and stops the PRS timer used for sampling adc channels.

+ Here is the caller graph for this function:


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:40 by doxygen 1.8.8