PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Committer:
Pokitto
Date:
Fri Jan 05 02:19:51 2018 +0000
Revision:
28:958b71c4b92a
Parent:
0:e8b8f36b4505
Sound level stored in EEPROM, sound output improved

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pokitto 0:e8b8f36b4505 1 /**************************************************************************/
Pokitto 0:e8b8f36b4505 2 /*!
Pokitto 0:e8b8f36b4505 3 @file Pokitto_extport.h
Pokitto 0:e8b8f36b4505 4 @author Jonne Valola
Pokitto 0:e8b8f36b4505 5
Pokitto 0:e8b8f36b4505 6 @section LICENSE
Pokitto 0:e8b8f36b4505 7
Pokitto 0:e8b8f36b4505 8 Pokitto development stage library
Pokitto 0:e8b8f36b4505 9 Software License Agreement
Pokitto 0:e8b8f36b4505 10
Pokitto 0:e8b8f36b4505 11 Copyright (c) 2015, Jonne Valola ("Author")
Pokitto 0:e8b8f36b4505 12 All rights reserved.
Pokitto 0:e8b8f36b4505 13
Pokitto 0:e8b8f36b4505 14 This library is intended solely for the purpose of Pokitto development.
Pokitto 0:e8b8f36b4505 15
Pokitto 0:e8b8f36b4505 16 Redistribution and use in source and binary forms, with or without
Pokitto 0:e8b8f36b4505 17 modification requires written permission from Author.
Pokitto 0:e8b8f36b4505 18 */
Pokitto 0:e8b8f36b4505 19 /**************************************************************************/
Pokitto 0:e8b8f36b4505 20
Pokitto 0:e8b8f36b4505 21 #ifndef POKITTO_EXTPORT_H
Pokitto 0:e8b8f36b4505 22 #define POKITTO_EXTPORT_H
Pokitto 0:e8b8f36b4505 23
Pokitto 0:e8b8f36b4505 24 #include "mbed.h"
Pokitto 0:e8b8f36b4505 25
Pokitto 0:e8b8f36b4505 26 using namespace mbed; //interruptin
Pokitto 0:e8b8f36b4505 27
Pokitto 0:e8b8f36b4505 28 #if POK_BOARDREV == 1
Pokitto 0:e8b8f36b4505 29 /** 2-layer board rev 1.3 **/
Pokitto 0:e8b8f36b4505 30 #define EXT0_PORT 1
Pokitto 0:e8b8f36b4505 31 #define EXT0_PIN 19
Pokitto 0:e8b8f36b4505 32 #define EXT1_PORT 0
Pokitto 0:e8b8f36b4505 33 #define EXT1_PIN 11
Pokitto 0:e8b8f36b4505 34 #define EXT2_PORT 0
Pokitto 0:e8b8f36b4505 35 #define EXT2_PIN 12
Pokitto 0:e8b8f36b4505 36 #define EXT3_PORT 0
Pokitto 0:e8b8f36b4505 37 #define EXT3_PIN 13
Pokitto 0:e8b8f36b4505 38 #define EXT4_PORT 0
Pokitto 0:e8b8f36b4505 39 #define EXT4_PIN 14
Pokitto 0:e8b8f36b4505 40 #define EXT5_PORT 0
Pokitto 0:e8b8f36b4505 41 #define EXT5_PIN 17
Pokitto 0:e8b8f36b4505 42 #define EXT6_PORT 0
Pokitto 0:e8b8f36b4505 43 #define EXT6_PIN 18
Pokitto 0:e8b8f36b4505 44 #define EXT7_PORT 0
Pokitto 0:e8b8f36b4505 45 #define EXT7_PIN 19
Pokitto 0:e8b8f36b4505 46 #define EXT8_PORT 1
Pokitto 0:e8b8f36b4505 47 #define EXT8_PIN 20
Pokitto 0:e8b8f36b4505 48 #define EXT9_PORT 1
Pokitto 0:e8b8f36b4505 49 #define EXT9_PIN 21
Pokitto 0:e8b8f36b4505 50 #define EXT10_PORT 1
Pokitto 0:e8b8f36b4505 51 #define EXT10_PIN 22
Pokitto 0:e8b8f36b4505 52 #define EXT11_PORT 1
Pokitto 0:e8b8f36b4505 53 #define EXT11_PIN 23
Pokitto 0:e8b8f36b4505 54 #define EXT12_PORT 1
Pokitto 0:e8b8f36b4505 55 #define EXT12_PIN 5
Pokitto 0:e8b8f36b4505 56 #define EXT13_PORT 1
Pokitto 0:e8b8f36b4505 57 #define EXT13_PIN 6
Pokitto 0:e8b8f36b4505 58 #define EXT14_PORT 1
Pokitto 0:e8b8f36b4505 59 #define EXT14_PIN 8
Pokitto 0:e8b8f36b4505 60 #define EXT15_PORT 0
Pokitto 0:e8b8f36b4505 61 #define EXT15_PIN 19
Pokitto 0:e8b8f36b4505 62 #define EXT16_PORT 0
Pokitto 0:e8b8f36b4505 63 #define EXT16_PIN 13
Pokitto 0:e8b8f36b4505 64 #define EXT17_PORT 0
Pokitto 0:e8b8f36b4505 65 #define EXT17_PIN 16
Pokitto 0:e8b8f36b4505 66 #else
Pokitto 0:e8b8f36b4505 67 /** 4-layer board rev 2.1 **/
Pokitto 0:e8b8f36b4505 68 #define EXT0_PORT 1
Pokitto 0:e8b8f36b4505 69 #define EXT0_PIN 19
Pokitto 0:e8b8f36b4505 70 #define EXT1_PORT 0
Pokitto 0:e8b8f36b4505 71 #define EXT1_PIN 11
Pokitto 0:e8b8f36b4505 72 #define EXT2_PORT 0
Pokitto 0:e8b8f36b4505 73 #define EXT2_PIN 12
Pokitto 0:e8b8f36b4505 74 #define EXT3_PORT 0
Pokitto 0:e8b8f36b4505 75 #define EXT3_PIN 13
Pokitto 0:e8b8f36b4505 76 #define EXT4_PORT 0
Pokitto 0:e8b8f36b4505 77 #define EXT4_PIN 14
Pokitto 0:e8b8f36b4505 78 #define EXT5_PORT 0
Pokitto 0:e8b8f36b4505 79 #define EXT5_PIN 17
Pokitto 0:e8b8f36b4505 80 #define EXT6_PORT 0
Pokitto 0:e8b8f36b4505 81 #define EXT6_PIN 18
Pokitto 0:e8b8f36b4505 82 #define EXT7_PORT 0
Pokitto 0:e8b8f36b4505 83 #define EXT7_PIN 19
Pokitto 0:e8b8f36b4505 84 #define EXT8_PORT 1
Pokitto 0:e8b8f36b4505 85 #define EXT8_PIN 20
Pokitto 0:e8b8f36b4505 86 #define EXT9_PORT 1
Pokitto 0:e8b8f36b4505 87 #define EXT9_PIN 21
Pokitto 0:e8b8f36b4505 88 #define EXT10_PORT 1
Pokitto 0:e8b8f36b4505 89 #define EXT10_PIN 22
Pokitto 0:e8b8f36b4505 90 #define EXT11_PORT 1
Pokitto 0:e8b8f36b4505 91 #define EXT11_PIN 23
Pokitto 0:e8b8f36b4505 92 #define EXT12_PORT 1
Pokitto 0:e8b8f36b4505 93 #define EXT12_PIN 5
Pokitto 0:e8b8f36b4505 94 #define EXT13_PORT 1
Pokitto 0:e8b8f36b4505 95 #define EXT13_PIN 6
Pokitto 0:e8b8f36b4505 96 #define EXT14_PORT 1
Pokitto 0:e8b8f36b4505 97 #define EXT14_PIN 8
Pokitto 0:e8b8f36b4505 98 #define EXT15_PORT 0
Pokitto 0:e8b8f36b4505 99 #define EXT15_PIN 19
Pokitto 0:e8b8f36b4505 100 #define EXT16_PORT 0
Pokitto 0:e8b8f36b4505 101 #define EXT16_PIN 13
Pokitto 0:e8b8f36b4505 102 #define EXT17_PORT 0
Pokitto 0:e8b8f36b4505 103 #define EXT17_PIN 16
Pokitto 0:e8b8f36b4505 104
Pokitto 0:e8b8f36b4505 105 #define EXT0 P1_19
Pokitto 0:e8b8f36b4505 106 #define EXT1 P0_11
Pokitto 0:e8b8f36b4505 107 #define EXT2 P0_12
Pokitto 0:e8b8f36b4505 108 #define EXT3 P0_13
Pokitto 0:e8b8f36b4505 109 #define EXT4 P0_14
Pokitto 0:e8b8f36b4505 110 #define EXT5 P0_17
Pokitto 0:e8b8f36b4505 111 #define EXT6 P0_18
Pokitto 0:e8b8f36b4505 112 #define EXT7 P0_19
Pokitto 0:e8b8f36b4505 113 #define EXT8 P1_20
Pokitto 0:e8b8f36b4505 114 #define EXT9 P1_21
Pokitto 0:e8b8f36b4505 115 #define EXT10 P1_22
Pokitto 0:e8b8f36b4505 116 #define EXT11 P1_23
Pokitto 0:e8b8f36b4505 117 #define EXT12 P1_5
Pokitto 0:e8b8f36b4505 118 #define EXT13 P1_6
Pokitto 0:e8b8f36b4505 119 #define EXT14 P1_8
Pokitto 0:e8b8f36b4505 120 #define EXT15 P1_26
Pokitto 0:e8b8f36b4505 121 #define EXT16 P1_27
Pokitto 0:e8b8f36b4505 122 #define EXT17 P0_16
Pokitto 0:e8b8f36b4505 123
Pokitto 0:e8b8f36b4505 124 #endif // POK_BOARDREV
Pokitto 0:e8b8f36b4505 125
Pokitto 0:e8b8f36b4505 126 #define CLR_EXT0 LPC_GPIO_PORT->CLR[EXT0_PORT] = 1 << EXT0_PIN;
Pokitto 0:e8b8f36b4505 127 #define SET_EXT0 LPC_GPIO_PORT->SET[EXT0_PORT] = 1 << EXT0_PIN;
Pokitto 0:e8b8f36b4505 128 #define CLR_EXT1 LPC_GPIO_PORT->CLR[EXT1_PORT] = 1 << EXT1_PIN;
Pokitto 0:e8b8f36b4505 129 #define SET_EXT1 LPC_GPIO_PORT->SET[EXT1_PORT] = 1 << EXT1_PIN;
Pokitto 0:e8b8f36b4505 130 #define CLR_EXT2 LPC_GPIO_PORT->CLR[EXT2_PORT] = 1 << EXT2_PIN;
Pokitto 0:e8b8f36b4505 131 #define SET_EXT2 LPC_GPIO_PORT->SET[EXT2_PORT] = 1 << EXT2_PIN;
Pokitto 0:e8b8f36b4505 132 #define CLR_EXT3 LPC_GPIO_PORT->CLR[EXT3_PORT] = 1 << EXT3_PIN;
Pokitto 0:e8b8f36b4505 133 #define SET_EXT3 LPC_GPIO_PORT->SET[EXT3_PORT] = 1 << EXT3_PIN;
Pokitto 0:e8b8f36b4505 134 #define CLR_EXT4 LPC_GPIO_PORT->CLR[EXT4_PORT] = 1 << EXT4_PIN;
Pokitto 0:e8b8f36b4505 135 #define SET_EXT4 LPC_GPIO_PORT->SET[EXT4_PORT] = 1 << EXT4_PIN;
Pokitto 0:e8b8f36b4505 136 #define CLR_EXT5 LPC_GPIO_PORT->CLR[EXT5_PORT] = 1 << EXT5_PIN;
Pokitto 0:e8b8f36b4505 137 #define SET_EXT5 LPC_GPIO_PORT->SET[EXT5_PORT] = 1 << EXT5_PIN;
Pokitto 0:e8b8f36b4505 138 #define CLR_EXT6 LPC_GPIO_PORT->CLR[EXT6_PORT] = 1 << EXT6_PIN;
Pokitto 0:e8b8f36b4505 139 #define SET_EXT6 LPC_GPIO_PORT->SET[EXT6_PORT] = 1 << EXT6_PIN;
Pokitto 0:e8b8f36b4505 140 #define CLR_EXT7 LPC_GPIO_PORT->CLR[EXT7_PORT] = 1 << EXT7_PIN;
Pokitto 0:e8b8f36b4505 141 #define SET_EXT7 LPC_GPIO_PORT->SET[EXT7_PORT] = 1 << EXT7_PIN;
Pokitto 0:e8b8f36b4505 142 #define CLR_EXT8 LPC_GPIO_PORT->CLR[EXT8_PORT] = 1 << EXT8_PIN;
Pokitto 0:e8b8f36b4505 143 #define SET_EXT8 LPC_GPIO_PORT->SET[EXT8_PORT] = 1 << EXT8_PIN;
Pokitto 0:e8b8f36b4505 144 #define CLR_EXT9 LPC_GPIO_PORT->CLR[EXT9_PORT] = 1 << EXT9_PIN;
Pokitto 0:e8b8f36b4505 145 #define SET_EXT9 LPC_GPIO_PORT->SET[EXT9_PORT] = 1 << EXT9_PIN;
Pokitto 0:e8b8f36b4505 146 #define CLR_EXT10 LPC_GPIO_PORT->CLR[EXT10_PORT] = 1 << EXT10_PIN;
Pokitto 0:e8b8f36b4505 147 #define SET_EXT10 LPC_GPIO_PORT->SET[EXT10_PORT] = 1 << EXT10_PIN;
Pokitto 0:e8b8f36b4505 148 #define CLR_EXT11 LPC_GPIO_PORT->CLR[EXT11_PORT] = 1 << EXT11_PIN;
Pokitto 0:e8b8f36b4505 149 #define SET_EXT11 LPC_GPIO_PORT->SET[EXT11_PORT] = 1 << EXT11_PIN;
Pokitto 0:e8b8f36b4505 150 #define CLR_EXT12 LPC_GPIO_PORT->CLR[EXT12_PORT] = 1 << EXT12_PIN;
Pokitto 0:e8b8f36b4505 151 #define SET_EXT12 LPC_GPIO_PORT->SET[EXT12_PORT] = 1 << EXT12_PIN;
Pokitto 0:e8b8f36b4505 152 #define CLR_EXT13 LPC_GPIO_PORT->CLR[EXT13_PORT] = 1 << EXT13_PIN;
Pokitto 0:e8b8f36b4505 153 #define SET_EXT13 LPC_GPIO_PORT->SET[EXT13_PORT] = 1 << EXT13_PIN;
Pokitto 0:e8b8f36b4505 154 #define CLR_EXT14 LPC_GPIO_PORT->CLR[EXT14_PORT] = 1 << EXT14_PIN;
Pokitto 0:e8b8f36b4505 155 #define SET_EXT14 LPC_GPIO_PORT->SET[EXT14_PORT] = 1 << EXT14_PIN;
Pokitto 0:e8b8f36b4505 156 #define CLR_EXT15 LPC_GPIO_PORT->CLR[EXT15_PORT] = 1 << EXT15_PIN;
Pokitto 0:e8b8f36b4505 157 #define SET_EXT15 LPC_GPIO_PORT->SET[EXT15_PORT] = 1 << EXT15_PIN;
Pokitto 0:e8b8f36b4505 158 #define CLR_EXT16 LPC_GPIO_PORT->CLR[EXT16_PORT] = 1 << EXT16_PIN;
Pokitto 0:e8b8f36b4505 159 #define SET_EXT16 LPC_GPIO_PORT->SET[EXT16_PORT] = 1 << EXT16_PIN;
Pokitto 0:e8b8f36b4505 160 #define CLR_EXT17 LPC_GPIO_PORT->CLR[EXT17_PORT] = 1 << EXT17_PIN;
Pokitto 0:e8b8f36b4505 161 #define SET_EXT17 LPC_GPIO_PORT->SET[EXT17_PORT] = 1 << EXT17_PIN;
Pokitto 0:e8b8f36b4505 162
Pokitto 0:e8b8f36b4505 163 #if POK_USE_EXT > 0
Pokitto 0:e8b8f36b4505 164 //#if POK_BOARDREV == 1
Pokitto 0:e8b8f36b4505 165 /** 2-layer board rev 1.3 **/
Pokitto 0:e8b8f36b4505 166 //#else
Pokitto 0:e8b8f36b4505 167 /** 4-layer board rev 2.1 **/
Pokitto 0:e8b8f36b4505 168 //extern InterruptIn ext0;
Pokitto 0:e8b8f36b4505 169 extern AnalogIn ext0;
Pokitto 0:e8b8f36b4505 170 extern DigitalIn ext1;
Pokitto 0:e8b8f36b4505 171 //DigitalOut ext0;
Pokitto 0:e8b8f36b4505 172 //DigitalOut ext1;
Pokitto 0:e8b8f36b4505 173 extern DigitalOut ext2;
Pokitto 0:e8b8f36b4505 174 extern DigitalOut ext3;
Pokitto 0:e8b8f36b4505 175 extern DigitalOut ext4;
Pokitto 0:e8b8f36b4505 176 extern DigitalOut ext5;
Pokitto 0:e8b8f36b4505 177 extern DigitalOut ext6;
Pokitto 0:e8b8f36b4505 178 extern DigitalOut ext7;
Pokitto 0:e8b8f36b4505 179 extern DigitalOut ext8;
Pokitto 0:e8b8f36b4505 180 extern DigitalOut ext9;
Pokitto 0:e8b8f36b4505 181 extern DigitalOut ext10;
Pokitto 0:e8b8f36b4505 182 extern DigitalOut ext11;
Pokitto 0:e8b8f36b4505 183 extern DigitalOut ext12;
Pokitto 0:e8b8f36b4505 184 extern DigitalOut ext13;
Pokitto 0:e8b8f36b4505 185 extern DigitalOut ext14;
Pokitto 0:e8b8f36b4505 186 extern DigitalOut ext15;
Pokitto 0:e8b8f36b4505 187 extern DigitalOut ext16;
Pokitto 0:e8b8f36b4505 188 extern DigitalOut ext17;
Pokitto 0:e8b8f36b4505 189 //#endif // POK_BOARDREV
Pokitto 0:e8b8f36b4505 190 #endif // POK_USE_EXT
Pokitto 0:e8b8f36b4505 191
Pokitto 0:e8b8f36b4505 192 extern int turn;
Pokitto 0:e8b8f36b4505 193 #endif // POKITTO_EXTPORT_H
Pokitto 0:e8b8f36b4505 194