42 #include <avr/eeprom.h>
43 #include <util/delay.h>
55 uint8_t ping_response;
76 __asm__ __volatile__ (\
77 "in __tmp_reg__,__SREG__" "\n\t"\
80 "out __SREG__, __tmp_reg__" "\n\t"\
83 : "r" ((uint8_t)(x ? (1<<JTD) : 0)),\
84 "M" (_SFR_IO_ADDR(MCUCR))\
99 *(str+1) = (val % 10) +
'0';
100 *str = (val / 10) +
'0';
127 if(temp_mode == TEMP_UNIT_CELCIUS){
166 if(0xFF == eeprom_read_byte(EEPROM_DEBUG_ADDR)){
192 PRR |= (1 << PRTIM1) | (1 << PRSPI);
199 while(!(UCSR0A & (1 << TXC0)));
213 PRR &= ~((1 << PRTIM1) | (1 << PRSPI));
246 while (ENTER_PORT & (1<<ENTER_PIN)) {
255 while(!(UCSR0A & (1 << TXC0)));
350 eeprom_write_byte(EEPROM_DEBUG_ADDR, 0xFF);
355 eeprom_write_byte(EEPROM_DEBUG_ADDR, 0x01);
371 temp_mode = TEMP_UNIT_CELCIUS;
374 temp_mode = TEMP_UNIT_FAHRENHEIT;
390 int16_t result =
temp_get(temp_mode);
393 if(temp_mode == TEMP_UNIT_CELCIUS){
493 str[9]=
'm';str[10]=
'V';str[11]=0;
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 lcd_symbol_clr(lcd_symbol_t symbol)
This will clear any symbol on the Raven LCD.
int lcd_num_putdec(int numb, lcd_padding_t padding)
This will put a DEC value on the LCD that represents the input parameter.
uint8_t * signed_dectoascii(int16_t n, uint8_t *str)
This will convert a signed decimal number to ASCII.
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.
uint16_t ADC2_reading
This will send the data via the serial port.
This is the main file for the Raven LCD application.
void sleep_now(int howlong)
Prepares for and executes sleep.
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 uart_deinit(void)
Turn off UART for sleep mode.
key_state_t key_state_get(void)
This function will start the ADC conversion and read the current converstion value to determine the b...
void dectoascii(uint8_t val, char *str)
This function will convert decimal to ascii.
void eeprom_init(void)
This will check for DEBUG mode after power up.
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.
This file implements a beep function to emit a beep sound from Raven's speaker. ...
void lcd_single_print_dig(uint8_t numb, uint8_t pos)
This will add the passed in number to any of the four locations of the four digit segment display on ...
void lcd_symbol_set(lcd_symbol_t symbol)
This will enable any of the symbols on the Raven LCD.
void key_deinit(void)
This will disable the ADC used for button readings.
void menu_debug_mode(uint8_t *val)
This will enable or disable the JTAG debug interface to allow for proper temperature sensor readings...
void uart_serial_send_frame(uint8_t cmd, uint8_t payload_length, uint8_t *payload)
This function builds and sends a binary command frame to the ATmega1284p.
void menu_clear_temp(void)
This will clear the temperature displayed in the 4 digit LCD segments.
This controls the sleep operation for the LCD.
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.
Handles the control of the USART for communication with the ATmega1284p for sending commands...
void sleep_wakeup(void)
This will send a wakeup command to ATmega1284p It may already be awake, if not it will respond during...
int16_t temp_get(temp_unit_t unit)
Read current temperature.
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.
void lcd_deinit(void)
This will disable the LCD operation.
This file provides joystick operations.
#define jtd_set(x)
This will reliably set or clear the JTD bit of the MCUCR register.
int lcd_init(void)
This function will initialize the proper settings for the LCD driver.
void menu_stop_ping(void)
This will stop the ping request.