|
| 1 | +/* |
| 2 | + * Copyright (c) 2016 Intel Corporation. All rights reserved. |
| 3 | + * See the bottom of this file for the license terms. |
| 4 | + */ |
| 5 | + |
| 6 | +/* |
| 7 | + * This sketch example demonstrates a simple way to use the Shared Memory Communication library between |
| 8 | + * the ARC and Quark cores. |
| 9 | + * It requires that the firmware be upgraded to one that supports the Shared Memory Communication library. |
| 10 | + * This sketch example will need to be used with the smc example built using the CODK-M tree. |
| 11 | + * |
| 12 | + * This sketch sends values to the Quark core which then reads those values, doubles them and sends it back to the ARC core. |
| 13 | + * This sketch then reads those values and displays the doubled values. |
| 14 | + */ |
| 15 | + |
| 16 | +#include <CurieSMC.h> |
| 17 | + |
| 18 | +void setup() |
| 19 | +{ |
| 20 | + Serial.begin(384000); |
| 21 | + while(!Serial); |
| 22 | + SMC.begin(); |
| 23 | +} |
| 24 | + |
| 25 | +void loop() |
| 26 | +{ |
| 27 | + for(int i = 0; i < 32; i++) |
| 28 | + { |
| 29 | + Serial.print("writing : "); |
| 30 | + Serial.println(i); |
| 31 | + SMC.write(i); |
| 32 | + } |
| 33 | + while(SMC.availableForRead()) |
| 34 | + { |
| 35 | + Serial.print("data: "); |
| 36 | + Serial.println(SMC.read()); |
| 37 | + } |
| 38 | + |
| 39 | + delay(1000); |
| 40 | +} |
| 41 | + |
| 42 | +/* |
| 43 | + Copyright (c) 2016 Intel Corporation. All rights reserved. |
| 44 | +
|
| 45 | + This library is free software; you can redistribute it and/or |
| 46 | + modify it under the terms of the GNU Lesser General Public |
| 47 | + License as published by the Free Software Foundation; either |
| 48 | + version 2.1 of the License, or (at your option) any later version. |
| 49 | +
|
| 50 | + This library is distributed in the hope that it will be useful, |
| 51 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 52 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 53 | + Lesser General Public License for more details. |
| 54 | +
|
| 55 | + You should have received a copy of the GNU Lesser General Public |
| 56 | + License along with this library; if not, write to the Free Software |
| 57 | + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 58 | +
|
| 59 | +*/ |
| 60 | + |
0 commit comments