Analog Devices / Mbed OS EVAL-ADMX2001

Dependencies:   ADMX2001

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers gpio_config.cpp Source File

gpio_config.cpp

Go to the documentation of this file.
00001 /* Copyright (c) 2021 Analog Devices, Inc.  All rights reserved.
00002 
00003 Redistribution and use in source and binary forms, with or without modification,
00004 are permitted provided that the following conditions are met:
00005   - Redistributions of source code must retain the above copyright notice,
00006   this list of conditions and the following disclaimer.
00007   - Redistributions in binary form must reproduce the above copyright notice,
00008   this list of conditions and the following disclaimer in the documentation
00009   and/or other materials provided with the distribution.
00010   - Modified versions of the software must be conspicuously marked as such.
00011   - This software is licensed solely and exclusively for use with processors/products
00012   manufactured by or for Analog Devices, Inc.
00013   - This software may not be combined or merged with other code in any manner
00014   that would cause the software to become subject to terms and conditions which
00015   differ from those listed here.
00016   - Neither the name of Analog Devices, Inc. nor the names of its contributors
00017   may be used to endorse or promote products derived from this software without
00018   specific prior written permission.
00019   - The use of this software may or may not infringe the patent rights of one or
00020   more patent holders.  This license does not release you from the requirement
00021   that you obtain separate licenses from these patent holders to use this software.
00022 
00023 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND
00024 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
00025 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
00026 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00027 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES
00028 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL
00029 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00030 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00031 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00032 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00033 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034 
00035 2021-01-10-7CBSD SLA
00036 */
00037 
00038 /**
00039  * @file    gpio_config.cpp
00040  * @brief   This file interfaces configures test loads
00041  * @{
00042  */
00043 
00044 /*=============  I N C L U D E S   =============*/
00045 #include <stdlib.h>
00046 #include "mbed.h"
00047 #include "gpio_config.h"
00048 #include "app_config.h"
00049 #include "platform_drivers.h"
00050 
00051 /*=============  D A T A  =============*/
00052 
00053 static DigitalOut muxSelA(A2); // Aurdino p4.3
00054 static DigitalOut muxSelB(A3); // Aurdino p4.4
00055 static DigitalOut muxSelC(A4); // Aurdino p4.5
00056 static DigitalOut muxEn(A5);   // Aurdino p4.6
00057 
00058 // Declaring trigger input/output pins
00059 // Setting trigger out to low by default
00060 static DigitalOut trigOut(TRIGGER_OUT, 0);
00061 static DigitalIn trigIn(TRIGGER_IN);
00062 
00063 static bool triggerPolarity = 1;
00064 
00065 /*=============  C O D E  =============*/
00066 
00067 /**
00068  * @details     Enable demo test load corresponding to mux_sel
00069  * @param [in]  mux_sel - mux selection value
00070  * @return      0-Success, 1-Failure
00071  */
00072 int32_t EnableMuxLine (int32_t muxSel)
00073 {
00074     muxSelA = ((muxSel & 0x01));
00075     muxSelB = ((muxSel & 0x02) >> 1);
00076     muxSelC = ((muxSel & 0x04) >> 2);
00077     muxEn = 1;
00078     return 0;
00079 }
00080 
00081 
00082 /**
00083  * @}
00084  */