IO is an event based input manager which permit to select which composents are manged on your system
Dependencies: C12832 FXOS8700Q LM75B MMA7660
IO.hpp@0:2ac59c564ab0, 2016-02-23 (annotated)
- Committer:
- co838_app56
- Date:
- Tue Feb 23 17:25:07 2016 +0000
- Revision:
- 0:2ac59c564ab0
- Child:
- 3:1ab88130bb9d
Managing k64f & app shield;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
co838_app56 | 0:2ac59c564ab0 | 1 | #pragma once |
co838_app56 | 0:2ac59c564ab0 | 2 | |
co838_app56 | 0:2ac59c564ab0 | 3 | // Including sensors and outputs |
co838_app56 | 0:2ac59c564ab0 | 4 | #include "Input.h" |
co838_app56 | 0:2ac59c564ab0 | 5 | #include "FrdmK64f_AppShield_Input.hpp" |
co838_app56 | 0:2ac59c564ab0 | 6 | #include "FrdmK64f_AppShield_Output.h" |
co838_app56 | 0:2ac59c564ab0 | 7 | #include "FrdmK64f_Input.hpp" |
co838_app56 | 0:2ac59c564ab0 | 8 | #include "FrdmK64f_Output.h" |
co838_app56 | 0:2ac59c564ab0 | 9 | |
co838_app56 | 0:2ac59c564ab0 | 10 | // Defining some types used to create an IO object |
co838_app56 | 0:2ac59c564ab0 | 11 | struct FrdmK64f |
co838_app56 | 0:2ac59c564ab0 | 12 | { |
co838_app56 | 0:2ac59c564ab0 | 13 | typedef FrdmK64f_Input< ::Input> Input; // If we want to use k64f only |
co838_app56 | 0:2ac59c564ab0 | 14 | struct Output { FrdmK64f_Output platform; }; // |
co838_app56 | 0:2ac59c564ab0 | 15 | |
co838_app56 | 0:2ac59c564ab0 | 16 | struct AppShield |
co838_app56 | 0:2ac59c564ab0 | 17 | { |
co838_app56 | 0:2ac59c564ab0 | 18 | typedef FrdmK64f_AppShield_Input<FrdmK64f::Input> Input; // If we want to use k64f |
co838_app56 | 0:2ac59c564ab0 | 19 | struct Output { FrdmK64f_Output platform; FrdmK64f_AppShield_Output board; }; // with application shield |
co838_app56 | 0:2ac59c564ab0 | 20 | }; |
co838_app56 | 0:2ac59c564ab0 | 21 | }; |
co838_app56 | 0:2ac59c564ab0 | 22 | |
co838_app56 | 0:2ac59c564ab0 | 23 | struct AppShield |
co838_app56 | 0:2ac59c564ab0 | 24 | { |
co838_app56 | 0:2ac59c564ab0 | 25 | typedef FrdmK64f_AppShield_Input< ::Input> Input; // If we want to use |
co838_app56 | 0:2ac59c564ab0 | 26 | struct Output { FrdmK64f_AppShield_Output board; }; // application shield only |
co838_app56 | 0:2ac59c564ab0 | 27 | }; |
co838_app56 | 0:2ac59c564ab0 | 28 | |
co838_app56 | 0:2ac59c564ab0 | 29 | /* |
co838_app56 | 0:2ac59c564ab0 | 30 | ** IO Object |
co838_app56 | 0:2ac59c564ab0 | 31 | ** |
co838_app56 | 0:2ac59c564ab0 | 32 | ** Used to interact with the device |
co838_app56 | 0:2ac59c564ab0 | 33 | ** input is an event manager |
co838_app56 | 0:2ac59c564ab0 | 34 | ** output list les ouputs |
co838_app56 | 0:2ac59c564ab0 | 35 | */ |
co838_app56 | 0:2ac59c564ab0 | 36 | template <typename Platform> struct IO |
co838_app56 | 0:2ac59c564ab0 | 37 | { |
co838_app56 | 0:2ac59c564ab0 | 38 | static typename Platform::Input input; |
co838_app56 | 0:2ac59c564ab0 | 39 | static typename Platform::Output output; |
co838_app56 | 0:2ac59c564ab0 | 40 | }; |
co838_app56 | 0:2ac59c564ab0 | 41 | |
co838_app56 | 0:2ac59c564ab0 | 42 | template <typename Platform> |
co838_app56 | 0:2ac59c564ab0 | 43 | typename Platform::Input IO<Platform>::input; |
co838_app56 | 0:2ac59c564ab0 | 44 | |
co838_app56 | 0:2ac59c564ab0 | 45 | template <typename Platform> |
co838_app56 | 0:2ac59c564ab0 | 46 | typename Platform::Output IO<Platform>::output; |