Analog Devices / Mbed OS EVAL-AD4696

Dependencies:   platform_drivers

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ad4696_support.h Source File

ad4696_support.h

Go to the documentation of this file.
00001 /***************************************************************************//**
00002  *   @file   ad4696_support.h
00003  *   @brief  Header for AD469x No-OS driver supports
00004 ********************************************************************************
00005  * Copyright (c) 2021 Analog Devices, Inc.
00006  *
00007  * All rights reserved.
00008  *
00009  * This software is proprietary to Analog Devices, Inc. and its licensors.
00010  * By using this software you agree to the terms of the associated
00011  * Analog Devices Software License Agreement.
00012 *******************************************************************************/
00013 
00014 #ifndef AD4696_SUPPORT_H_
00015 #define AD4696_SUPPORT_H_
00016 
00017 /******************************************************************************/
00018 /***************************** Include Files **********************************/
00019 /******************************************************************************/
00020 
00021 #include "ad469x.h"
00022 #include "util.h"
00023 
00024 /******************************************************************************/
00025 /********************** Macros and Constants Definition ***********************/
00026 /******************************************************************************/
00027 
00028 /* Number of AD469x registers */
00029 #define NUM_OF_REGISTERS    0x17F
00030 
00031 /* Default channel range for AD4696 devices */
00032 #define DEFAULT_VREF                (5.0)
00033 
00034 /* AD469x_REG_TEMPERATURE */
00035 #define AD469x_TEMPERATURE_MSK      GENMASK(0,0)
00036 
00037 /* AD469x Sequencer Lower Byte Configuration */
00038 #define AD469x_SEQ_LB_CONFIG(x)    ( x & GENMASK(7,0))      
00039 
00040 /* AD469x Sequencer Upper Byte Configuration */
00041 #define AD469x_SEQ_UB_CONFIG(x)    ( x >> 8)    
00042 
00043 /* AD469x Sequencer Lower Byte Register */
00044 #define AD469x_REG_SEQ_LB          AD469x_REG_STD_SEQ_CONFIG
00045 
00046 /* AD469x Sequencer Upper Byte Register */
00047 #define AD469x_REG_SEQ_UB          (AD469x_REG_STD_SEQ_CONFIG + 0x01)
00048 
00049 /* AD469x Sequencer Lower Byte Configuration */
00050 #define AD469x_SINGLE_CHANNEL_EN(x)    AD469x_CHANNEL(x)    
00051 
00052 /* AD469x Enable Autocycle Mode*/
00053 #define AD469x_SEQ_CHANNELS_RESET      0x00
00054 
00055 /* AD469x Sequencer disable all channels */
00056 #define AD469x_EN_AUTOCYLE_MODE        0x01
00057 
00058 /* AD469x Manual Trigger Configurations */
00059 #define AD469x_REG_SETUP_RESET         0x10
00060 #define AD469x_REG_SEQ_CTRL_RESET      0x80
00061 
00062 /* AD469x Sequencer disable all channels */
00063 #define AD469x_SEQ_CHANNEL_EN          1
00064 #define AD469x_SEQ_CHANNEL_DI          0
00065 
00066 /******************************************************************************/
00067 /********************** Variables and User Defined Data Types *****************/
00068 /******************************************************************************/
00069 /**
00070  * @enum ad469x_polarity_select
00071  * @brief Channel polarity modes
00072  */
00073 enum ad469x_polarity_select {
00074     AD469x_UNIPOLAR_MODE,
00075     AD469x_PSEUDO_BIPOLAR_MODE
00076 };
00077 
00078 /**
00079  * @enum ad469x_pin_pairing_select
00080  * @brief Channel pin pairing options
00081  */
00082 enum ad469x_pin_pairing_select {
00083     AD469x_INx_REF_GND,
00084     AD469x_INx_COM,
00085     AD469x_INx_EVEN_ODD
00086 };
00087 
00088 /******************************************************************************/
00089 /************************ Public Declarations *********************************/
00090 /******************************************************************************/
00091 
00092 int32_t ad4696_enable_manual_trigger_mode(struct ad469x_dev *device);
00093 int32_t ad4696_polarity_mode_select(struct ad469x_dev *device);
00094 
00095 #endif /* AD4696_SUPPORT_H_ */