mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 07:04:14 +03:00 
			
		
		
		
	Added interfaces:
iEC iEmg iClock iHeartRate iLineFinder iOrp Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
This commit is contained in:
		
							
								
								
									
										52
									
								
								include/interfaces/iClock.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								include/interfaces/iClock.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | ||||
| /* | ||||
|  * Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com> | ||||
|  * Copyright (c) 2018 Intel Corporation. | ||||
|  * | ||||
|  * 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. | ||||
|  */ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| namespace upm | ||||
| { | ||||
| /** | ||||
|  * @brief Interface for Real Time Clock (RTC) Modules | ||||
| */ | ||||
|   class iClock | ||||
|   { | ||||
|   public: | ||||
|     virtual ~iClock() {} | ||||
|  | ||||
|     /** | ||||
|      * Loads all the time values | ||||
|      * | ||||
|      * @return True if time data loaded successfully | ||||
|      */ | ||||
|     virtual bool loadTime() = 0; | ||||
|  | ||||
|     /** | ||||
|      * Sets the time. You should call loadTime() beforehand to | ||||
|      * maintain consistency | ||||
|      * | ||||
|      * @return True if time is set successfully | ||||
|      */ | ||||
|     virtual bool setTime() = 0; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										45
									
								
								include/interfaces/iEC.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								include/interfaces/iEC.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,45 @@ | ||||
| /* | ||||
|  * Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com> | ||||
|  * Copyright (c) 2018 Intel Corporation. | ||||
|  * | ||||
|  * 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. | ||||
|  */ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| namespace upm | ||||
| { | ||||
| /** | ||||
|  * @brief Interface for Electrical Conductivity (EC) Sensors | ||||
| */ | ||||
|   class iEC | ||||
|   { | ||||
|   public: | ||||
|     virtual ~iEC() {} | ||||
|  | ||||
|     /** | ||||
|      * Get computed EC (ms/cm) value from the sensor. | ||||
|      * | ||||
|      * @return EC value in ms/cm. | ||||
|      */ | ||||
|     virtual float getECValue() = 0; | ||||
|  | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										49
									
								
								include/interfaces/iEmg.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								include/interfaces/iEmg.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| /* | ||||
|  * Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com> | ||||
|  * Copyright (c) 2018 Intel Corporation. | ||||
|  * | ||||
|  * 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. | ||||
|  */ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| namespace upm | ||||
| { | ||||
| /** | ||||
|  * @brief Interface for Electromyography (EMG) Sensors | ||||
| */ | ||||
|   class iEmg | ||||
|   { | ||||
|   public: | ||||
|     virtual ~iEmg() {} | ||||
|  | ||||
|     /** | ||||
|      * Calibrates the EMG reader | ||||
|      */ | ||||
|     virtual void calibrate() = 0; | ||||
|  | ||||
|     /** | ||||
|      * Measures muscle signals from the reader | ||||
|      * | ||||
|      * @return Muscle output as analog voltage | ||||
|      */ | ||||
|     virtual int value() = 0; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										44
									
								
								include/interfaces/iHeartRate.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								include/interfaces/iHeartRate.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| /* | ||||
|  * Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com> | ||||
|  * Copyright (c) 2018 Intel Corporation. | ||||
|  * | ||||
|  * 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. | ||||
|  */ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| namespace upm | ||||
| { | ||||
| /** | ||||
|  * @brief Interface for Heart Rate sensors | ||||
| */ | ||||
|   class iHeartRate | ||||
|   { | ||||
|   public: | ||||
|     virtual ~iHeartRate() {} | ||||
|  | ||||
|     /** | ||||
|      * Retrieve the computed heart rate | ||||
|      * | ||||
|      * @return Computed heart rate | ||||
|      */ | ||||
|     virtual int getHeartRate() = 0; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										51
									
								
								include/interfaces/iLineFinder.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								include/interfaces/iLineFinder.hpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | ||||
| /* | ||||
|  * Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com> | ||||
|  * Copyright (c) 2018 Intel Corporation. | ||||
|  * | ||||
|  * 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. | ||||
|  */ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| namespace upm | ||||
| { | ||||
| /** | ||||
|  * @brief Interface for Line Finder Modules | ||||
| */ | ||||
|   class iLineFinder | ||||
|   { | ||||
|   public: | ||||
|     virtual ~iLineFinder() {} | ||||
|  | ||||
|     /** | ||||
|      * Determines whether white has been detected | ||||
|      * | ||||
|      * @return True if white is detected | ||||
|      */ | ||||
|     virtual bool whiteDetected() = 0; | ||||
|     /** | ||||
|      * Determines whether black has been detected | ||||
|      * | ||||
|      * @return True if black is detected | ||||
|      */ | ||||
|     virtual bool blackDetected() = 0; | ||||
|  | ||||
|   }; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Stefan Andritoiu
					Stefan Andritoiu