blob: 1f87a4978f22782bf31616b4064aad4e6b318c42 [file] [log] [blame]
Robert Hoettgerf79f84d2017-04-26 13:43:07 +02001/*
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 Ozcelikorsc46687e2017-06-12 15:24:11 +020028//Driving modes
Robert Hoettgerf79f84d2017-04-26 13:43:07 +020029#define MANUAL 0
30#define ACC 1
Mustafa Ozcelikorsc46687e2017-06-12 15:24:11 +020031#define PARKING_LEFT 2
32#define PARKING_RIGHT 3
Robert Hoettgerf79f84d2017-04-26 13:43:07 +020033
34typedef 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 Ozcelikors4012dfb2017-07-13 14:28:35 +020045extern timing_interface compass_task_ti;
46extern pthread_mutex_t compass_task_ti_l;
47
Robert Hoettgerf79f84d2017-04-26 13:43:07 +020048extern timing_interface temperature_task_ti;
49extern pthread_mutex_t temperature_task_ti_l;
50
51extern timing_interface display_sensors_task_ti;
52extern pthread_mutex_t display_sensors_task_ti_l;
53
54extern timing_interface infrared_distance_task_ti;
55extern pthread_mutex_t infrared_distance_task_ti_l;
56
57extern timing_interface keycommand_task_ti;
58extern pthread_mutex_t keycommand_task_ti_l;
59
60extern timing_interface motordriver_task_ti;
61extern pthread_mutex_t motordriver_task_ti_l;
62
Maximilian Peters1089e672017-05-08 13:04:36 +020063extern timing_interface ultrasonic_grove_task_ti;
64extern pthread_mutex_t ultrasonic_grove_task_ti_l;
Robert Hoettgerf79f84d2017-04-26 13:43:07 +020065
Maximilian Peters1089e672017-05-08 13:04:36 +020066extern timing_interface ultrasonic_sr04_back_task_ti;
67extern pthread_mutex_t ultrasonic_sr04_back_task_ti_l;
68
69extern timing_interface ultrasonic_sr04_front_task_ti;
70extern pthread_mutex_t ultrasonic_sr04_front_task_ti_l;
Robert Hoettgerf79f84d2017-04-26 13:43:07 +020071
72extern timing_interface webserver_motordrive_task_ti;
73extern pthread_mutex_t webserver_motordrive_task_ti_l;
74
75extern timing_interface compass_sensor_task_ti;
76extern pthread_mutex_t compass_sensor_task_ti_l;
77
78extern timing_interface acc_task_ti;
79extern pthread_mutex_t acc_task_ti_l;
80
81extern timing_interface record_timing_task_ti;
82
Mustafa Ozcelikorsf5f0e382017-06-02 18:02:37 +020083extern timing_interface record_sensor_data_task_ti;
84extern pthread_mutex_t record_sensor_data_task_ti_l;
85
Mustafa Ozcelikors60ba2112017-06-06 14:41:41 +020086extern timing_interface parking_task_ti;
87extern pthread_mutex_t parking_task_ti_l;
88
Robert Hoettgerf79f84d2017-04-26 13:43:07 +020089//---
90
91extern float temperature_shared;
92extern pthread_mutex_t temperature_lock;
93
94extern float humidity_shared;
95extern pthread_mutex_t humidity_lock;
96
Maximilian Peters1089e672017-05-08 13:04:36 +020097extern int distance_grove_shared;
98extern pthread_mutex_t distance_grove_lock;
Robert Hoettgerf79f84d2017-04-26 13:43:07 +020099
100extern char keycommand_shared;
101extern pthread_mutex_t keycommand_lock;
102
Maximilian Peters7d3d5d82017-05-08 16:15:08 +0200103extern float infrared_shared[4];
Robert Hoettgerf79f84d2017-04-26 13:43:07 +0200104extern pthread_mutex_t infrared_lock;
105
106extern float bearing_shared;
107extern pthread_mutex_t compass_lock;
108
Maximilian Peters1089e672017-05-08 13:04:36 +0200109extern int distance_sr04_back_shared;
110extern pthread_mutex_t distance_sr04_back_lock;
111
112extern int distance_sr04_front_shared;
113extern pthread_mutex_t distance_sr04_front_lock;
Robert Hoettgerf79f84d2017-04-26 13:43:07 +0200114
115extern int driving_mode;
116extern pthread_mutex_t driving_mode_lock;
117
Mustafa Ozcelikors60ba2112017-06-06 14:41:41 +0200118extern int speed_shared;
119extern pthread_mutex_t speed_lock;
120
Robert Hoettgerf79f84d2017-04-26 13:43:07 +0200121
122#endif /* INTERFACES_H_ */