Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
src/all_io.cpp@3:d8948c5b2951, 2018-11-27 (annotated)
- Committer:
- mfwic
- Date:
- Tue Nov 27 17:47:57 2018 +0000
- Revision:
- 3:d8948c5b2951
- Parent:
- 1:9f8583ba2431
- Child:
- 4:db38665c3727
Menu works
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mfwic | 0:44a3005d4f20 | 1 | //------------------------------------------------------------------------------- |
mfwic | 0:44a3005d4f20 | 2 | // |
mfwic | 0:44a3005d4f20 | 3 | // Treehouse Designs Inc. |
mfwic | 0:44a3005d4f20 | 4 | // Colorado Springs, Colorado |
mfwic | 0:44a3005d4f20 | 5 | // |
mfwic | 0:44a3005d4f20 | 6 | // Copyright (c) 2016 by Treehouse Designs Inc. |
mfwic | 0:44a3005d4f20 | 7 | // Copyright (c) 2018 by Agility Power Systems Inc. |
mfwic | 0:44a3005d4f20 | 8 | // |
mfwic | 0:44a3005d4f20 | 9 | // This code is the property of Treehouse Designs, Inc. (Treehouse) and |
mfwic | 0:44a3005d4f20 | 10 | // Agility Power Systems Inc. (Agility) and may not be redistributed |
mfwic | 0:44a3005d4f20 | 11 | // in any form without prior written permission from |
mfwic | 0:44a3005d4f20 | 12 | // both copyright holders, Treehouse and Agility. |
mfwic | 0:44a3005d4f20 | 13 | // |
mfwic | 0:44a3005d4f20 | 14 | // The above copyright notice and this permission notice shall be included in |
mfwic | 0:44a3005d4f20 | 15 | // all copies or substantial portions of the Software. |
mfwic | 0:44a3005d4f20 | 16 | // |
mfwic | 0:44a3005d4f20 | 17 | // |
mfwic | 0:44a3005d4f20 | 18 | //------------------------------------------------------------------------------- |
mfwic | 0:44a3005d4f20 | 19 | // |
mfwic | 0:44a3005d4f20 | 20 | // REVISION HISTORY: |
mfwic | 0:44a3005d4f20 | 21 | // |
mfwic | 0:44a3005d4f20 | 22 | // $Author: $ |
mfwic | 0:44a3005d4f20 | 23 | // $Rev: $ |
mfwic | 0:44a3005d4f20 | 24 | // $Date: $ |
mfwic | 0:44a3005d4f20 | 25 | // $URL: $ |
mfwic | 0:44a3005d4f20 | 26 | // |
mfwic | 0:44a3005d4f20 | 27 | //------------------------------------------------------------------------------- |
mfwic | 0:44a3005d4f20 | 28 | |
mfwic | 0:44a3005d4f20 | 29 | #include "mbed.h" |
mfwic | 0:44a3005d4f20 | 30 | #include "all_io.h" |
mfwic | 0:44a3005d4f20 | 31 | #include "PortOut.h" |
mfwic | 0:44a3005d4f20 | 32 | |
mfwic | 0:44a3005d4f20 | 33 | // Digital IO |
mfwic | 0:44a3005d4f20 | 34 | // |
mfwic | 0:44a3005d4f20 | 35 | // Slots 12 to 0 are activated with the wr_out signals |
mfwic | 0:44a3005d4f20 | 36 | // wr_out[13] = slots[12:0] |
mfwic | 1:9f8583ba2431 | 37 | //DigitalOut wr_out[13] = {PC_12, PC_11, PC_10, PC_9, PC_8, PC_7, PC_6, PC_5, PC_4, PC_3, PC_2, PC_1, PC_0}; |
mfwic | 3:d8948c5b2951 | 38 | //BusOut wr_out(PC_12, PC_11, PC_10, PC_9, PC_8, PC_7, PC_6, PC_5, PC_4, PC_3, PC_2, PC_1, PC_0); //RK: Need to change ADC inputs to PC_0-PC_5 |
mfwic | 3:d8948c5b2951 | 39 | BusOut wr_out(PC_12, PC_11, PC_10, PC_9, PC_8, PC_7, PC_6, PA_15, PA_14, PA_13, PA_12, PA_11, PA_10); //RK: Need to change ADC inputs to PC_0-PC_5 |
mfwic | 3:d8948c5b2951 | 40 | |
mfwic | 0:44a3005d4f20 | 41 | // en_out are binary weighted signals that activate groups of DC-DC converters on the slot cards. |
mfwic | 0:44a3005d4f20 | 42 | // en_out[6] = {en32, en16, en8, en4, en2, en1} |
mfwic | 1:9f8583ba2431 | 43 | //DigitalOut en_out[6] = {PA_9, PA_8, PA_7, PA_6, PA_5, PA_4}; |
mfwic | 3:d8948c5b2951 | 44 | //BusOut en_out(PA_9, PA_8, PA_7, PA_6, PA_5, PA_4); |
mfwic | 3:d8948c5b2951 | 45 | BusOut en_out(PA_9, PA_8, PA_7, PA_6, PA_4); //RK: debug 11/26/2018 |
mfwic | 3:d8948c5b2951 | 46 | |
mfwic | 0:44a3005d4f20 | 47 | // Expansion port signals |
mfwic | 0:44a3005d4f20 | 48 | // eport[16] = eport[18:3] |
mfwic | 1:9f8583ba2431 | 49 | //DigitalIn eport[16] = {PB_15, PB_14, PB_13, PB_12, PB_11, PB_10, PB_9, PB_8, PB_7, PB_6, PB_5, PB_4, PB_3, PB_2, PB_1, PB_0}; |
mfwic | 1:9f8583ba2431 | 50 | DigitalIn eport[16] = {PB_15, PB_14, PB_13, PB_12, PB_12, PB_10, PB_9, PB_8, PB_7, PB_6, PB_5, PB_4, PB_3, PB_2, PB_1, PB_0}; //RK 11/24/2018 PB_11 throws an error. Identifier "PB_11" is undefined. PB_11 is connevcted to VCAP1. |
mfwic | 3:d8948c5b2951 | 51 | |
mfwic | 1:9f8583ba2431 | 52 | // Use extchlat to latch new wr_out signals to the external slots via ribbon cable. |
mfwic | 3:d8948c5b2951 | 53 | DigitalOut extchlat(PA_1); |
mfwic | 3:d8948c5b2951 | 54 | |
mfwic | 0:44a3005d4f20 | 55 | // all_on indicates that the load demanded a high amount of current and all DC-DC converters are enabled. |
mfwic | 3:d8948c5b2951 | 56 | DigitalIn all_on(PA_0); |
mfwic | 0:44a3005d4f20 | 57 | |
mfwic | 0:44a3005d4f20 | 58 | // Analog IO |
mfwic | 0:44a3005d4f20 | 59 | // |
mfwic | 3:d8948c5b2951 | 60 | //AnalogIn VIN48(PA_13); |
mfwic | 3:d8948c5b2951 | 61 | //AnalogIn VIN24(PA_15); |
mfwic | 3:d8948c5b2951 | 62 | //AnalogIn VIN12(PA_14); |
mfwic | 3:d8948c5b2951 | 63 | //AnalogIn IIN48(PA_12); |
mfwic | 3:d8948c5b2951 | 64 | //AnalogIn IIN24(PA_10); |
mfwic | 3:d8948c5b2951 | 65 | //AnalogIn IIN12(PA_11); |
mfwic | 3:d8948c5b2951 | 66 | AnalogIn VIN48(PC_5); |
mfwic | 3:d8948c5b2951 | 67 | AnalogIn VIN24(PC_4); |
mfwic | 3:d8948c5b2951 | 68 | AnalogIn VIN12(PC_3); |
mfwic | 3:d8948c5b2951 | 69 | AnalogIn IIN48(PC_2); |
mfwic | 3:d8948c5b2951 | 70 | AnalogIn IIN24(PC_1); |
mfwic | 3:d8948c5b2951 | 71 | AnalogIn IIN12(PC_0); |
mfwic | 1:9f8583ba2431 | 72 | |
mfwic | 1:9f8583ba2431 | 73 | // Change LED out to PD_2 |
mfwic | 3:d8948c5b2951 | 74 | //DigitalOut myled = PD_2; |
mfwic | 3:d8948c5b2951 | 75 | //DigitalOut myled = PA_5; |
mfwic | 3:d8948c5b2951 | 76 | DigitalOut myled(LED1); |