blob: a7644630d49ccd811f163ad8fddf23905cd7f17a [file] [log] [blame]
Mustafa Ozcelikors2b0378f2017-06-13 14:25:43 +02001/*
2 * Copyright (c) 2017 FH Dortmund.
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 * A4MCAR Project - Low-level Module Main Processing Task that processes driving commands over Bluetooth (UART) and Ethernet interface - Header file
10 *
11 * Authors:
12 * M. Ozcelikors <mozcelikors@gmail.com>
13 *
14 * Update History:
15 *
16 */
17
18#ifndef RN42_DRIVER_H_
19#define RN42_DRIVER_H_
20
21#include "defines.h"
22
23// Command line buffer size
24#define COMMANDLINE_BUFSIZE 8
25
26// Update rate for the main processing task (Task_GetRemoteCommandsViaBluetooth)
27#define RCCAR_STATUS_UPDATE_RATE (50 * MILLISECOND)
28
29// UART Related Defines
30#define BAUD_RATE 115200
31#define RX_BUFFER_SIZE 512
32
33//Configure RN42 for the first time?
34//#define RN42_INITIAL_CONFIG
35
36// Prototypes
37[[combinable]]
38void Task_MainProcessingAndBluetoothControl(client uart_tx_if uart_tx,
39 client uart_rx_if uart_rx,
40 client control_if control_interface,
41 client steering_if steering_interface,
42 server ethernet_to_cmdparser_if cmd_from_ethernet_to_override,
43 client lightstate_if lightstate_interface);
44
45void WriteData (client uart_tx_if uart_tx, char data[]);
46void InitializeRN42asSlave(client uart_tx_if uart_tx);
47int isDigit (char digit);
48int CharToDigit (char digit);
49{int, int, int} ParseRCCommandString (char data[]);
50int CheckIfCommandFormatIsValid (char* command);
51short int GetLightStateFromCommands (int speed, int steering, int direction);
52
53
54#endif /* RN42_DRIVER_H_ */