eichi kowata / Mbed 2 deprecated geiger

Dependencies:   EthernetNetIf NTPClient_NetServices mbed ConfigFile

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers geiger.h Source File

geiger.h

00001 /*************************************************************
00002 
00003  geiger.h
00004  
00005 *************************************************************/
00006 
00007 #define VERSION "1.0"
00008 #include "mbed.h"
00009 #include "TextLCD.h"
00010 #include "EthernetNetIf.h"
00011 #include "NTPClient.h"
00012 #include "HTTPClient.h"
00013 #include "ClockControl/ClockControl.h"
00014 #include "PachubeV2CSV.h"
00015 #include "appconf.h"
00016 #include "FirmwareUpdater.h"
00017 #define CONFIG_FILENAME "/local/PACHUBE.CFG"
00018 #include "GPS.h"
00019 
00020 
00021 #define TMP_TEXT_BUF_SIZE (256)
00022 #define CHUNK   1
00023 #define AVERAGE_MIN 10*60/CHUNK
00024 
00025 char BINNAME[] = "geiger";
00026 
00027 extern void buzzer_off(DigitalOut*);
00028 extern PinName pin_assign(int);
00029 extern void convertDoubleToChar(double , char *, size_t );
00030 extern void pachube_output(PachubeV2CSV*, HTTPClient *);
00031 extern int web_post(PachubeV2CSV *, int , int , double );
00032 extern void pachube_setup(appconf_t *);
00033 extern int GetStatus(char *, char *, char *);
00034 extern unsigned char GetFileLine(FILE *, char *);
00035 extern void environment_setting(char *);
00036 extern void buzzer_off();
00037 extern void check_newfirm();
00038 extern void TwitMsg(char *);
00039 extern void twitter_output(void);
00040 extern void twitter_setup();
00041 extern void calendarHyoji(char *);
00042 extern void fullcalendarHyoji(char *);
00043 extern void printable_msg(char* );
00044 extern void LCD_time_and_output();
00045 extern void LCD_cpm_output();
00046 extern void read_dma_data();
00047 extern void setup_adcdma();
00048 
00049 // for pin assignment and mode setting
00050 
00051 int mode=0,gps_mode=0;
00052 int shape_mode=0;
00053 int AnalogInput_pin_number=15;
00054 int GMInterrupt_pin_number=17;
00055 int GMbetaInterrupt_pin_number=16;
00056 int LED_pin_number=23;
00057 int Buzzer_pin_number=22;
00058 int GPStx_pin_number=13;
00059 int GPSrx_pin_number=14;
00060 
00061 extern "C" void mbed_reset();
00062 appconf_t appconf;
00063 int noInternet=1;
00064 NTPResult ntpRet=NTP_TIMEOUT;
00065 
00066 // display device
00067 Serial pc(USBTX, USBRX);
00068 TextLCD  lcd( p24, p26, p27, p28, p29, p30 ); // rs, e, d0-d3
00069 
00070 // local<-> global conversion
00071 AnalogIn *Sense15;
00072 GPS *gps;
00073 DigitalOut *buzzer;
00074 DigitalOut *outLED;
00075 FirmwareUpdater  *fwup;
00076 
00077 //for average calculate arrays
00078 unsigned int cpm_array_max = 10;
00079 unsigned char cpm_array[AVERAGE_MIN];
00080 //current index for array
00081 int cpm_index=0;
00082 int first_touch_index=0;
00083 
00084 //for calc
00085 float cpm=0;
00086 float uSv=0;
00087 float peak_uSv=0;
00088 int cnt=0;
00089 float offset_usv=0;
00090 float carib_cpm0=-1;
00091 float carib_usv0=-1;
00092 float carib_cpm1=-1;
00093 float carib_usv1=-1;
00094 
00095 //for long term average
00096 unsigned int long_cpm_array_max = 60;
00097 unsigned int *long_cpm_array;
00098 int long_cpm_index=0;
00099 int long_first_touch_index=0;
00100 unsigned char count_second=0;
00101 float long_cpm=0;
00102 float long_uSv=0;
00103 
00104 
00105 //for setting (config_env.c)
00106 float carib=660;
00107 int console_output_flag=0;
00108 int updateinterval=10;
00109 int updateintervalcount=0;
00110 int updateflag=0; /* 0: Standalone 1: Twitter 2:Pachube */
00111 int updatetype=0;  /* 0: no 1: twitter 2: pachube */
00112 int sound=0;    /* 0: off  1: on */
00113 float voltagedivider=500; /* voltage_divider of the voltage by the board */
00114 float volt=400; /* voltage executed to GM tube */
00115 int firmware_update_interval=24;
00116 time_t tz_offset=9;
00117 char fwserver[256];
00118 int init_stabilize_time=30;
00119 int cpu_speed=12;    // 12=96MHz
00120 
00121 // Ethernet
00122 EthernetNetIf eth;
00123 Ethernet eth0;
00124 NTPClient ntp;
00125 
00126 
00127 // File access
00128 LocalFileSystem local("local");
00129 
00130 // Output display selection
00131 int LCD_writing=0;
00132 
00133 //buzzer
00134 Timeout click;
00135 
00136 HTTPClient commonClient;