156 #include <avr/fuse.h>
170 #if defined( DOXYGEN )
171 const char menu_text0[];
172 const char menu_text1[];
173 const char menu_text2[];
174 const char menu_text3[];
175 const char menu_text4[];
176 const char menu_text5[];
177 const char menu_text6[];
178 const char menu_text7[];
179 const char menu_text8[];
180 const char menu_text9[];
181 const char menu_text10[];
182 const char menu_text11[];
183 const char menu_text12[];
184 const char menu_text13[];
185 const char menu_text14[];
186 const char menu_text15[];
187 const char menu_text16[];
188 const char menu_text17[];
192 const char menu_text0[] PROGMEM =
"CONTIKI";
193 const char menu_text1[] PROGMEM =
"6LOWPAN";
194 const char menu_text2[] PROGMEM =
"PING";
195 const char menu_text3[] PROGMEM =
"PINGING";
196 const char menu_text4[] PROGMEM =
"TEMP";
197 const char menu_text5[] PROGMEM =
"MODE ";
198 const char menu_text6[] PROGMEM =
"DEG F";
199 const char menu_text7[] PROGMEM =
"DEG C";
200 const char menu_text8[] PROGMEM =
"SEND";
201 const char menu_text9[] PROGMEM =
"ONCE";
202 const char menu_text10[] PROGMEM =
"AUTO";
203 const char menu_text11[] PROGMEM =
"DEBUG";
204 const char menu_text12[] PROGMEM =
"DBG ON";
205 const char menu_text13[] PROGMEM =
"DBG OFF";
206 const char menu_text14[] PROGMEM =
"SENT";
207 const char menu_text15[] PROGMEM =
"SENDING";
208 const char menu_text16[] PROGMEM =
"SLEEP";
209 const char menu_text17[] PROGMEM =
"DOZE";
222 {menu_text0, 0, 2, 0, 0, 0, 0 },
223 {menu_text1, 0, 2, 0, 0, 0, 0 },
225 {menu_text3, 2, 2, 2, 2, 0, 0 },
226 {menu_text4, 0, 5, 2, 11, 0, 0 },
227 {menu_text5, 4, 6, 8, 8, 0, 0 },
230 {menu_text8, 4, 9, 5, 5, 0, 0 },
233 {menu_text11, 0, 12, 4, 16, 0, 0 },
236 {menu_text14, 9, 14, 14, 14, 0, 0 },
237 {menu_text15, 10, 15, 15, 15, 0, 0 },
245 key_state_t button=KEY_STATE_NO_KEY;
248 uint8_t timeout_count;
262 uint8_t *src = (uint8_t*)&menu_items[ndx];
263 uint8_t *dest = (uint8_t*)&menu;
266 *dest++ = pgm_read_byte(src+i);
271 char top_menu_text[20];
282 if(menu.
text == menu_text0){
286 else if(menu.
text == menu_text1){
291 if (top_menu_text[0]) {
309 if(menu.
text == menu_text12){
313 if(menu.
text == menu_text10){
317 if(menu.
text == menu_text2){
374 if((PING_ATTEMPTS == count) && !timeout_flag){
379 else if(timeout_flag){
380 timeout_flag =
false;
383 if(PING_ATTEMPTS == timeout_count){
tmenufunc enter_func
Pointer to function to call when enter button is pressed.
void key_init(void)
This will intialize the joystick and the ADC for button readings.
Interface for the onboard temperature sensor.
int lcd_num_clr(void)
This will clear numbers displayed on the LCD.
void menu_prepare_temp(uint8_t *val)
This will setup the current temperature for transfer to the ATmega1284p via a binary command transfer...
void menu_display_temp(void)
This will display the temperature in degrees F or C.
This file operates the menu flow chart described in the readme notes.
void menu_run_doze(uint8_t *val)
This will start a sleep with wakes for temperature measurement and web requests.
This is the main file for the Raven LCD application.
void eeprom_init(void)
Initialize the EEPROM module.
void uart_serial_rcv_frame(uint8_t wait_for_ack)
This will receive a frame from the ATmega1284p and parse the incoming data.
uint8_t up
Contains next menu position for up.
uint8_t right
Contains next menu position for right.
int temp_init(void)
This will initialize the digital IO and adc channel for temperture readings.
void uart_init(uint8_t uart)
Initialises the UART controller, configures I/O control and interrupts.
void check_main_menu(void)
This will toggle the CONTIKI and 6LOWPAN LCD menus in the main menu position, unless alternate text h...
const char * text
Menu text to display.
int lcd_puts(const char *s)
This will put a string of characters out to the LCD.
uint8_t left
Contains next menu position for left.
void menu_run_sleep(uint8_t *val)
This will start a sleep operation.
void menu_stop_temp(void)
This will stop the auto sending of temperature data.
void lcd_symbol_set(lcd_symbol_t symbol)
This will enable any of the symbols on the Raven LCD.
This structure defines the joystick operation within the menu_items[].
void menu_debug_mode(uint8_t *val)
This will enable or disable the JTAG debug interface to allow for proper temperature sensor readings...
void menu_clear_temp(void)
This will clear the temperature displayed in the 4 digit LCD segments.
uint8_t down
Contains next menu position for down.
void check_menu(void)
This will check for the temp menu screen to determine if we need to clear the 4 digit LCD segments or...
static volatile clock_time_t count
These routines define the AVR-specific calls declared in /core/sys/clock.h CLOCK_SECOND is the number...
uint8_t menu_send_ping(void)
This will send the ping request to the 1284p via the serial port.
void menu_read_temp(uint8_t *val)
This will display the temperature in degrees F or C.
void menu_ping_request(uint8_t *val)
This will setup a ping request command to the 1284p and reset the ping counter.
int main(void)
This is main...
Handles the control of the USART for communication with the ATmega1284p for sending commands...
void read_menu(uint8_t ndx)
This will read the menu_items[] from the index requested.
This file supports the timer functionality for the LCD.
uint8_t is_button(void)
This will poll run key_task() to determine if a button has been pressed.
uint8_t get_button(void)
This function will wait for a user to press a button.
This file provides joystick operations.
int lcd_init(void)
This function will initialize the proper settings for the LCD driver.
void timer_start(void)
Start the timer.
int lcd_puts_P(const char *s)
This will put a string out to the LCD from Flash.
void timer_init(void)
TIMER1 init for timer used by LCD.
uint8_t * state
State variable used as argument for menu enter function.
void menu_stop_ping(void)
This will stop the ping request.