PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)
Dependents: YATTT sd_map_test cPong SnowDemo ... more
Pokitto_extport.cpp
00001 /**************************************************************************/ 00002 /*! 00003 @file Pokitto_extport.cpp 00004 @author Jonne Valola 00005 00006 @section LICENSE 00007 00008 Pokitto development stage library 00009 Software License Agreement 00010 00011 Copyright (c) 2015, Jonne Valola ("Author") 00012 All rights reserved. 00013 00014 This library is intended solely for the purpose of Pokitto development. 00015 00016 Redistribution and use in source and binary forms, with or without 00017 modification requires written permission from Author. 00018 */ 00019 /**************************************************************************/ 00020 00021 #include "Pokitto.h " 00022 00023 using namespace mbed; //needed for interruptin 00024 00025 #if POK_USE_EXT > 0 00026 //#if POK_BOARDREV == 1 00027 /** 2-layer board rev 1.3 **/ 00028 //#else 00029 /** 4-layer board rev 2.1 **/ 00030 //InterruptIn ext0(P1_19); 00031 AnalogIn ext0(P1_19); 00032 DigitalIn ext1(P0_11, PullUp); 00033 //DigitalOut ext0(P1_19); 00034 //DigitalOut ext1(P0_11); 00035 DigitalOut ext2(P0_12); 00036 DigitalOut ext3(P0_13); 00037 DigitalOut ext4(P0_14); 00038 DigitalOut ext5(P0_17); 00039 DigitalOut ext6(P0_18); 00040 DigitalOut ext7(P0_19); 00041 DigitalOut ext8(P1_20); 00042 DigitalOut ext9(P1_21); 00043 DigitalOut ext10(P1_22); 00044 DigitalOut ext11(P1_23); 00045 DigitalOut ext12(P1_5); 00046 DigitalOut ext13(P1_6); 00047 DigitalOut ext14(P1_8); 00048 DigitalOut ext15(P1_26); 00049 DigitalOut ext16(P1_27); 00050 DigitalOut ext17(P0_16); 00051 //#endif // POK_BOARDREV 00052 #endif // POK_USE_EXT 00053 00054 00055 00056 void ext_write(uint32_t value) { 00057 #if POK_USE_EXT > 0 00058 if (value & 1) SET_EXT0 else CLR_EXT0; 00059 value >>= 1; 00060 if (value & 1) SET_EXT1 else CLR_EXT1; 00061 value >>= 1; 00062 if (value & 1) SET_EXT2 else CLR_EXT2; 00063 value >>= 1; 00064 if (value & 1) SET_EXT3 else CLR_EXT3; 00065 value >>= 1; 00066 if (value & 1) SET_EXT4 else CLR_EXT4; 00067 value >>= 1; 00068 if (value & 1) SET_EXT5 else CLR_EXT5; 00069 value >>= 1; 00070 if (value & 1) SET_EXT6 else CLR_EXT6; 00071 value >>= 1; 00072 if (value & 1) SET_EXT7 else CLR_EXT7; 00073 value >>= 1; 00074 if (value & 1) SET_EXT8 else CLR_EXT8; 00075 value >>= 1; 00076 if (value & 1) SET_EXT9 else CLR_EXT9; 00077 value >>= 1; 00078 if (value & 1) SET_EXT10 else CLR_EXT10; 00079 value >>= 1; 00080 if (value & 1) SET_EXT11 else CLR_EXT11; 00081 value >>= 1; 00082 if (value & 1) SET_EXT12 else CLR_EXT12; 00083 value >>= 1; 00084 if (value & 1) SET_EXT13 else CLR_EXT13; 00085 value >>= 1; 00086 if (value & 1) SET_EXT14 else CLR_EXT14; 00087 value >>= 1; 00088 if (value & 1) SET_EXT15 else CLR_EXT15; 00089 value >>= 1; 00090 if (value & 1) SET_EXT16 else CLR_EXT16; 00091 value >>= 1; 00092 if (value & 1) SET_EXT17 else CLR_EXT17; 00093 #endif 00094 } 00095 00096
Generated on Tue Jul 12 2022 11:20:34 by 1.7.2