basic drive module and shell interface
This commit is contained in:
19
source/application/include/drive_ctrl.h
Normal file
19
source/application/include/drive_ctrl.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* drive_ctrl.h
|
||||
*
|
||||
* Created on: Aug 10, 2016
|
||||
* Author: tkl
|
||||
*/
|
||||
|
||||
#ifndef SOURCE_APPLICATION_INCLUDE_DRIVE_CTRL_H_
|
||||
#define SOURCE_APPLICATION_INCLUDE_DRIVE_CTRL_H_
|
||||
|
||||
int drive_ctrl_init(void);
|
||||
|
||||
int drive_ctrl_set_speed_left(int speed_percent);
|
||||
int drive_ctrl_set_speed_right(int speed_percent);
|
||||
int drive_ctrl_set_speed_value(int speed_percent);
|
||||
int drive_ctrl_get_speed_value(void);
|
||||
|
||||
|
||||
#endif /* SOURCE_APPLICATION_INCLUDE_DRIVE_CTRL_H_ */
|
39
source/application/include/engines.h
Normal file
39
source/application/include/engines.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* engines.h
|
||||
*
|
||||
* Created on: Aug 10, 2016
|
||||
* Author: tkl
|
||||
*/
|
||||
|
||||
#ifndef SOURCE_APPLICATION_INCLUDE_ENGINES_H_
|
||||
#define SOURCE_APPLICATION_INCLUDE_ENGINES_H_
|
||||
|
||||
struct engine_ctrl {
|
||||
const struct driver *pwm;
|
||||
const struct driver *enable;
|
||||
};
|
||||
|
||||
static struct engine_ctrl right_forward = {
|
||||
.pwm = &pwm_1,
|
||||
.enable = &gpio_c1,
|
||||
};
|
||||
|
||||
static struct engine_ctrl right_backward = {
|
||||
.pwm = &pwm_2,
|
||||
.enable = &gpio_c0,
|
||||
};
|
||||
|
||||
static struct engine_ctrl left_forward = {
|
||||
.pwm = &pwm_3,
|
||||
.enable = &gpio_c3,
|
||||
};
|
||||
|
||||
static struct engine_ctrl left_backward = {
|
||||
.pwm = &pwm_4,
|
||||
.enable = &gpio_c2,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* SOURCE_APPLICATION_INCLUDE_ENGINES_H_ */
|
13
source/application/include/shell_commands.h
Normal file
13
source/application/include/shell_commands.h
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* shell_commands.h
|
||||
*
|
||||
* Created on: Aug 10, 2016
|
||||
* Author: tkl
|
||||
*/
|
||||
|
||||
#ifndef SOURCE_APPLICATION_SHELL_COMMANDS_H_
|
||||
#define SOURCE_APPLICATION_SHELL_COMMANDS_H_
|
||||
|
||||
int shell_commands_init(void);
|
||||
|
||||
#endif /* SOURCE_APPLICATION_SHELL_COMMANDS_H_ */
|
Reference in New Issue
Block a user