mbed-os
Fork of mbed-os by
features/unsupported/tests/mbed/bus/main.cpp@1:3deb71413561, 2017-07-20 (annotated)
- Committer:
- xuaner
- Date:
- Thu Jul 20 14:26:57 2017 +0000
- Revision:
- 1:3deb71413561
- Parent:
- 0:f269e3021894
mbed_os
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | #include "mbed.h" |
elessair | 0:f269e3021894 | 2 | #include "test_env.h" |
elessair | 0:f269e3021894 | 3 | |
elessair | 0:f269e3021894 | 4 | #if defined(TARGET_SAMR21G18A) |
elessair | 0:f269e3021894 | 5 | BusOut bus1(PA06, PA07, PA13, PA28, PA18, PA19, PA22, PA23, PA16, PA17, PA05, PA04); |
elessair | 0:f269e3021894 | 6 | BusOut bus2(PB03, PB22, PB02, PB23); |
elessair | 0:f269e3021894 | 7 | |
elessair | 0:f269e3021894 | 8 | #elif defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A) |
elessair | 0:f269e3021894 | 9 | BusOut bus1(PA06, PA07, PA13, PA28, PA18, PA19, PA22, PA23, PA16, PA17, PA05, PA04); |
elessair | 0:f269e3021894 | 10 | BusOut bus2(PB03, PB22, PB02, PB23); |
elessair | 0:f269e3021894 | 11 | |
elessair | 0:f269e3021894 | 12 | #elif defined(TARGET_SAML21J18A) |
elessair | 0:f269e3021894 | 13 | BusOut bus1(PA02, PA03, PA04, PA05, PA06, PA07, PA08, PA09, PA10, PA11, PA16, PA17); |
elessair | 0:f269e3021894 | 14 | BusOut bus2(PB10, PB11, PB12, PB13); |
elessair | 0:f269e3021894 | 15 | |
elessair | 0:f269e3021894 | 16 | #elif defined(TARGET_FF_ARDUINO) |
elessair | 0:f269e3021894 | 17 | BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15); |
elessair | 0:f269e3021894 | 18 | BusOut bus2(A5, A4, A3, A2, A1, A0); |
elessair | 0:f269e3021894 | 19 | |
elessair | 0:f269e3021894 | 20 | #elif defined(TARGET_SAMG55J19) |
elessair | 0:f269e3021894 | 21 | BusOut bus1(PA18, PA17, PA25, PA26, PA23, PA00, PA29, PA24, PA10, PA09, PA13, PA11, PA14); |
elessair | 0:f269e3021894 | 22 | BusOut bus2(PB00, PB01, PB08, PB09, PB10, PB11, PB14); |
elessair | 0:f269e3021894 | 23 | |
elessair | 0:f269e3021894 | 24 | #else |
elessair | 0:f269e3021894 | 25 | #error [NOT_SUPPORTED] This test is not supported on this target |
elessair | 0:f269e3021894 | 26 | |
elessair | 0:f269e3021894 | 27 | #endif |
elessair | 0:f269e3021894 | 28 | |
elessair | 0:f269e3021894 | 29 | int i; |
elessair | 0:f269e3021894 | 30 | |
elessair | 0:f269e3021894 | 31 | int main() |
elessair | 0:f269e3021894 | 32 | { |
elessair | 0:f269e3021894 | 33 | notify_start(); |
elessair | 0:f269e3021894 | 34 | |
elessair | 0:f269e3021894 | 35 | for (i=0; i<=65535; i++) { |
elessair | 0:f269e3021894 | 36 | bus1 = i; |
elessair | 0:f269e3021894 | 37 | bus2 = i; |
elessair | 0:f269e3021894 | 38 | wait(0.0001); |
elessair | 0:f269e3021894 | 39 | } |
elessair | 0:f269e3021894 | 40 | |
elessair | 0:f269e3021894 | 41 | notify_completion(true); |
elessair | 0:f269e3021894 | 42 | } |