Treehouse Mbed Team / Mbed 2 deprecated 1U5_proto_X

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers all_io.cpp Source File

all_io.cpp

00001 //-------------------------------------------------------------------------------
00002 // 
00003 //  Treehouse Designs Inc.
00004 //  Colorado Springs, Colorado
00005 // 
00006 //  Copyright (c) 2018 by Treehouse Designs Inc. 
00007 //  Copyright (c) 2018 by Agility Power Systems Inc. 
00008 // 
00009 //  This code is the property of Treehouse Designs, Inc. (Treehouse) and
00010 //  Agility Power Systems Inc. (Agility) and may not be redistributed
00011 //  in any form without prior written permission from 
00012 //  both copyright holders, Treehouse and Agility.
00013 //
00014 //  The above copyright notice and this permission notice shall be included in
00015 //  all copies or substantial portions of the Software.
00016 // 
00017 //   
00018 //-------------------------------------------------------------------------------
00019 // 
00020 //  REVISION HISTORY:
00021 //  
00022 //   $Author: $
00023 //   $Rev: $
00024 //   $Date: $
00025 //   $URL: $
00026 // 
00027 //-------------------------------------------------------------------------------
00028 
00029 #include "mbed.h"
00030 #include "all_io.h"
00031 #include "PortOut.h"
00032 
00033 // Digital IO
00034 
00035 DigitalInOut SWDIO(PA_13);
00036 PwmOut fan_pwm(PB_3);
00037 DigitalOut fan_on(PA_15);
00038 AnalogOut vdac(PA_4);
00039 
00040 // Use extchlat to latch new wr_out signals to the external slots via ribbon cable.
00041 //DigitalOut extchlat(PA_1);
00042 /*DigitalOut ec[] = {(PC_0), (PC_1), (PC_2), (PC_3), (PC_4), (PC_5), (PC_6), (PC_7), (PC_8), (PC_9), (PC_10), (PC_11), (PC_12), (PC_13), (PC_14), (PC_15),
00043 (PA_8), (PA_9), (PA_10), (PA_11), (PA_12), (PB_0), (PB_1), (PB_2), (PB_4), (PB_5), (PB_8), (PB_9), (PB_10), (PB_11), (PB_12), (PB_13), (PB_14), (PB_15),
00044 (PH_0), (PH_1)};*/
00045 /*DigitalOut en1(PC_7);
00046 DigitalOut en2(PC_6);
00047 DigitalOut en4(PB_15);
00048 DigitalOut en8(PB_14);
00049 DigitalOut en16(PB_13);
00050 DigitalOut en32(PB_12);*/
00051 DigitalOut en[] = {(PC_7), (PC_6), (PB_15), (PB_14), (PB_13), (PB_12)};
00052 DigitalOut ALLON(PA_10);
00053 DigitalOut WR(PA_9);
00054 
00055 // all_on indicates that the load demanded a high amount of current and all DC-DC converters are enabled.
00056 //DigitalIn  all_on(PA_0);
00057 InterruptIn ILR_enable(PA_0);
00058 DigitalIn SWDCLK(PA_14);
00059 DigitalIn MS(PA_1);
00060 //DigitalIn UART_TX(PA_2);
00061 //DigitalIn UART_RX(PA_3);
00062 //Serial chip2221(PA_2, PA_3);
00063 //DigitalIn I2C_SCL(PB_6);
00064 //DigitalIn I2C_SDA(PB_7);
00065 
00066 // Analog IO
00067 //
00068 AnalogIn adc_temp(ADC_TEMP);
00069 AnalogIn adc_vref(ADC_VREF);
00070 #if defined(TARGET_DISCO_F051R8) || defined(TARGET_NUCLEO_F030R8) || defined(TARGET_NUCLEO_F031K6) || defined(TARGET_NUCLEO_F042K6) || defined(TARGET_NUCLEO_F070RB) || defined(TARGET_NUCLEO_F072RB) || defined(TARGET_NUCLEO_F091RC) || defined(TARGET_NUCLEO_F207ZG) || defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_F303K8) || defined(TARGET_DISCO_F303VC) || defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F303ZE) || defined(TARGET_DISCO_F334C8) || defined(TARGET_NUCLEO_F334R8) || defined(TARGET_MTS_DRAGONFLY_F411RE) || defined(TARGET_MTS_MDOT_F405RG) || defined(TARGET_MTS_MDOT_F411RE) || defined(TARGET_DISCO_F401VC) || defined(TARGET_NUCLEO_F401RE) || defined(TARGET_ARCH_MAX) || defined(TARGET_DISCO_F407VG) || defined(TARGET_NUCLEO_F410RB) || defined(TARGET_ELMO_F411RE) || defined(TARGET_NUCLEO_F411RE) || defined(TARGET_NUCLEO_F412ZG) || defined(TARGET_DISCO_F413ZH) || defined(TARGET_DISCO_F429ZI) || defined(TARGET_NUCLEO_F429ZI) || defined(TARGET_NUCLEO_F439ZI) || defined(TARGET_B96B_F446VE) || defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_F446ZE) || defined(TARGET_DISCO_F469NI) || defined(TARGET_DISCO_F746NG) || defined(TARGET_NUCLEO_F746ZG) || defined(TARGET_NUCLEO_F756ZG) || defined(TARGET_NUCLEO_F767ZI) || defined(TARGET_DISCO_F769NI) || defined(TARGET_DISCO_L072CZ_LRWAN1) || defined(TARGET_NUCLEO_L432KC) || defined(TARGET_DISCO_L476VG) || defined(TARGET_NUCLEO_L476RG) || defined(TARGET_NUCLEO_L486RG) 
00071 AnalogIn adc_vbat(ADC_VBAT); // Warning: Not available on all devices
00072 #endif
00073 AnalogIn TESTERPIN(PC_2);
00074 AnalogIn VIN48(PA_7);
00075 AnalogIn VIN12(PA_6);
00076 AnalogIn IIN12(PA_5);