#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include <util/delay.h>
#include "Descriptors.h"
#include "Lib/SCSI.h"
#include "Lib/DataflashManager.h"
#include "Lib/FATFs/ff.h"
#include "Lib/DS1307.h"
#include "Lib/HYT321.h"
#include "Lib/lcd.h"
#include "Lib/Funkmodul.h"
#include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Temperature.h>
#include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/USB/USB.h>
Header file for TempDataLogger.c.
#define DEFAULT_LOG_INTERVAL 20 |
Default log interval when the EEPROM is blank, in 500ms ticks.
#define DEFAULT_SENSOR1_NAME "Sensor 1" |
Default sensor1 name when the EEPROM is blank.
#define DEFAULT_SENSOR2_NAME "Sensor 2" |
Default sensor2 name when the EEPROM is blank.
#define DEFAULT_SENSOR3_NAME "Sensor 3" |
Default sensor3 name when the EEPROM is blank.
Define LCD Modul: 2 -> 2*16 Char, 4 -> 4*20 Char
#define LEDMASK_USB_BUSY LEDS_LED2 |
LED mask for the library LED driver, to indicate that the USB interface is busy.
#define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) |
LED mask for the library LED driver, to indicate that the USB interface is enumerating.
#define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) |
LED mask for the library LED driver, to indicate that an error has occurred in the USB interface.
#define LEDMASK_USB_NOTREADY LEDS_LED1 |
LED mask for the library LED driver, to indicate that the USB interface is not ready.
#define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) |
LED mask for the library LED driver, to indicate that the USB interface is ready.
#define LOCAL_DataInput 0x7F |
#define LOCAL_Port_DDR DDRC |
Define Port for local connection or usb
#define LOCAL_Port_Read PINC |
#define LOG_FILENAME "TEMPLOG.txt" |
Filename for the log data when written to the dataflash FAT filesystem.
#define MAX_DataInput 0xDF |
#define MAX_Port_DDR DDRB |
Define Port for max/min display switch -> PB5
#define MAX_Port_Read PINB |
#define MAX_Port_Write PORTB |
#define POWER_ENABLE_DataOutput 0x10 |
#define POWER_ENABLE_Port_DDR DDRB |
Define Power Enable for Wiznet module WIZ107SR -> PB4
#define POWER_ENABLE_Port_Write PORTB |
#define USER_AGENT "Datalogger_One" |
#define WEB_LOGGING_INTERVAL 1170 |
Define Web logging interval = (time in seconds-10 * 2)
#define writeAPIKey "ABCDEFDG" |
Define parameters for cosm datalogging
bool CALLBACK_HID_Device_CreateHIDReport |
( |
USB_ClassInfo_HID_Device_t *const |
HIDInterfaceInfo, |
|
|
uint8_t *const |
ReportID, |
|
|
const uint8_t |
ReportType, |
|
|
void * |
ReportData, |
|
|
uint16_t *const |
ReportSize |
|
) |
| |
HID class driver callback function for the creation of HID reports to the host.
- Parameters
-
[in] | HIDInterfaceInfo | Pointer to the HID class interface configuration structure being referenced |
[in,out] | ReportID | Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID |
[in] | ReportType | Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature |
[out] | ReportData | Pointer to a buffer where the created report should be stored |
[out] | ReportSize | Number of bytes written in the report (or zero if no report is to be sent |
- Returns
- Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
void CALLBACK_HID_Device_ProcessHIDReport |
( |
USB_ClassInfo_HID_Device_t *const |
HIDInterfaceInfo, |
|
|
const uint8_t |
ReportID, |
|
|
const uint8_t |
ReportType, |
|
|
const void * |
ReportData, |
|
|
const uint16_t |
ReportSize |
|
) |
| |
HID class driver callback function for the processing of HID reports from the host.
- Parameters
-
[in] | HIDInterfaceInfo | Pointer to the HID class interface configuration structure being referenced |
[in] | ReportID | Report ID of the received report from the host |
[in] | ReportType | The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature |
[in] | ReportData | Pointer to a buffer where the created report has been stored |
[in] | ReportSize | Size in bytes of the received HID report |
bool CALLBACK_MS_Device_SCSICommandReceived |
( |
USB_ClassInfo_MS_Device_t *const |
MSInterfaceInfo) | |
|
Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed.
- Parameters
-
[in] | MSInterfaceInfo | Pointer to the Mass Storage class interface configuration structure being referenced |
void CloseLogFile |
( |
void |
) | |
|
Closes the open data log file on the Dataflash's FAT formatted partition
void EVENT_USB_Device_ConfigurationChanged |
( |
void |
) | |
|
Event handler for the library USB Configuration Changed event.
void EVENT_USB_Device_Connect |
( |
void |
) | |
|
Event handler for the library USB Connection event.
void EVENT_USB_Device_ControlRequest |
( |
void |
) | |
|
Event handler for the library USB Control Request reception event.
void EVENT_USB_Device_Disconnect |
( |
void |
) | |
|
Event handler for the library USB Disconnection event.
void GetCorrectionValues |
( |
void |
) | |
|
void OpenLogFile |
( |
void |
) | |
|
Opens the log file on the Dataflash's FAT formatted partition according to the current date
void RadioReceive |
( |
void |
) | |
|
Receive telegram from radio modul
void SetupHardware |
( |
void |
) | |
|
Configures the board hardware and chip peripherals for the demo's functionality.