![]()  | 
  
Status display for VT100 console. More...
#include <string.h>#include <stdarg.h>#include "ch.h"#include "hal.h"#include "chprintf.h"#include "vex.h"#include "smartmotor.h"#include "apollo.h"Macros | |
| #define | vt100_putchar(c) apolloPut((uint8_t)c); | 
| Macro so we can use alternatives to apolloPut for testing.  More... | |
vt100 shortcut macros  | |
| #define | vt100_tl_corner() vt100_putchar('l') | 
| #define | vt100_tr_corner() vt100_putchar('k') | 
| #define | vt100_bl_corner() vt100_putchar('m') | 
| #define | vt100_br_corner() vt100_putchar('j') | 
| #define | vt100_hline() vt100_putchar('q') | 
| #define | vt100_vline() vt100_putchar('x') | 
| #define | vt100_tt() vt100_putchar('w') | 
| #define | vt100_bt() vt100_putchar('v') | 
| #define | vt100_lt() vt100_putchar('t') | 
| #define | vt100_rt() vt100_putchar('u') | 
Functions | |
| void | vt100_drawbox (int col, int row, int width, int height) | 
| Draw a box on the vt100 console.  More... | |
| void | apolloScreenSetup () | 
| Draw static lines for the display.  More... | |
| void | apolloMotorSetup () | 
| Setup motor section of the display.  More... | |
| void | apolloDigitalSetup () | 
| Setup digital port status section of the display.  More... | |
| void | apolloAnalogSetup () | 
| Setup analog port status section of the display.  More... | |
| void | apolloJoystickSetup (int joystick) | 
| Setup joystick status section of the display.  More... | |
| void | apolloUpdateMotor (int m) | 
| Update motor status.  More... | |
| void | apolloUpdateCortex (int p) | 
| Update cortex current and temperature status.  More... | |
| void | apolloUpdateDigital (int pin) | 
| Update digital port status.  More... | |
| void | apolloUpdateAnalog (int pin) | 
| Update analog port status.  More... | |
| void | apolloUpdateSystem () | 
| Update system status.  More... | |
| void | apolloUpdateJoystickButton (int joystick, int row, int up, int down, int left, int right) | 
| Update joystick button status.  More... | |
| void | apolloUpdateJoystickAnalog (int joystick, int row, int h, int v) | 
| Update joystick analog status.  More... | |
| void | apolloInit () | 
| Apollo initialization.  More... | |
| void | apolloDeinit () | 
| Apollo de-init. Cleans up screen when done.  More... | |
| void | apolloUpdate () | 
| Apollo update - update all status.  More... | |
Status display for VT100 console.
call apolloInit to start display call apolloUpdate in a loop until done call apolloDeinit to clear display before returning to normal cmd line
| #define vt100_putchar | ( | c) | apolloPut((uint8_t)c); | 
Macro so we can use alternatives to apolloPut for testing.
| #define vt100_tl_corner | ( | ) | vt100_putchar('l') | 
| #define vt100_tr_corner | ( | ) | vt100_putchar('k') | 
| #define vt100_bl_corner | ( | ) | vt100_putchar('m') | 
| #define vt100_br_corner | ( | ) | vt100_putchar('j') | 
| #define vt100_hline | ( | ) | vt100_putchar('q') | 
| #define vt100_vline | ( | ) | vt100_putchar('x') | 
| #define vt100_tt | ( | ) | vt100_putchar('w') | 
| #define vt100_bt | ( | ) | vt100_putchar('v') | 
| #define vt100_lt | ( | ) | vt100_putchar('t') | 
| #define vt100_rt | ( | ) | vt100_putchar('u') | 
| void vt100_drawbox | ( | int | col, | 
| int | row, | ||
| int | width, | ||
| int | height | ||
| ) | 
Draw a box on the vt100 console.
| [in] | col | Starting column | 
| [in] | row | Starting row | 
| [in] | width | The box width | 
| [in] | height | The box height | 
| void apolloScreenSetup | ( | void | ) | 
Draw static lines for the display.
| void apolloMotorSetup | ( | void | ) | 
Setup motor section of the display.
| void apolloDigitalSetup | ( | void | ) | 
Setup digital port status section of the display.
| void apolloAnalogSetup | ( | void | ) | 
Setup analog port status section of the display.
| void apolloJoystickSetup | ( | int | joystick) | 
Setup joystick status section of the display.
| void apolloUpdateMotor | ( | int | m) | 
Update motor status.
| [in] | m | The smart motor port number (0 - 9) | 
| void apolloUpdateCortex | ( | int | p) | 
Update cortex current and temperature status.
| [in] | p | The smart motor port number (0 or 1) | 
| void apolloUpdateDigital | ( | int | pin) | 
Update digital port status.
| [in] | pin | The digital port number | 
| void apolloUpdateAnalog | ( | int | pin) | 
Update analog port status.
| [in] | pin | The analog port number | 
| void apolloUpdateSystem | ( | void | ) | 
Update system status.
| void apolloUpdateJoystickButton | ( | int | joystick, | 
| int | row, | ||
| int | up, | ||
| int | down, | ||
| int | left, | ||
| int | right | ||
| ) | 
Update joystick button status.
| [in] | joystick | Which joystick, 0 for main, 1 for partner | 
| [in] | row | The row for the data (0 - 4) | 
| [in] | up | Up button status | 
| [in] | down | Up down status | 
| [in] | left | Up left status | 
| [in] | right | Up right status | 
| void apolloUpdateJoystickAnalog | ( | int | joystick, | 
| int | row, | ||
| int | h, | ||
| int | v | ||
| ) | 
Update joystick analog status.
| [in] | joystick | Which joystick, 0 for main, 1 for partner | 
| [in] | row | The row for the data (0, 1 or 2) | 
| [in] | h | the horizontal joystick data | 
| [in] | v | the vertical joystick data | 
| void apolloInit | ( | void | ) | 
Apollo initialization.
| void apolloDeinit | ( | void | ) | 
Apollo de-init. Cleans up screen when done.
| void apolloUpdate | ( | void | ) | 
Apollo update - update all status.