![]() |
BLDC control on ATAVRMC303 with ATxMega128A1
|

Go to the source code of this file.
Macros | |
| #define | ABORT_CHAR CTRL_C |
| #define | BKSPACE_CHAR 0x08 |
| #define | CMD_BACKWARD 0x05 |
| #define | CMD_FORWARD 0x04 |
| #define | CMD_GET_ID 0x07 |
| #define | CMD_GET_STATUS0 0x08 |
| #define | CMD_GET_STATUS1 0x09 |
| #define | CMD_HELP 0x01 |
| #define | CMD_NONE 0x00 |
| #define | CMD_RUN 0x02 |
| #define | CMD_SET_SPEED 0x06 |
| #define | CMD_STOP 0x03 |
| #define | CR 0x0D |
| #define | CTRL_C 0x03 |
| #define | CTRL_Q 0x11 |
| #define | LF 0x0A |
| #define | MSG_ER_CMD_NOT_FOUND "Unknown Command" |
| #define | MSG_HELP "\r\ru : run\r\st : stop\r\fw : forward\r\bw : backward\r\ss : set speed\r\gi : get id\" |
| #define | MSG_PROMPT "\r>" |
| #define | MSG_WELCOME "\rATMEL Motor Control Interface" |
| #define | QUIT_APPEND CTRL_Q |
| #define | STR_BACKWARD "bw" |
| #define | STR_FORWARD "fw" |
| #define | STR_GET_ID "gi" |
| #define | STR_GET_STATUS0 "g0" |
| #define | STR_GET_STATUS1 "g1" |
| #define | STR_HELP "help" |
| #define | STR_RUN "ru" |
| #define | STR_SET_SPEED "ss" |
| #define | STR_STOP "st" |
Functions | |
| void | build_cmd (void) |
| get the full command line to be interpreted. More... | |
| U8 | mystrncmp (U8 *str1, U8 code *str2, U8 i) |
| compares two strings located in flash code area. More... | |
| void | parse_cmd (void) |
| decodes full command line into command type and arguments More... | |
| void | print_msg (U8 code *str) |
| Display an ASCII code string. More... | |
| void | ushell_task (void) |
| Entry point of the explorer task management. More... | |
| void | ushell_task_init (void) |
| This function initializes the hardware/software ressources required for ushell task. More... | |
Variables | |
| volatile Bool | ushell_active |
| #define ABORT_CHAR CTRL_C |
Definition at line 40 of file ushell_task.h.
Referenced by build_cmd().
| #define BKSPACE_CHAR 0x08 |
Definition at line 39 of file ushell_task.h.
Referenced by build_cmd().
| #define CMD_BACKWARD 0x05 |
Definition at line 27 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_FORWARD 0x04 |
Definition at line 26 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_GET_ID 0x07 |
Definition at line 29 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_GET_STATUS0 0x08 |
Definition at line 30 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_GET_STATUS1 0x09 |
Definition at line 31 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_HELP 0x01 |
Definition at line 23 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_NONE 0x00 |
Definition at line 22 of file ushell_task.h.
Referenced by ushell_task(), and ushell_task_init().
| #define CMD_RUN 0x02 |
Definition at line 24 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_SET_SPEED 0x06 |
Definition at line 28 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CMD_STOP 0x03 |
Definition at line 25 of file ushell_task.h.
Referenced by parse_cmd(), and ushell_task().
| #define CR 0x0D |
Definition at line 35 of file ushell_task.h.
Referenced by build_cmd().
| #define CTRL_C 0x03 |
Definition at line 38 of file ushell_task.h.
| #define CTRL_Q 0x11 |
Definition at line 37 of file ushell_task.h.
| #define LF 0x0A |
Definition at line 36 of file ushell_task.h.
| #define MSG_ER_CMD_NOT_FOUND "Unknown Command" |
Definition at line 57 of file ushell_task.h.
| #define MSG_HELP "\r\ru : run\r\st : stop\r\fw : forward\r\bw : backward\r\ss : set speed\r\gi : get id\" |
Definition at line 58 of file ushell_task.h.
| #define MSG_PROMPT "\r>" |
Definition at line 55 of file ushell_task.h.
| #define MSG_WELCOME "\rATMEL Motor Control Interface" |
Definition at line 56 of file ushell_task.h.
| #define QUIT_APPEND CTRL_Q |
Definition at line 41 of file ushell_task.h.
| #define STR_BACKWARD "bw" |
Definition at line 48 of file ushell_task.h.
| #define STR_FORWARD "fw" |
Definition at line 47 of file ushell_task.h.
| #define STR_GET_ID "gi" |
Definition at line 50 of file ushell_task.h.
| #define STR_GET_STATUS0 "g0" |
Definition at line 51 of file ushell_task.h.
| #define STR_GET_STATUS1 "g1" |
Definition at line 52 of file ushell_task.h.
| #define STR_HELP "help" |
Definition at line 46 of file ushell_task.h.
| #define STR_RUN "ru" |
Definition at line 44 of file ushell_task.h.
| #define STR_SET_SPEED "ss" |
Definition at line 49 of file ushell_task.h.
| #define STR_STOP "st" |
Definition at line 45 of file ushell_task.h.
| void build_cmd | ( | void | ) |
get the full command line to be interpreted.
| none |
Definition at line 161 of file ushell_task.c.
References ABORT_CHAR, BKSPACE_CHAR, cmd_str, CR, i_str, parse_cmd(), and uart_putchar.
Referenced by ushell_task().

