mbed.org local branch of microbit-dal. The real version lives in git at https://github.com/lancaster-university/microbit-dal

Dependencies:   BLE_API nRF51822 mbed-dev-bin

Dependents:   microbit Microbit IoTChallenge1 microbit ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MicroBitIO.h Source File

MicroBitIO.h

00001 /*
00002 The MIT License (MIT)
00003 
00004 Copyright (c) 2016 British Broadcasting Corporation.
00005 This software is provided by Lancaster University by arrangement with the BBC.
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a
00008 copy of this software and associated documentation files (the "Software"),
00009 to deal in the Software without restriction, including without limitation
00010 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011 and/or sell copies of the Software, and to permit persons to whom the
00012 Software is furnished to do so, subject to the following conditions:
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 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00020 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00021 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00022 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00023 DEALINGS IN THE SOFTWARE.
00024 */
00025 
00026 #ifndef MICROBIT_IO_H
00027 #define MICROBIT_IO_H
00028 
00029 #include "mbed.h"
00030 #include "MicroBitConfig.h"
00031 #include "MicroBitComponent.h"
00032 #include "MicroBitPin.h"
00033 
00034 /**
00035   * Class definition for MicroBit IO.
00036   *
00037   * Represents a collection of all I/O pins on the edge connector.
00038   */
00039 class MicroBitIO
00040 {
00041     public:
00042 
00043     MicroBitPin          pin[0];
00044     MicroBitPin          P0;
00045     MicroBitPin          P1;
00046     MicroBitPin          P2;
00047     MicroBitPin          P3;
00048     MicroBitPin          P4;
00049     MicroBitPin          P5;
00050     MicroBitPin          P6;
00051     MicroBitPin          P7;
00052     MicroBitPin          P8;
00053     MicroBitPin          P9;
00054     MicroBitPin          P10;
00055     MicroBitPin          P11;
00056     MicroBitPin          P12;
00057     MicroBitPin          P13;
00058     MicroBitPin          P14;
00059     MicroBitPin          P15;
00060     MicroBitPin          P16;
00061     MicroBitPin          P19;
00062     MicroBitPin          P20;
00063 
00064     /**
00065       * Constructor.
00066       *
00067       * Create a representation of all given I/O pins on the edge connector
00068       *
00069       * Accepts a sequence of unique ID's used to distinguish events raised
00070       * by MicroBitPin instances on the default EventModel.
00071       */
00072     MicroBitIO(int ID_P0, int ID_P1, int ID_P2,
00073                int ID_P3, int ID_P4, int ID_P5,
00074                int ID_P6, int ID_P7, int ID_P8,
00075                int ID_P9, int ID_P10,int ID_P11,
00076                int ID_P12,int ID_P13,int ID_P14,
00077                int ID_P15,int ID_P16,int ID_P19,
00078                int ID_P20);
00079 };
00080 
00081 #endif