Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 FH Dortmund and others |
| 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
| 7 | * |
| 8 | * Description: |
| 9 | * Interface file for shared resources |
| 10 | * |
| 11 | * Authors: |
| 12 | * M. Ozcelikors, R.Hottger |
| 13 | * <mozcelikors@gmail.com> <robert.hoettger@fh-dortmund.de> |
| 14 | * |
| 15 | * Contributors: |
| 16 | * |
| 17 | * Update History: |
| 18 | * 02.02.2017 - first compilation |
| 19 | * 15.03.2017 - updated tasks for web-based driving |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef INTERFACES_H_ |
| 24 | #define INTERFACES_H_ |
| 25 | |
| 26 | #include <stdio.h> |
| 27 | |
Mustafa Ozcelikors | c46687e | 2017-06-12 15:24:11 +0200 | [diff] [blame] | 28 | //Driving modes |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 29 | #define MANUAL 0 |
| 30 | #define ACC 1 |
Mustafa Ozcelikors | c46687e | 2017-06-12 15:24:11 +0200 | [diff] [blame] | 31 | #define PARKING_LEFT 2 |
| 32 | #define PARKING_RIGHT 3 |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 33 | |
| 34 | typedef struct { |
| 35 | char * task_id; |
| 36 | int deadline_miss_percentage; |
| 37 | double start_time; |
| 38 | double end_time; |
| 39 | double deadline; |
| 40 | double period; |
| 41 | double execution_time; |
| 42 | double prev_slack_time; |
| 43 | } timing_interface; |
| 44 | |
Mustafa Ozcelikors | 4012dfb | 2017-07-13 14:28:35 +0200 | [diff] [blame] | 45 | extern timing_interface compass_task_ti; |
| 46 | extern pthread_mutex_t compass_task_ti_l; |
| 47 | |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 48 | extern timing_interface temperature_task_ti; |
| 49 | extern pthread_mutex_t temperature_task_ti_l; |
| 50 | |
| 51 | extern timing_interface display_sensors_task_ti; |
| 52 | extern pthread_mutex_t display_sensors_task_ti_l; |
| 53 | |
| 54 | extern timing_interface infrared_distance_task_ti; |
| 55 | extern pthread_mutex_t infrared_distance_task_ti_l; |
| 56 | |
| 57 | extern timing_interface keycommand_task_ti; |
| 58 | extern pthread_mutex_t keycommand_task_ti_l; |
| 59 | |
| 60 | extern timing_interface motordriver_task_ti; |
| 61 | extern pthread_mutex_t motordriver_task_ti_l; |
| 62 | |
Maximilian Peters | 1089e67 | 2017-05-08 13:04:36 +0200 | [diff] [blame] | 63 | extern timing_interface ultrasonic_grove_task_ti; |
| 64 | extern pthread_mutex_t ultrasonic_grove_task_ti_l; |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 65 | |
Maximilian Peters | 1089e67 | 2017-05-08 13:04:36 +0200 | [diff] [blame] | 66 | extern timing_interface ultrasonic_sr04_back_task_ti; |
| 67 | extern pthread_mutex_t ultrasonic_sr04_back_task_ti_l; |
| 68 | |
| 69 | extern timing_interface ultrasonic_sr04_front_task_ti; |
| 70 | extern pthread_mutex_t ultrasonic_sr04_front_task_ti_l; |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 71 | |
| 72 | extern timing_interface webserver_motordrive_task_ti; |
| 73 | extern pthread_mutex_t webserver_motordrive_task_ti_l; |
| 74 | |
| 75 | extern timing_interface compass_sensor_task_ti; |
| 76 | extern pthread_mutex_t compass_sensor_task_ti_l; |
| 77 | |
| 78 | extern timing_interface acc_task_ti; |
| 79 | extern pthread_mutex_t acc_task_ti_l; |
| 80 | |
| 81 | extern timing_interface record_timing_task_ti; |
| 82 | |
Mustafa Ozcelikors | f5f0e38 | 2017-06-02 18:02:37 +0200 | [diff] [blame] | 83 | extern timing_interface record_sensor_data_task_ti; |
| 84 | extern pthread_mutex_t record_sensor_data_task_ti_l; |
| 85 | |
Mustafa Ozcelikors | 60ba211 | 2017-06-06 14:41:41 +0200 | [diff] [blame] | 86 | extern timing_interface parking_task_ti; |
| 87 | extern pthread_mutex_t parking_task_ti_l; |
| 88 | |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 89 | //--- |
| 90 | |
| 91 | extern float temperature_shared; |
| 92 | extern pthread_mutex_t temperature_lock; |
| 93 | |
| 94 | extern float humidity_shared; |
| 95 | extern pthread_mutex_t humidity_lock; |
| 96 | |
Maximilian Peters | 1089e67 | 2017-05-08 13:04:36 +0200 | [diff] [blame] | 97 | extern int distance_grove_shared; |
| 98 | extern pthread_mutex_t distance_grove_lock; |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 99 | |
| 100 | extern char keycommand_shared; |
| 101 | extern pthread_mutex_t keycommand_lock; |
| 102 | |
Maximilian Peters | 7d3d5d8 | 2017-05-08 16:15:08 +0200 | [diff] [blame] | 103 | extern float infrared_shared[4]; |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 104 | extern pthread_mutex_t infrared_lock; |
| 105 | |
| 106 | extern float bearing_shared; |
| 107 | extern pthread_mutex_t compass_lock; |
| 108 | |
Maximilian Peters | 1089e67 | 2017-05-08 13:04:36 +0200 | [diff] [blame] | 109 | extern int distance_sr04_back_shared; |
| 110 | extern pthread_mutex_t distance_sr04_back_lock; |
| 111 | |
| 112 | extern int distance_sr04_front_shared; |
| 113 | extern pthread_mutex_t distance_sr04_front_lock; |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 114 | |
| 115 | extern int driving_mode; |
| 116 | extern pthread_mutex_t driving_mode_lock; |
| 117 | |
Mustafa Ozcelikors | 60ba211 | 2017-06-06 14:41:41 +0200 | [diff] [blame] | 118 | extern int speed_shared; |
| 119 | extern pthread_mutex_t speed_lock; |
| 120 | |
Robert Hoettger | f79f84d | 2017-04-26 13:43:07 +0200 | [diff] [blame] | 121 | |
| 122 | #endif /* INTERFACES_H_ */ |