No Changes
Dependencies: BLE_API mbed-dev-bin nRF51822
Fork of microbit-dal by
inc/drivers/MicroBitIO.h@75:ae9a17da71af, 2017-01-13 (annotated)
- Committer:
- Asimov
- Date:
- Fri Jan 13 21:14:06 2017 +0000
- Revision:
- 75:ae9a17da71af
- Parent:
- 1:8aa5cdb4ab67
No Changes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jonathan Austin |
1:8aa5cdb4ab67 | 1 | /* |
Jonathan Austin |
1:8aa5cdb4ab67 | 2 | The MIT License (MIT) |
Jonathan Austin |
1:8aa5cdb4ab67 | 3 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 4 | Copyright (c) 2016 British Broadcasting Corporation. |
Jonathan Austin |
1:8aa5cdb4ab67 | 5 | This software is provided by Lancaster University by arrangement with the BBC. |
Jonathan Austin |
1:8aa5cdb4ab67 | 6 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 7 | Permission is hereby granted, free of charge, to any person obtaining a |
Jonathan Austin |
1:8aa5cdb4ab67 | 8 | copy of this software and associated documentation files (the "Software"), |
Jonathan Austin |
1:8aa5cdb4ab67 | 9 | to deal in the Software without restriction, including without limitation |
Jonathan Austin |
1:8aa5cdb4ab67 | 10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
Jonathan Austin |
1:8aa5cdb4ab67 | 11 | and/or sell copies of the Software, and to permit persons to whom the |
Jonathan Austin |
1:8aa5cdb4ab67 | 12 | Software is furnished to do so, subject to the following conditions: |
Jonathan Austin |
1:8aa5cdb4ab67 | 13 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 14 | The above copyright notice and this permission notice shall be included in |
Jonathan Austin |
1:8aa5cdb4ab67 | 15 | all copies or substantial portions of the Software. |
Jonathan Austin |
1:8aa5cdb4ab67 | 16 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Jonathan Austin |
1:8aa5cdb4ab67 | 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Jonathan Austin |
1:8aa5cdb4ab67 | 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
Jonathan Austin |
1:8aa5cdb4ab67 | 20 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
Jonathan Austin |
1:8aa5cdb4ab67 | 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
Jonathan Austin |
1:8aa5cdb4ab67 | 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
Jonathan Austin |
1:8aa5cdb4ab67 | 23 | DEALINGS IN THE SOFTWARE. |
Jonathan Austin |
1:8aa5cdb4ab67 | 24 | */ |
Jonathan Austin |
1:8aa5cdb4ab67 | 25 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 26 | #ifndef MICROBIT_IO_H |
Jonathan Austin |
1:8aa5cdb4ab67 | 27 | #define MICROBIT_IO_H |
Jonathan Austin |
1:8aa5cdb4ab67 | 28 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 29 | #include "mbed.h" |
Jonathan Austin |
1:8aa5cdb4ab67 | 30 | #include "MicroBitConfig.h" |
Jonathan Austin |
1:8aa5cdb4ab67 | 31 | #include "MicroBitComponent.h" |
Jonathan Austin |
1:8aa5cdb4ab67 | 32 | #include "MicroBitPin.h" |
Jonathan Austin |
1:8aa5cdb4ab67 | 33 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 34 | /** |
Jonathan Austin |
1:8aa5cdb4ab67 | 35 | * Class definition for MicroBit IO. |
Jonathan Austin |
1:8aa5cdb4ab67 | 36 | * |
Jonathan Austin |
1:8aa5cdb4ab67 | 37 | * Represents a collection of all I/O pins on the edge connector. |
Jonathan Austin |
1:8aa5cdb4ab67 | 38 | */ |
Jonathan Austin |
1:8aa5cdb4ab67 | 39 | class MicroBitIO |
Jonathan Austin |
1:8aa5cdb4ab67 | 40 | { |
Jonathan Austin |
1:8aa5cdb4ab67 | 41 | public: |
Jonathan Austin |
1:8aa5cdb4ab67 | 42 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 43 | MicroBitPin pin[0]; |
Jonathan Austin |
1:8aa5cdb4ab67 | 44 | MicroBitPin P0; |
Jonathan Austin |
1:8aa5cdb4ab67 | 45 | MicroBitPin P1; |
Jonathan Austin |
1:8aa5cdb4ab67 | 46 | MicroBitPin P2; |
Jonathan Austin |
1:8aa5cdb4ab67 | 47 | MicroBitPin P3; |
Jonathan Austin |
1:8aa5cdb4ab67 | 48 | MicroBitPin P4; |
Jonathan Austin |
1:8aa5cdb4ab67 | 49 | MicroBitPin P5; |
Jonathan Austin |
1:8aa5cdb4ab67 | 50 | MicroBitPin P6; |
Jonathan Austin |
1:8aa5cdb4ab67 | 51 | MicroBitPin P7; |
Jonathan Austin |
1:8aa5cdb4ab67 | 52 | MicroBitPin P8; |
Jonathan Austin |
1:8aa5cdb4ab67 | 53 | MicroBitPin P9; |
Jonathan Austin |
1:8aa5cdb4ab67 | 54 | MicroBitPin P10; |
Jonathan Austin |
1:8aa5cdb4ab67 | 55 | MicroBitPin P11; |
Jonathan Austin |
1:8aa5cdb4ab67 | 56 | MicroBitPin P12; |
Jonathan Austin |
1:8aa5cdb4ab67 | 57 | MicroBitPin P13; |
Jonathan Austin |
1:8aa5cdb4ab67 | 58 | MicroBitPin P14; |
Jonathan Austin |
1:8aa5cdb4ab67 | 59 | MicroBitPin P15; |
Jonathan Austin |
1:8aa5cdb4ab67 | 60 | MicroBitPin P16; |
Jonathan Austin |
1:8aa5cdb4ab67 | 61 | MicroBitPin P19; |
Jonathan Austin |
1:8aa5cdb4ab67 | 62 | MicroBitPin P20; |
Jonathan Austin |
1:8aa5cdb4ab67 | 63 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 64 | /** |
Jonathan Austin |
1:8aa5cdb4ab67 | 65 | * Constructor. |
Jonathan Austin |
1:8aa5cdb4ab67 | 66 | * |
Jonathan Austin |
1:8aa5cdb4ab67 | 67 | * Create a representation of all given I/O pins on the edge connector |
Jonathan Austin |
1:8aa5cdb4ab67 | 68 | * |
Jonathan Austin |
1:8aa5cdb4ab67 | 69 | * Accepts a sequence of unique ID's used to distinguish events raised |
Jonathan Austin |
1:8aa5cdb4ab67 | 70 | * by MicroBitPin instances on the default EventModel. |
Jonathan Austin |
1:8aa5cdb4ab67 | 71 | */ |
Jonathan Austin |
1:8aa5cdb4ab67 | 72 | MicroBitIO(int ID_P0, int ID_P1, int ID_P2, |
Jonathan Austin |
1:8aa5cdb4ab67 | 73 | int ID_P3, int ID_P4, int ID_P5, |
Jonathan Austin |
1:8aa5cdb4ab67 | 74 | int ID_P6, int ID_P7, int ID_P8, |
Jonathan Austin |
1:8aa5cdb4ab67 | 75 | int ID_P9, int ID_P10,int ID_P11, |
Jonathan Austin |
1:8aa5cdb4ab67 | 76 | int ID_P12,int ID_P13,int ID_P14, |
Jonathan Austin |
1:8aa5cdb4ab67 | 77 | int ID_P15,int ID_P16,int ID_P19, |
Jonathan Austin |
1:8aa5cdb4ab67 | 78 | int ID_P20); |
Jonathan Austin |
1:8aa5cdb4ab67 | 79 | }; |
Jonathan Austin |
1:8aa5cdb4ab67 | 80 | |
Jonathan Austin |
1:8aa5cdb4ab67 | 81 | #endif |