roverSTM
UM2 2013
Projet M1 Navarro Benjamin
Main Page
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Groups
Pages
src
tasks
tasks.h
1
/*
2
* tasks.h
3
*
4
* Created on: 9 fŽvr. 2013
5
* Author: Benjamin Navarro
6
*/
7
8
#ifndef TASKS_H_
9
#define TASKS_H_
10
11
#include "stm32f4xx.h"
12
#include "
stm32f4_discovery.h
"
13
14
#include "FreeRTOS.h"
15
#include "FreeRTOS_Hooks.h"
16
#include "task.h"
17
#include "queue.h"
18
#include "timers.h"
19
#include "semphr.h"
20
21
#include "nmea/nmea.h"
22
23
#include <stdio.h>
24
#include <string.h>
25
26
#include "MyLib.h"
27
#include "registers.h"
28
29
/*** Motors related stuff ***/
30
#define MAX_ANGLE 20.0
31
32
#define setMotorSpeed(dir, percent) TIM_SetCompare1(TIM3, dir ? 1500 + (uint16_t) percent*5 : 1500 - (uint16_t) percent*5);
33
#define setDirectionAngle(angle) TIM_SetCompare2(TIM3, 2000 - (uint16_t) (angle+20.0)*25);
34
35
#define ESCProgramming 0
36
37
typedef
enum
_dir {
38
backward = 0,
39
forward
40
} dir;
41
42
/*** Motors related stuff ***/
43
extern
xTaskHandle MotorHandle;
44
45
/*** GPS related stuff ***/
46
extern
xQueueHandle GPSQueue;
47
extern
nmeaINFO GPSInfo;
48
extern
nmeaPOS GPSPos;
49
50
#define NMEA_SENTENCE_LENGTH 100
51
#define GPS_QUEUE_SIZE 10
52
53
/*** SPI (RPi) related stuff ***/
54
#define READ_COMMAND 0x00
55
#define WRITE_COMMAND 0x80
56
57
/*** Global variables ***/
58
extern
uint16_t US_Distance;
59
extern
int16_t heading;
60
extern
registerOperations
regs;
61
62
/*** Tasks prototypes ***/
63
void
MotorTask (
void
* pvArg);
64
void
I2CTask (
void
* pvArg);
65
void
GPSTask (
void
* pvArg);
66
void
SPITask (
void
* pvArg);
67
68
#endif
/* TASKS_H_ */
Generated on Thu Mar 28 2013 11:31:09 for roverSTM by
1.8.3.1