2016-04-06 16:07:03 +00:00
|
|
|
/*
|
|
|
|
The MIT License (MIT)
|
|
|
|
|
|
|
|
Copyright (c) 2016 British Broadcasting Corporation.
|
|
|
|
This software is provided by Lancaster University by arrangement with the BBC.
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2015-08-12 10:53:41 +00:00
|
|
|
#ifndef MICROBIT_IO_H
|
|
|
|
#define MICROBIT_IO_H
|
|
|
|
|
|
|
|
#include "mbed.h"
|
2016-03-17 17:33:57 +00:00
|
|
|
#include "MicroBitConfig.h"
|
2015-09-11 15:39:38 +00:00
|
|
|
#include "MicroBitComponent.h"
|
2015-08-12 10:53:41 +00:00
|
|
|
#include "MicroBitPin.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class definition for MicroBit IO.
|
|
|
|
*
|
2016-04-04 01:01:15 +00:00
|
|
|
* Represents a collection of all I/O pins on the edge connector.
|
2015-08-12 10:53:41 +00:00
|
|
|
*/
|
|
|
|
class MicroBitIO
|
2016-03-17 12:24:45 +00:00
|
|
|
{
|
2015-08-12 10:53:41 +00:00
|
|
|
public:
|
2016-03-17 12:24:45 +00:00
|
|
|
|
|
|
|
MicroBitPin pin[0];
|
2015-11-23 19:46:20 +00:00
|
|
|
MicroBitPin P0;
|
2015-08-12 10:53:41 +00:00
|
|
|
MicroBitPin P1;
|
|
|
|
MicroBitPin P2;
|
|
|
|
MicroBitPin P3;
|
|
|
|
MicroBitPin P4;
|
|
|
|
MicroBitPin P5;
|
|
|
|
MicroBitPin P6;
|
|
|
|
MicroBitPin P7;
|
|
|
|
MicroBitPin P8;
|
|
|
|
MicroBitPin P9;
|
|
|
|
MicroBitPin P10;
|
|
|
|
MicroBitPin P11;
|
|
|
|
MicroBitPin P12;
|
|
|
|
MicroBitPin P13;
|
|
|
|
MicroBitPin P14;
|
|
|
|
MicroBitPin P15;
|
|
|
|
MicroBitPin P16;
|
|
|
|
MicroBitPin P19;
|
|
|
|
MicroBitPin P20;
|
2016-03-17 12:24:45 +00:00
|
|
|
|
2015-08-12 10:53:41 +00:00
|
|
|
/**
|
2016-03-17 12:24:45 +00:00
|
|
|
* Constructor.
|
2016-04-04 01:01:15 +00:00
|
|
|
*
|
2015-08-12 10:53:41 +00:00
|
|
|
* Create a representation of all given I/O pins on the edge connector
|
2016-04-04 01:01:15 +00:00
|
|
|
*
|
|
|
|
* Accepts a sequence of unique ID's used to distinguish events raised
|
|
|
|
* by MicroBitPin instances on the default EventModel.
|
2015-08-12 10:53:41 +00:00
|
|
|
*/
|
2015-09-11 15:39:38 +00:00
|
|
|
MicroBitIO(int ID_P0, int ID_P1, int ID_P2,
|
|
|
|
int ID_P3, int ID_P4, int ID_P5,
|
|
|
|
int ID_P6, int ID_P7, int ID_P8,
|
|
|
|
int ID_P9, int ID_P10,int ID_P11,
|
|
|
|
int ID_P12,int ID_P13,int ID_P14,
|
|
|
|
int ID_P15,int ID_P16,int ID_P19,
|
2018-11-22 14:00:07 +00:00
|
|
|
int ID_P20);
|
2015-08-12 10:53:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|