From 47384e3c5029381d8b9fff2dbacbeec7c1e71845 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Fri, 18 Dec 2009 05:25:51 +0000 Subject: Rename HotmailNotifier project files to LEDNotifier. --- Projects/LEDNotifier/HotmailNotifier.c | 165 --------------------- Projects/LEDNotifier/HotmailNotifier.h | 59 -------- Projects/LEDNotifier/HotmailNotifier.txt | 65 -------- .../HotmailNotifierApp/MailNotifier.Designer.cs | 113 ++++++++++++++ .../LEDNotifier/HotmailNotifierApp/MailNotifier.cs | 111 ++++++++++++++ .../HotmailNotifierApp/MailNotifier.csproj | 98 ++++++++++++ .../HotmailNotifierApp/MailNotifier.resx | 126 ++++++++++++++++ Projects/LEDNotifier/HotmailNotifierApp/Program.cs | 20 +++ .../HotmailNotifierApp/Properties/AssemblyInfo.cs | 36 +++++ .../Properties/Resources.Designer.cs | 63 ++++++++ .../HotmailNotifierApp/Properties/Resources.resx | 117 +++++++++++++++ .../Properties/Settings.Designer.cs | 26 ++++ .../Properties/Settings.settings | 7 + Projects/LEDNotifier/LEDNotifier.c | 165 +++++++++++++++++++++ Projects/LEDNotifier/LEDNotifier.h | 59 ++++++++ Projects/LEDNotifier/LEDNotifier.txt | 65 ++++++++ Projects/LEDNotifier/LUFA HotmailNotifier.inf | 106 ------------- Projects/LEDNotifier/LUFA LED Notifier.inf | 106 +++++++++++++ .../WindowsApp/MailNotifier.Designer.cs | 113 -------------- Projects/LEDNotifier/WindowsApp/MailNotifier.cs | 111 -------------- .../LEDNotifier/WindowsApp/MailNotifier.csproj | 98 ------------ Projects/LEDNotifier/WindowsApp/MailNotifier.resx | 126 ---------------- Projects/LEDNotifier/WindowsApp/Program.cs | 20 --- .../WindowsApp/Properties/AssemblyInfo.cs | 36 ----- .../WindowsApp/Properties/Resources.Designer.cs | 63 -------- .../WindowsApp/Properties/Resources.resx | 117 --------------- .../WindowsApp/Properties/Settings.Designer.cs | 26 ---- .../WindowsApp/Properties/Settings.settings | 7 - 28 files changed, 1112 insertions(+), 1112 deletions(-) delete mode 100644 Projects/LEDNotifier/HotmailNotifier.c delete mode 100644 Projects/LEDNotifier/HotmailNotifier.h delete mode 100644 Projects/LEDNotifier/HotmailNotifier.txt create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.Designer.cs create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.cs create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.csproj create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.resx create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/Program.cs create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/Properties/AssemblyInfo.cs create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.Designer.cs create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.resx create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.Designer.cs create mode 100644 Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.settings create mode 100644 Projects/LEDNotifier/LEDNotifier.c create mode 100644 Projects/LEDNotifier/LEDNotifier.h create mode 100644 Projects/LEDNotifier/LEDNotifier.txt delete mode 100644 Projects/LEDNotifier/LUFA HotmailNotifier.inf create mode 100644 Projects/LEDNotifier/LUFA LED Notifier.inf delete mode 100644 Projects/LEDNotifier/WindowsApp/MailNotifier.Designer.cs delete mode 100644 Projects/LEDNotifier/WindowsApp/MailNotifier.cs delete mode 100644 Projects/LEDNotifier/WindowsApp/MailNotifier.csproj delete mode 100644 Projects/LEDNotifier/WindowsApp/MailNotifier.resx delete mode 100644 Projects/LEDNotifier/WindowsApp/Program.cs delete mode 100644 Projects/LEDNotifier/WindowsApp/Properties/AssemblyInfo.cs delete mode 100644 Projects/LEDNotifier/WindowsApp/Properties/Resources.Designer.cs delete mode 100644 Projects/LEDNotifier/WindowsApp/Properties/Resources.resx delete mode 100644 Projects/LEDNotifier/WindowsApp/Properties/Settings.Designer.cs delete mode 100644 Projects/LEDNotifier/WindowsApp/Properties/Settings.settings (limited to 'Projects') diff --git a/Projects/LEDNotifier/HotmailNotifier.c b/Projects/LEDNotifier/HotmailNotifier.c deleted file mode 100644 index 5a7ebd563..000000000 --- a/Projects/LEDNotifier/HotmailNotifier.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Main source file for the HotmailNotfier project. This file contains the main tasks of - * the demo and is responsible for the initial application hardware configuration. - */ - -#include "HotmailNotifier.h" - -/** LUFA CDC Class driver interface configuration and state information. This structure is - * passed to all CDC Class driver functions, so that multiple instances of the same class - * within a device can be differentiated from one another. - */ -USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = - { - .Config = - { - .ControlInterfaceNumber = 0, - - .DataINEndpointNumber = CDC_TX_EPNUM, - .DataINEndpointSize = CDC_TXRX_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = CDC_RX_EPNUM, - .DataOUTEndpointSize = CDC_TXRX_EPSIZE, - .DataOUTEndpointDoubleBank = false, - - .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, - .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, - .NotificationEndpointDoubleBank = false, - }, - }; - -/** Counter for the software PWM */ -static volatile uint8_t SoftPWM_Count; - -/** Duty cycle for the first software PWM channel */ -static volatile uint8_t SoftPWM_Channel1_Duty; - -/** Duty cycle for the second software PWM channel */ -static volatile uint8_t SoftPWM_Channel2_Duty; - -/** Duty cycle for the third software PWM channel */ -static volatile uint8_t SoftPWM_Channel3_Duty; - - -/** Interrupt handler for managing the software PWM channels for the LEDs */ -ISR(TIMER0_COMPA_vect, ISR_BLOCK) -{ - uint8_t LEDMask = LEDS_ALL_LEDS; - - if (++SoftPWM_Count == 0x1F) - SoftPWM_Count = 0; - - if (SoftPWM_Count >= SoftPWM_Channel1_Duty) - LEDMask &= ~LEDS_LED1; - - if (SoftPWM_Count >= SoftPWM_Channel2_Duty) - LEDMask &= ~LEDS_LED2; - - if (SoftPWM_Count >= SoftPWM_Channel3_Duty) - LEDMask &= ~LEDS_LED3; - - LEDs_SetAllLEDs(LEDMask); -} - -/** Standard file stream for the CDC interface when set up, so that the virtual CDC COM port can be - * used like any regular character stream in the C APIs - */ -static FILE USBSerialStream; - -/** Main program entry point. This routine contains the overall program flow, including initial - * setup of all components and the main program loop. - */ -int main(void) -{ - SetupHardware(); - - /* Create a regular blocking character stream for the interface so that it can be used with the stdio.h functions */ - CDC_Device_CreateBlockingStream(&VirtualSerial_CDC_Interface, &USBSerialStream); - - for (;;) - { - /* Read in next LED colour command from the host */ - uint8_t ColorUpdate = fgetc(&USBSerialStream); - - /* Top 3 bits select the LED, bottom three control the brightness */ - uint8_t Channel = (ColorUpdate & 0b11100000); - uint8_t Duty = (ColorUpdate & 0b00011111); - - if (Channel & (1 << 5)) - SoftPWM_Channel1_Duty = Duty; - - if (Channel & (1 << 6)) - SoftPWM_Channel2_Duty = Duty; - - if (Channel & (1 << 7)) - SoftPWM_Channel3_Duty = Duty; - - CDC_Device_USBTask(&VirtualSerial_CDC_Interface); - USB_USBTask(); - } -} - -/** Configures the board hardware and chip peripherals for the demo's functionality. */ -void SetupHardware(void) -{ - /* Disable watchdog if enabled by bootloader/fuses */ - MCUSR &= ~(1 << WDRF); - wdt_disable(); - - /* Disable clock division */ - clock_prescale_set(clock_div_1); - - /* Hardware Initialization */ - LEDs_Init(); - USB_Init(); - - /* Timer Initialization */ - OCR0A = 100; - TCCR0A = (1 << WGM01); - TCCR0B = (1 << CS00); - TIMSK0 = (1 << OCIE0A); -} - -/** Event handler for the library USB Configuration Changed event. */ -void EVENT_USB_Device_ConfigurationChanged(void) -{ - CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); -} - -/** Event handler for the library USB Unhandled Control Request event. */ -void EVENT_USB_Device_UnhandledControlRequest(void) -{ - CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface); -} diff --git a/Projects/LEDNotifier/HotmailNotifier.h b/Projects/LEDNotifier/HotmailNotifier.h deleted file mode 100644 index 6ec85c115..000000000 --- a/Projects/LEDNotifier/HotmailNotifier.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Header file for HotmailNotifier.c. - */ - -#ifndef _HOTMAILNOTIFIER_H_ -#define _HOTMAILNOTIFIER_H_ - - /* Includes: */ - #include - #include - #include - #include - #include - - #include "Descriptors.h" - - #include - #include - #include - #include - - /* Function Prototypes: */ - void SetupHardware(void); - - void EVENT_USB_Device_ConfigurationChanged(void); - void EVENT_USB_Device_UnhandledControlRequest(void); - -#endif diff --git a/Projects/LEDNotifier/HotmailNotifier.txt b/Projects/LEDNotifier/HotmailNotifier.txt deleted file mode 100644 index f9314b77a..000000000 --- a/Projects/LEDNotifier/HotmailNotifier.txt +++ /dev/null @@ -1,65 +0,0 @@ -/** \file - * - * This file contains special DoxyGen information for the generation of the main page and other special - * documentation pages. It is not a project source file. - */ - -/** \mainpage Communications Device Class (Virtual Serial Port) Demo - * - * \section SSec_Compat Demo Compatibility: - * - * The following list indicates what microcontrollers are compatible with this demo. - * - * - AT90USB646 - * - * \section SSec_Info USB Information: - * - * The following table gives a rundown of the USB utilization of this demo. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
USB Mode:Device
USB Class:Communications Device Class (CDC)
USB Subclass:Abstract Control Model (ACM)
Relevant Standards:USBIF CDC Class Standard
Usable Speeds:Full Speed Mode
- * - * \section SSec_Description Project Description: - * - * Hotmail Email Notifier Project. This project is designed for the Busware BUI board, however it can run easily on any - * USB AVR. It consists of a host application (written in C#) and a device firmware which work together to provide a - * visual mail notification system via the board's RGB LED. While the sample host application uses the Windows Live - * Messenger API for its email notifications, the hardware simply adjusts the LED color based on bytes sent to it - thus - * with a little coding, this project can be adapted for any sort of visual notification. - * - * To compile the host application, you will need Microsoft Visual Studio 2008 (the free Express edition should be - * sufficient) as well as a recent version of Windows Live Messenger installed. When run, you will need to set the COM port - * number used by the hardware on the host PC, whereupon the host will send new email notifications to the device. - * - * \section SSec_Options Project Options - * - * The following defines can be found in this project, which can control the project behaviour when defined, or changed in value. - * - * - * - * - * - *
- * None - *
- */ \ No newline at end of file diff --git a/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.Designer.cs b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.Designer.cs new file mode 100644 index 000000000..9e4734dc1 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.Designer.cs @@ -0,0 +1,113 @@ +namespace TestWinForms +{ + partial class MailNotifier + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.serSerialPort = new System.IO.Ports.SerialPort(this.components); + this.cmbComPort = new System.Windows.Forms.ComboBox(); + this.lblComPort = new System.Windows.Forms.Label(); + this.btnMinimize = new System.Windows.Forms.Button(); + this.btnExit = new System.Windows.Forms.Button(); + this.nicoNotifyIcon = new System.Windows.Forms.NotifyIcon(this.components); + this.SuspendLayout(); + // + // cmbComPort + // + this.cmbComPort.FormattingEnabled = true; + this.cmbComPort.Location = new System.Drawing.Point(108, 12); + this.cmbComPort.Name = "cmbComPort"; + this.cmbComPort.Size = new System.Drawing.Size(126, 21); + this.cmbComPort.TabIndex = 0; + this.cmbComPort.SelectedIndexChanged += new System.EventHandler(this.cmbComPort_SelectedIndexChanged); + // + // lblComPort + // + this.lblComPort.AutoSize = true; + this.lblComPort.Location = new System.Drawing.Point(12, 15); + this.lblComPort.Name = "lblComPort"; + this.lblComPort.Size = new System.Drawing.Size(90, 13); + this.lblComPort.TabIndex = 1; + this.lblComPort.Text = "COM Port to Use:"; + // + // btnMinimize + // + this.btnMinimize.Location = new System.Drawing.Point(12, 42); + this.btnMinimize.Name = "btnMinimize"; + this.btnMinimize.Size = new System.Drawing.Size(109, 23); + this.btnMinimize.TabIndex = 2; + this.btnMinimize.Text = "Minimize to Tray"; + this.btnMinimize.UseVisualStyleBackColor = true; + this.btnMinimize.Click += new System.EventHandler(this.btnMinimize_Click); + // + // btnExit + // + this.btnExit.Location = new System.Drawing.Point(131, 42); + this.btnExit.Name = "btnExit"; + this.btnExit.Size = new System.Drawing.Size(109, 23); + this.btnExit.TabIndex = 3; + this.btnExit.Text = "Exit"; + this.btnExit.UseVisualStyleBackColor = true; + this.btnExit.Click += new System.EventHandler(this.btnExit_Click); + // + // nicoNotifyIcon + // + this.nicoNotifyIcon.Text = "Mail Notifier"; + this.nicoNotifyIcon.Visible = true; + // + // MailNotifier + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(252, 77); + this.Controls.Add(this.btnExit); + this.Controls.Add(this.btnMinimize); + this.Controls.Add(this.lblComPort); + this.Controls.Add(this.cmbComPort); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "MailNotifier"; + this.Text = "Mail Notifier Light"; + this.WindowState = System.Windows.Forms.FormWindowState.Minimized; + this.Load += new System.EventHandler(this.MailNotifier_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.IO.Ports.SerialPort serSerialPort; + private System.Windows.Forms.ComboBox cmbComPort; + private System.Windows.Forms.Label lblComPort; + private System.Windows.Forms.Button btnMinimize; + private System.Windows.Forms.Button btnExit; + private System.Windows.Forms.NotifyIcon nicoNotifyIcon; + } +} + diff --git a/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.cs b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.cs new file mode 100644 index 000000000..742948fca --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using Microsoft.Win32; + +namespace TestWinForms +{ + public partial class MailNotifier : Form + { + private MessengerAPI.Messenger Messenger; + private RegistryKey AppRegKey; + + private const int LIGHT_MAX = 0x1F; + + public MailNotifier() + { + InitializeComponent(); + + Messenger = new MessengerAPI.Messenger(); + AppRegKey = Registry.CurrentUser.CreateSubKey("Software\\MailNotifier"); + + for (int i = 1; i < 99; i++) + cmbComPort.Items.Add("COM" + i.ToString()); + + cmbComPort.SelectedIndex = System.Convert.ToInt32(AppRegKey.GetValue("Port", "1")) - 1; + serSerialPort.PortName = cmbComPort.Text; + + nicoNotifyIcon.Icon = this.Icon; + nicoNotifyIcon.MouseClick += new MouseEventHandler(TrayIconClick); + } + + private void MailNotifier_Load(object sender, EventArgs e) + { + Messenger.OnUnreadEmailChange += new MessengerAPI.DMessengerEvents_OnUnreadEmailChangeEventHandler(NewEmail); + + bool UnreadMail = (Messenger.get_UnreadEmailCount(MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) > 0); + NotifyLight((!UnreadMail ? LIGHT_MAX : 0), (UnreadMail ? LIGHT_MAX : 0), 0); + + Hide(); + } + + private void TrayIconClick(object sender, MouseEventArgs e) + { + this.Show(); + this.WindowState = FormWindowState.Normal; + } + + private void NewEmail(MessengerAPI.MUAFOLDER folder, int amount, ref bool enableDefault) + { + if (folder == MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) + { + bool UnreadMail = (Messenger.get_UnreadEmailCount(MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) > 0); + NotifyLight((!UnreadMail ? LIGHT_MAX : 0), (UnreadMail ? LIGHT_MAX : 0), 0); + } + } + + private void NotifyLight(int Red, int Green, int Blue) + { + byte[] buffer = new byte[3]; + buffer[0] = (byte)(0x80 | (Red & LIGHT_MAX)); + buffer[1] = (byte)(0x40 | (Green & LIGHT_MAX)); + buffer[2] = (byte)(0x20 | (Blue & LIGHT_MAX)); + + try + { + serSerialPort.Open(); + serSerialPort.Write(buffer, 0, buffer.Length); + serSerialPort.Close(); + } + catch (Exception e) + { + + } + } + + private void btnExit_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void cmbComPort_SelectedIndexChanged(object sender, EventArgs e) + { + AppRegKey.SetValue("Port", cmbComPort.SelectedIndex + 1); + serSerialPort.PortName = cmbComPort.Text; + + for (int i = 1; i < 10; i++) + { + NotifyLight((LIGHT_MAX / i), (LIGHT_MAX / (i * 10)), 0); + System.Threading.Thread.Sleep(10); + } + + for (int i = 10; i > 0; i--) + { + NotifyLight((LIGHT_MAX / i), (LIGHT_MAX / (i * 10)), 0); + System.Threading.Thread.Sleep(10); + } + + bool UnreadMail = (Messenger.get_UnreadEmailCount(MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) > 0); + NotifyLight((!UnreadMail ? LIGHT_MAX : 0), (UnreadMail ? LIGHT_MAX : 0), 0); + } + + private void btnMinimize_Click(object sender, EventArgs e) + { + this.Hide(); + } + } +} diff --git a/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.csproj b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.csproj new file mode 100644 index 000000000..3156b5d12 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.csproj @@ -0,0 +1,98 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {64376AAC-32C5-4A78-80CC-407A6B9824FE} + WinExe + Properties + MailNotifier + MailNotifier + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.5 + + + + + + + + + + Form + + + MailNotifier.cs + + + + + MailNotifier.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {E02AD29E-80F5-46C6-B416-9B3EBDDF057E} + 1 + 0 + 0 + tlbimp + False + + + + + \ No newline at end of file diff --git a/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.resx b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.resx new file mode 100644 index 000000000..bc1f8f67d --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/MailNotifier.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 126, 17 + + \ No newline at end of file diff --git a/Projects/LEDNotifier/HotmailNotifierApp/Program.cs b/Projects/LEDNotifier/HotmailNotifierApp/Program.cs new file mode 100644 index 000000000..1dd229d91 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace TestWinForms +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MailNotifier()); + } + } +} diff --git a/Projects/LEDNotifier/HotmailNotifierApp/Properties/AssemblyInfo.cs b/Projects/LEDNotifier/HotmailNotifierApp/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..86b056454 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MailNotifier")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Dean Camera")] +[assembly: AssemblyProduct("Mail LED Notifier")] +[assembly: AssemblyCopyright("Public Domain")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("25e10140-cf96-4619-adaa-9010abc62d0a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.Designer.cs b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.Designer.cs new file mode 100644 index 000000000..8eb902684 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MailNotifier.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MailNotifier.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.resx b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.resx new file mode 100644 index 000000000..ffecec851 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.Designer.cs b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.Designer.cs new file mode 100644 index 000000000..bb55ab3e3 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MailNotifier.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.settings b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.settings new file mode 100644 index 000000000..abf36c5d3 --- /dev/null +++ b/Projects/LEDNotifier/HotmailNotifierApp/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Projects/LEDNotifier/LEDNotifier.c b/Projects/LEDNotifier/LEDNotifier.c new file mode 100644 index 000000000..5a7ebd563 --- /dev/null +++ b/Projects/LEDNotifier/LEDNotifier.c @@ -0,0 +1,165 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Main source file for the HotmailNotfier project. This file contains the main tasks of + * the demo and is responsible for the initial application hardware configuration. + */ + +#include "HotmailNotifier.h" + +/** LUFA CDC Class driver interface configuration and state information. This structure is + * passed to all CDC Class driver functions, so that multiple instances of the same class + * within a device can be differentiated from one another. + */ +USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = + { + .Config = + { + .ControlInterfaceNumber = 0, + + .DataINEndpointNumber = CDC_TX_EPNUM, + .DataINEndpointSize = CDC_TXRX_EPSIZE, + .DataINEndpointDoubleBank = false, + + .DataOUTEndpointNumber = CDC_RX_EPNUM, + .DataOUTEndpointSize = CDC_TXRX_EPSIZE, + .DataOUTEndpointDoubleBank = false, + + .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, + .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, + .NotificationEndpointDoubleBank = false, + }, + }; + +/** Counter for the software PWM */ +static volatile uint8_t SoftPWM_Count; + +/** Duty cycle for the first software PWM channel */ +static volatile uint8_t SoftPWM_Channel1_Duty; + +/** Duty cycle for the second software PWM channel */ +static volatile uint8_t SoftPWM_Channel2_Duty; + +/** Duty cycle for the third software PWM channel */ +static volatile uint8_t SoftPWM_Channel3_Duty; + + +/** Interrupt handler for managing the software PWM channels for the LEDs */ +ISR(TIMER0_COMPA_vect, ISR_BLOCK) +{ + uint8_t LEDMask = LEDS_ALL_LEDS; + + if (++SoftPWM_Count == 0x1F) + SoftPWM_Count = 0; + + if (SoftPWM_Count >= SoftPWM_Channel1_Duty) + LEDMask &= ~LEDS_LED1; + + if (SoftPWM_Count >= SoftPWM_Channel2_Duty) + LEDMask &= ~LEDS_LED2; + + if (SoftPWM_Count >= SoftPWM_Channel3_Duty) + LEDMask &= ~LEDS_LED3; + + LEDs_SetAllLEDs(LEDMask); +} + +/** Standard file stream for the CDC interface when set up, so that the virtual CDC COM port can be + * used like any regular character stream in the C APIs + */ +static FILE USBSerialStream; + +/** Main program entry point. This routine contains the overall program flow, including initial + * setup of all components and the main program loop. + */ +int main(void) +{ + SetupHardware(); + + /* Create a regular blocking character stream for the interface so that it can be used with the stdio.h functions */ + CDC_Device_CreateBlockingStream(&VirtualSerial_CDC_Interface, &USBSerialStream); + + for (;;) + { + /* Read in next LED colour command from the host */ + uint8_t ColorUpdate = fgetc(&USBSerialStream); + + /* Top 3 bits select the LED, bottom three control the brightness */ + uint8_t Channel = (ColorUpdate & 0b11100000); + uint8_t Duty = (ColorUpdate & 0b00011111); + + if (Channel & (1 << 5)) + SoftPWM_Channel1_Duty = Duty; + + if (Channel & (1 << 6)) + SoftPWM_Channel2_Duty = Duty; + + if (Channel & (1 << 7)) + SoftPWM_Channel3_Duty = Duty; + + CDC_Device_USBTask(&VirtualSerial_CDC_Interface); + USB_USBTask(); + } +} + +/** Configures the board hardware and chip peripherals for the demo's functionality. */ +void SetupHardware(void) +{ + /* Disable watchdog if enabled by bootloader/fuses */ + MCUSR &= ~(1 << WDRF); + wdt_disable(); + + /* Disable clock division */ + clock_prescale_set(clock_div_1); + + /* Hardware Initialization */ + LEDs_Init(); + USB_Init(); + + /* Timer Initialization */ + OCR0A = 100; + TCCR0A = (1 << WGM01); + TCCR0B = (1 << CS00); + TIMSK0 = (1 << OCIE0A); +} + +/** Event handler for the library USB Configuration Changed event. */ +void EVENT_USB_Device_ConfigurationChanged(void) +{ + CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); +} + +/** Event handler for the library USB Unhandled Control Request event. */ +void EVENT_USB_Device_UnhandledControlRequest(void) +{ + CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface); +} diff --git a/Projects/LEDNotifier/LEDNotifier.h b/Projects/LEDNotifier/LEDNotifier.h new file mode 100644 index 000000000..6ec85c115 --- /dev/null +++ b/Projects/LEDNotifier/LEDNotifier.h @@ -0,0 +1,59 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Header file for HotmailNotifier.c. + */ + +#ifndef _HOTMAILNOTIFIER_H_ +#define _HOTMAILNOTIFIER_H_ + + /* Includes: */ + #include + #include + #include + #include + #include + + #include "Descriptors.h" + + #include + #include + #include + #include + + /* Function Prototypes: */ + void SetupHardware(void); + + void EVENT_USB_Device_ConfigurationChanged(void); + void EVENT_USB_Device_UnhandledControlRequest(void); + +#endif diff --git a/Projects/LEDNotifier/LEDNotifier.txt b/Projects/LEDNotifier/LEDNotifier.txt new file mode 100644 index 000000000..f9314b77a --- /dev/null +++ b/Projects/LEDNotifier/LEDNotifier.txt @@ -0,0 +1,65 @@ +/** \file + * + * This file contains special DoxyGen information for the generation of the main page and other special + * documentation pages. It is not a project source file. + */ + +/** \mainpage Communications Device Class (Virtual Serial Port) Demo + * + * \section SSec_Compat Demo Compatibility: + * + * The following list indicates what microcontrollers are compatible with this demo. + * + * - AT90USB646 + * + * \section SSec_Info USB Information: + * + * The following table gives a rundown of the USB utilization of this demo. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
USB Mode:Device
USB Class:Communications Device Class (CDC)
USB Subclass:Abstract Control Model (ACM)
Relevant Standards:USBIF CDC Class Standard
Usable Speeds:Full Speed Mode
+ * + * \section SSec_Description Project Description: + * + * Hotmail Email Notifier Project. This project is designed for the Busware BUI board, however it can run easily on any + * USB AVR. It consists of a host application (written in C#) and a device firmware which work together to provide a + * visual mail notification system via the board's RGB LED. While the sample host application uses the Windows Live + * Messenger API for its email notifications, the hardware simply adjusts the LED color based on bytes sent to it - thus + * with a little coding, this project can be adapted for any sort of visual notification. + * + * To compile the host application, you will need Microsoft Visual Studio 2008 (the free Express edition should be + * sufficient) as well as a recent version of Windows Live Messenger installed. When run, you will need to set the COM port + * number used by the hardware on the host PC, whereupon the host will send new email notifications to the device. + * + * \section SSec_Options Project Options + * + * The following defines can be found in this project, which can control the project behaviour when defined, or changed in value. + * + * + * + * + * + *
+ * None + *
+ */ \ No newline at end of file diff --git a/Projects/LEDNotifier/LUFA HotmailNotifier.inf b/Projects/LEDNotifier/LUFA HotmailNotifier.inf deleted file mode 100644 index 4cdf59435..000000000 --- a/Projects/LEDNotifier/LUFA HotmailNotifier.inf +++ /dev/null @@ -1,106 +0,0 @@ -;************************************************************ -; Windows USB CDC ACM Setup File -; Copyright (c) 2000 Microsoft Corporation - - -[Version] -Signature="$Windows NT$" -Class=Ports -ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} -Provider=%MFGNAME% -LayoutFile=layout.inf -CatalogFile=%MFGFILENAME%.cat -DriverVer=11/15/2007,5.1.2600.0 - -[Manufacturer] -%MFGNAME%=DeviceList, NTamd64 - -[DestinationDirs] -DefaultDestDir=12 - - -;------------------------------------------------------------------------------ -; Windows 2000/XP/Vista-32bit Sections -;------------------------------------------------------------------------------ - -[DriverInstall.nt] -include=mdmcpq.inf -CopyFiles=DriverCopyFiles.nt -AddReg=DriverInstall.nt.AddReg - -[DriverCopyFiles.nt] -usbser.sys,,,0x20 - -[DriverInstall.nt.AddReg] -HKR,,DevLoader,,*ntkern -HKR,,NTMPDriver,,%DRIVERFILENAME%.sys -HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" - -[DriverInstall.nt.Services] -AddService=usbser, 0x00000002, DriverService.nt - -[DriverService.nt] -DisplayName=%SERVICE% -ServiceType=1 -StartType=3 -ErrorControl=1 -ServiceBinary=%12%\%DRIVERFILENAME%.sys - -;------------------------------------------------------------------------------ -; Vista-64bit Sections -;------------------------------------------------------------------------------ - -[DriverInstall.NTamd64] -include=mdmcpq.inf -CopyFiles=DriverCopyFiles.NTamd64 -AddReg=DriverInstall.NTamd64.AddReg - -[DriverCopyFiles.NTamd64] -%DRIVERFILENAME%.sys,,,0x20 - -[DriverInstall.NTamd64.AddReg] -HKR,,DevLoader,,*ntkern -HKR,,NTMPDriver,,%DRIVERFILENAME%.sys -HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" - -[DriverInstall.NTamd64.Services] -AddService=usbser, 0x00000002, DriverService.NTamd64 - -[DriverService.NTamd64] -DisplayName=%SERVICE% -ServiceType=1 -StartType=3 -ErrorControl=1 -ServiceBinary=%12%\%DRIVERFILENAME%.sys - - -;------------------------------------------------------------------------------ -; Vendor and Product ID Definitions -;------------------------------------------------------------------------------ -; When developing your USB device, the VID and PID used in the PC side -; application program and the firmware on the microcontroller must match. -; Modify the below line to use your VID and PID. Use the format as shown below. -; Note: One INF file can be used for multiple devices with different VID and PIDs. -; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. -;------------------------------------------------------------------------------ -[SourceDisksFiles] -[SourceDisksNames] -[DeviceList] -%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 - -[DeviceList.NTamd64] -%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 - - -;------------------------------------------------------------------------------ -; String Definitions -;------------------------------------------------------------------------------ -;Modify these strings to customize your device -;------------------------------------------------------------------------------ -[Strings] -MFGFILENAME="CDC_vista" -DRIVERFILENAME ="usbser" -MFGNAME="CCS, Inc." -INSTDISK="LUFA CDC Driver Installer" -DESCRIPTION="Communications Port" -SERVICE="USB RS-232 Emulation Driver" \ No newline at end of file diff --git a/Projects/LEDNotifier/LUFA LED Notifier.inf b/Projects/LEDNotifier/LUFA LED Notifier.inf new file mode 100644 index 000000000..4cdf59435 --- /dev/null +++ b/Projects/LEDNotifier/LUFA LED Notifier.inf @@ -0,0 +1,106 @@ +;************************************************************ +; Windows USB CDC ACM Setup File +; Copyright (c) 2000 Microsoft Corporation + + +[Version] +Signature="$Windows NT$" +Class=Ports +ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} +Provider=%MFGNAME% +LayoutFile=layout.inf +CatalogFile=%MFGFILENAME%.cat +DriverVer=11/15/2007,5.1.2600.0 + +[Manufacturer] +%MFGNAME%=DeviceList, NTamd64 + +[DestinationDirs] +DefaultDestDir=12 + + +;------------------------------------------------------------------------------ +; Windows 2000/XP/Vista-32bit Sections +;------------------------------------------------------------------------------ + +[DriverInstall.nt] +include=mdmcpq.inf +CopyFiles=DriverCopyFiles.nt +AddReg=DriverInstall.nt.AddReg + +[DriverCopyFiles.nt] +usbser.sys,,,0x20 + +[DriverInstall.nt.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,%DRIVERFILENAME%.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.nt.Services] +AddService=usbser, 0x00000002, DriverService.nt + +[DriverService.nt] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\%DRIVERFILENAME%.sys + +;------------------------------------------------------------------------------ +; Vista-64bit Sections +;------------------------------------------------------------------------------ + +[DriverInstall.NTamd64] +include=mdmcpq.inf +CopyFiles=DriverCopyFiles.NTamd64 +AddReg=DriverInstall.NTamd64.AddReg + +[DriverCopyFiles.NTamd64] +%DRIVERFILENAME%.sys,,,0x20 + +[DriverInstall.NTamd64.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,%DRIVERFILENAME%.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.NTamd64.Services] +AddService=usbser, 0x00000002, DriverService.NTamd64 + +[DriverService.NTamd64] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\%DRIVERFILENAME%.sys + + +;------------------------------------------------------------------------------ +; Vendor and Product ID Definitions +;------------------------------------------------------------------------------ +; When developing your USB device, the VID and PID used in the PC side +; application program and the firmware on the microcontroller must match. +; Modify the below line to use your VID and PID. Use the format as shown below. +; Note: One INF file can be used for multiple devices with different VID and PIDs. +; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. +;------------------------------------------------------------------------------ +[SourceDisksFiles] +[SourceDisksNames] +[DeviceList] +%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 + +[DeviceList.NTamd64] +%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044 + + +;------------------------------------------------------------------------------ +; String Definitions +;------------------------------------------------------------------------------ +;Modify these strings to customize your device +;------------------------------------------------------------------------------ +[Strings] +MFGFILENAME="CDC_vista" +DRIVERFILENAME ="usbser" +MFGNAME="CCS, Inc." +INSTDISK="LUFA CDC Driver Installer" +DESCRIPTION="Communications Port" +SERVICE="USB RS-232 Emulation Driver" \ No newline at end of file diff --git a/Projects/LEDNotifier/WindowsApp/MailNotifier.Designer.cs b/Projects/LEDNotifier/WindowsApp/MailNotifier.Designer.cs deleted file mode 100644 index 9e4734dc1..000000000 --- a/Projects/LEDNotifier/WindowsApp/MailNotifier.Designer.cs +++ /dev/null @@ -1,113 +0,0 @@ -namespace TestWinForms -{ - partial class MailNotifier - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.serSerialPort = new System.IO.Ports.SerialPort(this.components); - this.cmbComPort = new System.Windows.Forms.ComboBox(); - this.lblComPort = new System.Windows.Forms.Label(); - this.btnMinimize = new System.Windows.Forms.Button(); - this.btnExit = new System.Windows.Forms.Button(); - this.nicoNotifyIcon = new System.Windows.Forms.NotifyIcon(this.components); - this.SuspendLayout(); - // - // cmbComPort - // - this.cmbComPort.FormattingEnabled = true; - this.cmbComPort.Location = new System.Drawing.Point(108, 12); - this.cmbComPort.Name = "cmbComPort"; - this.cmbComPort.Size = new System.Drawing.Size(126, 21); - this.cmbComPort.TabIndex = 0; - this.cmbComPort.SelectedIndexChanged += new System.EventHandler(this.cmbComPort_SelectedIndexChanged); - // - // lblComPort - // - this.lblComPort.AutoSize = true; - this.lblComPort.Location = new System.Drawing.Point(12, 15); - this.lblComPort.Name = "lblComPort"; - this.lblComPort.Size = new System.Drawing.Size(90, 13); - this.lblComPort.TabIndex = 1; - this.lblComPort.Text = "COM Port to Use:"; - // - // btnMinimize - // - this.btnMinimize.Location = new System.Drawing.Point(12, 42); - this.btnMinimize.Name = "btnMinimize"; - this.btnMinimize.Size = new System.Drawing.Size(109, 23); - this.btnMinimize.TabIndex = 2; - this.btnMinimize.Text = "Minimize to Tray"; - this.btnMinimize.UseVisualStyleBackColor = true; - this.btnMinimize.Click += new System.EventHandler(this.btnMinimize_Click); - // - // btnExit - // - this.btnExit.Location = new System.Drawing.Point(131, 42); - this.btnExit.Name = "btnExit"; - this.btnExit.Size = new System.Drawing.Size(109, 23); - this.btnExit.TabIndex = 3; - this.btnExit.Text = "Exit"; - this.btnExit.UseVisualStyleBackColor = true; - this.btnExit.Click += new System.EventHandler(this.btnExit_Click); - // - // nicoNotifyIcon - // - this.nicoNotifyIcon.Text = "Mail Notifier"; - this.nicoNotifyIcon.Visible = true; - // - // MailNotifier - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(252, 77); - this.Controls.Add(this.btnExit); - this.Controls.Add(this.btnMinimize); - this.Controls.Add(this.lblComPort); - this.Controls.Add(this.cmbComPort); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.Name = "MailNotifier"; - this.Text = "Mail Notifier Light"; - this.WindowState = System.Windows.Forms.FormWindowState.Minimized; - this.Load += new System.EventHandler(this.MailNotifier_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.IO.Ports.SerialPort serSerialPort; - private System.Windows.Forms.ComboBox cmbComPort; - private System.Windows.Forms.Label lblComPort; - private System.Windows.Forms.Button btnMinimize; - private System.Windows.Forms.Button btnExit; - private System.Windows.Forms.NotifyIcon nicoNotifyIcon; - } -} - diff --git a/Projects/LEDNotifier/WindowsApp/MailNotifier.cs b/Projects/LEDNotifier/WindowsApp/MailNotifier.cs deleted file mode 100644 index 742948fca..000000000 --- a/Projects/LEDNotifier/WindowsApp/MailNotifier.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using Microsoft.Win32; - -namespace TestWinForms -{ - public partial class MailNotifier : Form - { - private MessengerAPI.Messenger Messenger; - private RegistryKey AppRegKey; - - private const int LIGHT_MAX = 0x1F; - - public MailNotifier() - { - InitializeComponent(); - - Messenger = new MessengerAPI.Messenger(); - AppRegKey = Registry.CurrentUser.CreateSubKey("Software\\MailNotifier"); - - for (int i = 1; i < 99; i++) - cmbComPort.Items.Add("COM" + i.ToString()); - - cmbComPort.SelectedIndex = System.Convert.ToInt32(AppRegKey.GetValue("Port", "1")) - 1; - serSerialPort.PortName = cmbComPort.Text; - - nicoNotifyIcon.Icon = this.Icon; - nicoNotifyIcon.MouseClick += new MouseEventHandler(TrayIconClick); - } - - private void MailNotifier_Load(object sender, EventArgs e) - { - Messenger.OnUnreadEmailChange += new MessengerAPI.DMessengerEvents_OnUnreadEmailChangeEventHandler(NewEmail); - - bool UnreadMail = (Messenger.get_UnreadEmailCount(MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) > 0); - NotifyLight((!UnreadMail ? LIGHT_MAX : 0), (UnreadMail ? LIGHT_MAX : 0), 0); - - Hide(); - } - - private void TrayIconClick(object sender, MouseEventArgs e) - { - this.Show(); - this.WindowState = FormWindowState.Normal; - } - - private void NewEmail(MessengerAPI.MUAFOLDER folder, int amount, ref bool enableDefault) - { - if (folder == MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) - { - bool UnreadMail = (Messenger.get_UnreadEmailCount(MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) > 0); - NotifyLight((!UnreadMail ? LIGHT_MAX : 0), (UnreadMail ? LIGHT_MAX : 0), 0); - } - } - - private void NotifyLight(int Red, int Green, int Blue) - { - byte[] buffer = new byte[3]; - buffer[0] = (byte)(0x80 | (Red & LIGHT_MAX)); - buffer[1] = (byte)(0x40 | (Green & LIGHT_MAX)); - buffer[2] = (byte)(0x20 | (Blue & LIGHT_MAX)); - - try - { - serSerialPort.Open(); - serSerialPort.Write(buffer, 0, buffer.Length); - serSerialPort.Close(); - } - catch (Exception e) - { - - } - } - - private void btnExit_Click(object sender, EventArgs e) - { - Application.Exit(); - } - - private void cmbComPort_SelectedIndexChanged(object sender, EventArgs e) - { - AppRegKey.SetValue("Port", cmbComPort.SelectedIndex + 1); - serSerialPort.PortName = cmbComPort.Text; - - for (int i = 1; i < 10; i++) - { - NotifyLight((LIGHT_MAX / i), (LIGHT_MAX / (i * 10)), 0); - System.Threading.Thread.Sleep(10); - } - - for (int i = 10; i > 0; i--) - { - NotifyLight((LIGHT_MAX / i), (LIGHT_MAX / (i * 10)), 0); - System.Threading.Thread.Sleep(10); - } - - bool UnreadMail = (Messenger.get_UnreadEmailCount(MessengerAPI.MUAFOLDER.MUAFOLDER_INBOX) > 0); - NotifyLight((!UnreadMail ? LIGHT_MAX : 0), (UnreadMail ? LIGHT_MAX : 0), 0); - } - - private void btnMinimize_Click(object sender, EventArgs e) - { - this.Hide(); - } - } -} diff --git a/Projects/LEDNotifier/WindowsApp/MailNotifier.csproj b/Projects/LEDNotifier/WindowsApp/MailNotifier.csproj deleted file mode 100644 index 3156b5d12..000000000 --- a/Projects/LEDNotifier/WindowsApp/MailNotifier.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {64376AAC-32C5-4A78-80CC-407A6B9824FE} - WinExe - Properties - MailNotifier - MailNotifier - v2.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - 3.5 - - - 3.5 - - - - - - - - - - Form - - - MailNotifier.cs - - - - - MailNotifier.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {E02AD29E-80F5-46C6-B416-9B3EBDDF057E} - 1 - 0 - 0 - tlbimp - False - - - - - \ No newline at end of file diff --git a/Projects/LEDNotifier/WindowsApp/MailNotifier.resx b/Projects/LEDNotifier/WindowsApp/MailNotifier.resx deleted file mode 100644 index bc1f8f67d..000000000 --- a/Projects/LEDNotifier/WindowsApp/MailNotifier.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 126, 17 - - \ No newline at end of file diff --git a/Projects/LEDNotifier/WindowsApp/Program.cs b/Projects/LEDNotifier/WindowsApp/Program.cs deleted file mode 100644 index 1dd229d91..000000000 --- a/Projects/LEDNotifier/WindowsApp/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace TestWinForms -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MailNotifier()); - } - } -} diff --git a/Projects/LEDNotifier/WindowsApp/Properties/AssemblyInfo.cs b/Projects/LEDNotifier/WindowsApp/Properties/AssemblyInfo.cs deleted file mode 100644 index 86b056454..000000000 --- a/Projects/LEDNotifier/WindowsApp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MailNotifier")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Dean Camera")] -[assembly: AssemblyProduct("Mail LED Notifier")] -[assembly: AssemblyCopyright("Public Domain")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("25e10140-cf96-4619-adaa-9010abc62d0a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Projects/LEDNotifier/WindowsApp/Properties/Resources.Designer.cs b/Projects/LEDNotifier/WindowsApp/Properties/Resources.Designer.cs deleted file mode 100644 index 8eb902684..000000000 --- a/Projects/LEDNotifier/WindowsApp/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MailNotifier.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MailNotifier.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Projects/LEDNotifier/WindowsApp/Properties/Resources.resx b/Projects/LEDNotifier/WindowsApp/Properties/Resources.resx deleted file mode 100644 index ffecec851..000000000 --- a/Projects/LEDNotifier/WindowsApp/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Projects/LEDNotifier/WindowsApp/Properties/Settings.Designer.cs b/Projects/LEDNotifier/WindowsApp/Properties/Settings.Designer.cs deleted file mode 100644 index bb55ab3e3..000000000 --- a/Projects/LEDNotifier/WindowsApp/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MailNotifier.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Projects/LEDNotifier/WindowsApp/Properties/Settings.settings b/Projects/LEDNotifier/WindowsApp/Properties/Settings.settings deleted file mode 100644 index abf36c5d3..000000000 --- a/Projects/LEDNotifier/WindowsApp/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - -- cgit v1.2.3