Code for system console. More...
Files | |
file | console.c |
Implementation of a minimal console. | |
file | console.h |
Definition of functions and types for a minimal console. | |
Macros | |
#define | DEVICE_LENGTH 5 |
#define | PROMPT_LENGTH 11 |
Enumerations | |
enum | command { cmd_help, cmd_help_led, cmd_led_pin, cmd_led_on, cmd_led_off, cmd_led_irq_on, cmd_led_irq_off, cmd_led_on_ms, cmd_led_blink_times, cmd_led_blink_sos, cmd_create_procs, cmd_run_procs, cmd_kill_procs, cmd_halt } |
Functions | |
char * | console_init (char *device) |
int | console_get_cmd (char *input) |
void | console (char *device) |
void | console_help () |
void | console_help_led () |
Variables | |
uint8_t | led_pin_num |
Code for system console.
#define DEVICE_LENGTH 5 |
Length of device name, based on running device.
#define PROMPT_LENGTH 11 |
Length of total prompt string for the console.
enum command |
Available commands for the console.
void console | ( | char * | device | ) |
Main console function.
device | A string pointer for the name of the device. |
Executes the commands from console input in an endless loop.
int console_get_cmd | ( | char * | input | ) |
void console_help | ( | ) |
Help command
Prints available commands to the console.
void console_help_led | ( | ) |
Help LED command
Prints available LED commands to the console.
char* console_init | ( | char * | device | ) |
Creates the prompt for the minimal console, based on the device.
device | A string pointer for the name of the device. |
uint8_t led_pin_num |
Definition of GPIO pin of LED, in order to be accessible from other translation units.
For example, in order to manipulate the LED with timer interrupts it is used by the handle_timer_1_irq() handler.