Gas Pressure Display Updated Power control for Pressure sensor added

Dependencies:   UniGraphic mbed vt100

Committer:
Rhyme
Date:
Fri Feb 16 08:27:50 2018 +0000
Revision:
0:37c8ecde13c2
control PSE530 power via PTC5 (pse530_en)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:37c8ecde13c2 1 #include "mbed.h"
Rhyme 0:37c8ecde13c2 2 #include "edge_mgr.h"
Rhyme 0:37c8ecde13c2 3 #include "edge_reset_mgr.h"
Rhyme 0:37c8ecde13c2 4 #include "edge_chart.h"
Rhyme 0:37c8ecde13c2 5 #if 0
Rhyme 0:37c8ecde13c2 6 typedef struct _edge_chart_st {
Rhyme 0:37c8ecde13c2 7 char *name ;
Rhyme 0:37c8ecde13c2 8 int left ;
Rhyme 0:37c8ecde13c2 9 int top ;
Rhyme 0:37c8ecde13c2 10 int width ;
Rhyme 0:37c8ecde13c2 11 int height ;
Rhyme 0:37c8ecde13c2 12 int index ;
Rhyme 0:37c8ecde13c2 13 int min ;
Rhyme 0:37c8ecde13c2 14 int max ;
Rhyme 0:37c8ecde13c2 15 } edge_chart_type ;
Rhyme 0:37c8ecde13c2 16
Rhyme 0:37c8ecde13c2 17 extern edge_chart_type edge_chart[] ;
Rhyme 0:37c8ecde13c2 18 #endif
Rhyme 0:37c8ecde13c2 19
Rhyme 0:37c8ecde13c2 20 edge_chart_type edge_chart[] = {
Rhyme 0:37c8ecde13c2 21 /* name, left, top, width, height, index, min, max */
Rhyme 0:37c8ecde13c2 22 { "Accel", 0, 0, 160, 60, 0, -0.2, 0.2 },
Rhyme 0:37c8ecde13c2 23 { "Color", 0, 120, 160, 120, 0, 0.0, 10000.0 },
Rhyme 0:37c8ecde13c2 24 { "Color2", 160, 120, 160, 120, 0, 0.0, 10000.0 },
Rhyme 0:37c8ecde13c2 25 { "Temp", 160, 0, 160, 120, 0, -10.0, 50.0 },
Rhyme 0:37c8ecde13c2 26 { "Press", 0, 60, 160, 60, 0, -1.0, 5.0 },
Rhyme 0:37c8ecde13c2 27 { 0, 0, 0, 0, 0, 0, 0.0, 0.0 }
Rhyme 0:37c8ecde13c2 28 } ;
Rhyme 0:37c8ecde13c2 29
Rhyme 0:37c8ecde13c2 30 void draw_chart_frame(edge_chart_type *p)
Rhyme 0:37c8ecde13c2 31 {
Rhyme 0:37c8ecde13c2 32 if (display) {
Rhyme 0:37c8ecde13c2 33 display->fillrect(p->left+1, p->top+1,
Rhyme 0:37c8ecde13c2 34 p->left + p->width - 2, p->top + p->height - 2, Black) ;
Rhyme 0:37c8ecde13c2 35 display->rect(p->left, p->top,
Rhyme 0:37c8ecde13c2 36 p->left + p->width - 1,
Rhyme 0:37c8ecde13c2 37 p->top + p->height -1, Blue) ;
Rhyme 0:37c8ecde13c2 38 display->set_font((unsigned char*) Arial12x12);
Rhyme 0:37c8ecde13c2 39 display->foreground(White) ;
Rhyme 0:37c8ecde13c2 40 display->locate(p->left + 5, p->top + 5) ;
Rhyme 0:37c8ecde13c2 41 display->printf(p->name) ;
Rhyme 0:37c8ecde13c2 42 }
Rhyme 0:37c8ecde13c2 43 }
Rhyme 0:37c8ecde13c2 44
Rhyme 0:37c8ecde13c2 45 void draw_all_chart_frame(void)
Rhyme 0:37c8ecde13c2 46 {
Rhyme 0:37c8ecde13c2 47 edge_chart_type *p ;
Rhyme 0:37c8ecde13c2 48 if (display) {
Rhyme 0:37c8ecde13c2 49 reset_watch_dog() ;
Rhyme 0:37c8ecde13c2 50 display->BusEnable(true) ;
Rhyme 0:37c8ecde13c2 51 for(p = edge_chart ; p->name ; p++ ) {
Rhyme 0:37c8ecde13c2 52 draw_chart_frame(p) ;
Rhyme 0:37c8ecde13c2 53 }
Rhyme 0:37c8ecde13c2 54 display->BusEnable(false) ;
Rhyme 0:37c8ecde13c2 55 }
Rhyme 0:37c8ecde13c2 56 }