Justin Jordan / ard2pmod

Dependencies:   ds3231 max14661

Dependents:   ard2pmod_demo

Fork of ard2pmod by Maxim Integrated

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ard2pmod.h Source File

ard2pmod.h

00001 /******************************************************************//**
00002 * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
00003 *
00004 * Permission is hereby granted, free of charge, to any person obtaining a
00005 * copy of this software and associated documentation files (the "Software"),
00006 * to deal in the Software without restriction, including without limitation
00007 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008 * and/or sell copies of the Software, and to permit persons to whom the
00009 * Software is furnished to do so, subject to the following conditions:
00010 *
00011 * The above copyright notice and this permission notice shall be included
00012 * in all copies or substantial portions of the Software.
00013 *
00014 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
00018 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00020 * OTHER DEALINGS IN THE SOFTWARE.
00021 *
00022 * Except as contained in this notice, the name of Maxim Integrated
00023 * Products, Inc. shall not be used except as stated in the Maxim Integrated
00024 * Products, Inc. Branding Policy.
00025 *
00026 * The mere transfer of this software does not imply any licenses
00027 * of trade secrets, proprietary technology, copyrights, patents,
00028 * trademarks, maskwork rights, or any other form of intellectual
00029 * property whatsoever. Maxim Integrated Products, Inc. retains all
00030 * ownership rights.
00031 **********************************************************************/
00032 
00033 
00034 #ifndef ARD2PMOD_H
00035 #define ARD2PMOD_H
00036 
00037 
00038 #include "mbed.h"
00039 #include "max14661.h"
00040 #include "ds3231.h"
00041     
00042     
00043 /******************************************************************//**
00044 * Ard2Pmod Class
00045 * Used for establishing PMOD type, MAX14661 16:2 mux interface
00046 *
00047 * Please See MAXREFDES72# pcb schematic for configuration
00048 *
00049 * PMOD_TYPE_I2C_A -
00050 * Switches SWA9, SWA12 and SWB10, SWB11 closed.  All other switches 
00051 * open
00052 *
00053 * PMOD_TYPE_I2C_B -
00054 * Switches SWA9, SWA7 and SWB10, SWB8 closed.  All other switches 
00055 * open
00056 * 
00057 * PMOD_TYPE_I2C_AB - 
00058 * Switches SWA7, SWA9, SWA12 and SWB8, SWB10, SWB11 closed.  All other
00059 * switches open
00060 *
00061 * PMOD_TYPE_1_GPIO - 
00062 * Switches all open, mux not used
00063 *
00064 * PMOD_TYPE_2_SPI - 
00065 * Switches all open, mux not used
00066 *
00067 * PMOD_TYPE_3_UART - 
00068 * Switches SWA12, SWA1, SWB11, SWB2 closed.  All other switches open.
00069 *
00070 * PMOD_TYPE_4_UART - 
00071 * Switches SWA13, SWA2, SWB12, SWB1 closed.  All other switches open.
00072 *
00073 * PMOD_TYPE_5_HBRIDGE - 
00074 * Switches all open, mux not used
00075 *
00076 * PMOD_TYPE_6_HBRIDGE - 
00077 * Switches all open, mux not used
00078 **********************************************************************/
00079 class Ard2Pmod 
00080 {
00081     public:
00082         
00083         /**
00084         * PmodType - enumerated PMOD types
00085         */
00086         enum PmodType
00087         {
00088             PMOD_TYPE_I2C_A,
00089             PMOD_TYPE_I2C_B,
00090             PMOD_TYPE_I2C_AB,
00091             PMOD_TYPE_1_GPIO,
00092             PMOD_TYPE_2_SPI,
00093             PMOD_TYPE_3_UART,
00094             PMOD_TYPE_4_UART,
00095             PMOD_TYPE_5_HBRIDGE,
00096             PMOD_TYPE_6_HBRIDGE,
00097             PMOD_TYPE_7_ONEWIRE_A,
00098             PMOD_TYPE_8_ONEWIRE_B,
00099             PMOD_TYPE_9_ONEWIRE_AB
00100         };
00101         
00102         
00103         /**************************************************************//**
00104         * Constructor for Ard2Pmod Class
00105         *
00106         * On Entry:
00107         *     @param[in] pmod_type - desired PMOD interface
00108         *     @param[in] ow_pin - Used for 1-wire PMOD type only, GPIO for 1-wire Master
00109         *
00110         * On Exit:
00111         *
00112         * @return none
00113         *
00114         * Example:
00115         * @code
00116         * #include "ard2pmod.h"
00117         *
00118         * int main(void)
00119         * {  
00120         *     Ard2Pmod ard2pmod(Ard2Pmod::PMOD_TYPE_1_GPIO);
00121         *     
00122         *     //main app.
00123         *     for(;;)
00124         *     {
00125         *     }
00126         * }
00127         * @endcode
00128         ******************************************************************/
00129         Ard2Pmod(PmodType pmod_type, PinName ow_pin = NC); 
00130         
00131         private:
00132         
00133         Max14661 _mux;
00134 
00135 };
00136 
00137 
00138 #endif /* ARD2PMOD_H*/