last version of the raven lcd user interface

This commit is contained in:
mdurvy 2008-10-15 13:13:49 +00:00
parent 3428e17cea
commit acfe78a51a
5 changed files with 64 additions and 13 deletions

View File

@ -39,6 +39,7 @@
*
*/
#include <avr/eeprom.h>
#include "menu.h"
#include "main.h"
#include "lcd.h"
@ -131,6 +132,27 @@ uint8_t
/*---------------------------------------------------------------------------*/
/**
* \brief This will check for DEBUG mode after power up.
*/
void
eeprom_init(void)
{
uint8_t val;
if(0xFF == eeprom_read_byte(EEPROM_DEBUG_ADDR)){
/* Disable - Reverse logic. */
val = 1;
menu_debug_mode(&val);
}
else{
/* Enable - Reverse logic. */
val = 0;
menu_debug_mode(&val);
}
}
/*---------------------------------------------------------------------------*/
/**
* \brief This will start a sleep operation.
*
@ -252,16 +274,20 @@ menu_debug_mode(uint8_t *val)
uint8_t sreg = SREG;
cli();
if(*val){
/* Could use inline ASM to meet timing requirements. */
/* Disable - Could use inline ASM to meet timing requirements. */
MCUCR |= (1 << JTD);
MCUCR |= (1 << JTD);
/* Needed for timing critical JTD disable. */
temp_init();
/* Store setting in EEPROM. */
eeprom_write_byte(EEPROM_DEBUG_ADDR, 0xFF);
}
else{
/* Could use inline ASM to meet timing requirements. */
/* Enable - Could use inline ASM to meet timing requirements. */
MCUCR &= ~(1 << JTD);
MCUCR &= ~(1 << JTD);
/* Store setting in EEPROM. */
eeprom_write_byte(EEPROM_DEBUG_ADDR, 0x01);
}
SREG = sreg;
}

View File

@ -66,9 +66,12 @@ extern bool temp_flag;
extern bool auto_temp;
extern const PROGMEM tmenu_item menu_items[];
#define EEPROM_DEBUG_ADDR 0
void menu_run_sleep(uint8_t *val);
void dectoascii(uint8_t val, char *str);
uint8_t *signed_dectoascii(int16_t n, uint8_t *str);
void eeprom_init(void);
void menu_ping_request(uint8_t * val);
uint8_t menu_send_ping(void);
void menu_stop_ping(void);

View File

@ -1,15 +1,19 @@
/*
* \mainpage ATmega3290p LCD Driver Software for Raven
*/
/**
* \section ATmega3290p LCD Driver Software for Raven
* \image html raven.png
* \ingroup platform
* \defgroup lcdraven RZRAVEN LCD 3290p
*
*
* \subsection intro_lcd LCD Introduction
* \section intro_lcd LCD Introduction
*
* This Raven LCD Driver application software was designed for a user interface
* to the Contiki 6LoWPAN collaboration on board the ATmega3290p. The
* LCD functionality uses the binary command set described in the release notes.
* These binary commands can also be found in a list of main.h.
*
* \subsection compile_lcd Compiling Raven LCD Driver
* \section compile_lcd Compiling Raven LCD Driver
*
* Raven LCD Driver can be compiled on the following platforms:
*
@ -22,9 +26,8 @@
* required for GCC/avr-libc to recognize new devices. The avr-libc
* webpage includes a concise guide on how to patch and build the AVR
* toolchain.
* -# <b>IAR EWB-AVR.</b> is currently not supported.
*
* \subsection fuses Board fuse settings
* \section fuses_lcd Board fuse settings
*
* The Raven LCD (3290p device) requires the proper fuse settings to function
* properly. These settings have been summarized below:
@ -33,7 +36,7 @@
* -# High: <b>0x99</b> (JTAG and ISP enabled, No OCDEN or EEPROM saving required)
* -# Low: <b>0xE2</b> (Use Int RC OSC - Start-up Time:6CK + 65ms)
*
* \subsection notes Operation Release Notes
* \section notes_lcd Operation Release Notes
*
* After programming the Raven LCD 3290p with the proper image, you will be introduced to
* the menu in the picture below:
@ -56,7 +59,13 @@
* to the webserver for Sensor Reading Data (<b>Once</b> or <b>Auto</b>). The webserver will
* only update the html data when <b>refreshed</b>.
*
* \subsection binary Binary Command Description
* More information about the operation of the Contiki 6LoWPAN system can be found
* at the \ref tutorialraven.
*
* More information about the 802.15.4 MAC designed for the Contiki 6LoWPAN system
* can be found at the \ref macdoc.
*
* \section binary_lcd Binary Command Description
*
* Using the binary commmand list described in main.h, the 3290p will contruct a binary
* command serial frame to control the 1284p. An example command frame is contructed below:
@ -124,7 +133,18 @@
#include "menu.h"
#include "temp.h"
/** \defgroup lcd LCD Functions and data
#include <avr/io.h>
#include <avr/fuse.h>
FUSES =
{
.low = 0xe2,
.high = 0x99,
.extended = 0xff,
};
/** \ingroup lcdraven
\defgroup lcd LCD Functions and data
* \{
*/
@ -277,6 +297,8 @@ main(void)
uart_init();
eeprom_init();
temp_init();
timer_init();

View File

@ -40,7 +40,7 @@
#include "key.h"
#include "temp.h"
#include <avr/pgmspace.h>
#include "lcd.h"
/**
* \addtogroup lcd

View File

@ -49,7 +49,7 @@
#define PROGMEM_DECLARE(x) x __attribute__((__progmem__))
/** \addtogroup grNTC */
/** \addtogroup lcd */
/** \{ */
/** Type used with \ref temp_get() to select temperature unit */
typedef enum {