| U8 mystrncmp | ( | U8 * | str1, |
| U8 code * | str2, | ||
| U8 | i | ||
| ) |
compares two strings located in flash code area.
| *str1 | |
| *str2 |
Definition at line 285 of file ushell_task.c.
Referenced by parse_cmd().
| void parse_cmd | ( | void | ) |
decodes full command line into command type and arguments
This function allows to set the cmd_type to the command type decoded with its respective arguments par_str1 and par_str2
| none |
Definition at line 209 of file ushell_task.c.
References cmd, CMD_BACKWARD, CMD_FORWARD, CMD_GET_ID, CMD_GET_STATUS0, CMD_GET_STATUS1, CMD_HELP, CMD_RUN, CMD_SET_SPEED, CMD_STOP, cmd_str, cmd_type, i_str, msg_er_cmd_not_found, msg_prompt, mystrncmp(), par_str1, par_str2, print_msg(), str_backward, str_forward, str_get_id, str_get_status0, str_get_status1, str_help, str_run, str_set_speed, and str_stop.
Referenced by build_cmd().

| void print_msg | ( | U8 code * | str | ) |
Display an ASCII code string.
| *str | pointer to string located in flash area |
Definition at line 310 of file ushell_task.c.
References uart_putchar.
Referenced by parse_cmd(), ushell_task(), and ushell_task_init().
| void ushell_task | ( | void | ) |
Entry point of the explorer task management.
This function links perform ushell task decoding to access file system functions.
| none |
Definition at line 93 of file ushell_task.c.
References BOARD_ID, build_cmd(), CCW, cmd, CMD_BACKWARD, CMD_FORWARD, CMD_GET_ID, CMD_GET_STATUS0, CMD_GET_STATUS1, CMD_HELP, CMD_NONE, CMD_RUN, CMD_SET_SPEED, CMD_STOP, cmd_type, convert_param1(), mci_backward(), mci_direction, mci_forward(), mci_get_measured_current(), mci_get_measured_speed(), mci_run(), mci_run_stop, mci_set_speed(), mci_stop(), msg_er_cmd_not_found, msg_help, msg_prompt, param1, print_hex16(), print_msg(), REV_ID, SOFT_ID, uart_putchar, and ushell_active.
Referenced by main().

| void ushell_task_init | ( | void | ) |
This function initializes the hardware/software ressources required for ushell task.
| none |
/
Definition at line 66 of file ushell_task.c.
References cmd, CMD_NONE, cmd_type, msg_prompt, msg_welcome, print_msg(), and uart_putchar.
Referenced by main().

| volatile Bool ushell_active |
Definition at line 39 of file ushell_task.c.
Referenced by main(), and ushell_task().