42 #include <avr/eeprom.h>
43 #include <util/delay.h>
55 uint8_t ping_response;
78 *(str+1) = (val % 10) +
'0';
79 *str = (val / 10) +
'0';
106 if(temp_mode == TEMP_UNIT_CELCIUS){
145 if(0xFF == eeprom_read_byte(EEPROM_DEBUG_ADDR)){
171 PRR |= (1 << PRTIM1) | (1 << PRSPI);
178 while(!(UCSR0A & (1 << TXC0)));
192 PRR &= ~((1 << PRTIM1) | (1 << PRSPI));
225 while (ENTER_PORT & (1<<ENTER_PIN)) {
234 while(!(UCSR0A & (1 << TXC0)));
334 eeprom_write_byte(EEPROM_DEBUG_ADDR, 0xFF);
338 MCUCR &= ~(1 << JTD);
339 MCUCR &= ~(1 << JTD);
341 eeprom_write_byte(EEPROM_DEBUG_ADDR, 0x01);
357 temp_mode = TEMP_UNIT_CELCIUS;
360 temp_mode = TEMP_UNIT_FAHRENHEIT;
376 int16_t result =
temp_get(temp_mode);
379 if(temp_mode == TEMP_UNIT_CELCIUS){
479 str[9]=
'm';str[10]=
'V';str[11]=0;
This file provides joystick operations.
int temp_init(void)
This will initialize the digital IO and adc channel for temperture readings.
void menu_display_temp(void)
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.
void lcd_symbol_clr(lcd_symbol_t symbol)
This will clear any symbol on the Raven LCD.
void menu_debug_mode(uint8_t *val)
This will enable or disable the JTAG debug interface to allow for proper temperature sensor readings...
void lcd_deinit(void)
This will disable the LCD operation.
void menu_clear_temp(void)
This will clear the temperature displayed in the 4 digit LCD segments.
void uart_init(const unsigned int uart_num, uint32_t module_clk_hz, const uint32_t baud)
Initialize UART.
int16_t temp_get(temp_unit_t unit)
Read current temperature.
void sleep_now(int howlong)
Prepares for and executes sleep.
void sleep_wakeup(void)
This will send a wakeup command to ATmega1284p It may already be awake, if not it will respond during...
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.
Interface for the onboard temperature sensor.
This controls the sleep operation for the LCD.
void menu_stop_ping(void)
This will stop the ping request.
uint8_t * signed_dectoascii(int16_t n, uint8_t *str)
This will convert a signed decimal number to ASCII.
void menu_run_doze(uint8_t *val)
This will start a sleep with wakes for temperature measurement and web requests.
Handles the control of the USART for communication with the ATmega1284p for sending commands...
void menu_prepare_temp(uint8_t *val)
This will setup the current temperature for transfer to the ATmega1284p via a binary command transfer...
void eeprom_init(void)
Initialize the EEPROM module.
void dectoascii(uint8_t val, char *str)
This function will convert decimal to ascii.
void menu_run_sleep(uint8_t *val)
This will start a sleep operation.
int lcd_num_clr(void)
This will clear numbers displayed on the LCD.
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.
uint16_t ADC2_reading
This will send the data via the serial port.
This is the main file for the Raven LCD application.
key_state_t key_state_get(void)
This function will start the ADC conversion and read the current converstion value to determine the b...
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 menu_send_ping(void)
This will send the ping request to the 1284p via the serial port.
void uart_deinit(void)
Turn off UART for sleep mode.
This file implements a beep function to emit a beep sound from Raven's speaker. ...
uint8_t is_button(void)
This will poll run key_task() to determine if a button has been pressed.
void menu_read_temp(uint8_t *val)
This will display the temperature in degrees F or C.
void menu_stop_temp(void)
This will stop the auto sending of temperature data.
This file operates the menu flow chart described in the readme notes.
int lcd_init(void)
This function will initialize the proper settings for the LCD driver.
uint8_t get_button(void)
This function will wait for a user to press a button.
void key_init(void)
This will intialize the joystick and the ADC for button readings.
void key_deinit(void)
This will disable the ADC used for button readings.