bzr branch
http://bzr.ed.am/elec/audio-switcher
1
by Tim Marston
initial commit |
1 |
/* |
7
by Tim Marston
cleaned up project |
2 |
|
3 |
AUDIO SWITCHER |
|
4 |
||
5 |
Based on a serial device demonstration from the LUFA project |
|
6 |
(www.lufa-lib.org). LUFA is Copyright (C) Dean Camera, 2012. |
|
7 |
||
8 |
Changes made to the serial device demonstration program are |
|
9 |
Copyright (C) Tim Marston, 2012. |
|
10 |
||
11 |
For more information: |
|
12 |
* see README, or |
|
13 |
* visit http://ed.am/ |
|
14 |
||
1
by Tim Marston
initial commit |
15 |
*/ |
16 |
||
17 |
/* |
|
18 |
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) |
|
19 |
||
20 |
Permission to use, copy, modify, distribute, and sell this |
|
21 |
software and its documentation for any purpose is hereby granted |
|
22 |
without fee, provided that the above copyright notice appear in |
|
23 |
all copies and that both that the copyright notice and this |
|
24 |
permission notice and warranty disclaimer appear in supporting |
|
25 |
documentation, and that the name of the author not be used in |
|
26 |
advertising or publicity pertaining to distribution of the |
|
27 |
software without specific, written prior permission. |
|
28 |
||
29 |
The author disclaim all warranties with regard to this |
|
30 |
software, including all implied warranties of merchantability |
|
31 |
and fitness. In no event shall the author be liable for any |
|
32 |
special, indirect or consequential damages or any damages |
|
33 |
whatsoever resulting from loss of use, data or profits, whether |
|
34 |
in an action of contract, negligence or other tortious action, |
|
35 |
arising out of or in connection with the use or performance of |
|
36 |
this software. |
|
37 |
*/ |
|
38 |
||
39 |
/** \file |
|
40 |
* |
|
41 |
* Header file for VirtualSerial.c. |
|
42 |
*/ |
|
43 |
||
44 |
#ifndef _VIRTUALSERIAL_H_ |
|
45 |
#define _VIRTUALSERIAL_H_ |
|
46 |
||
47 |
/* Includes: */ |
|
48 |
#include <avr/io.h> |
|
49 |
#include <avr/wdt.h> |
|
50 |
#include <avr/power.h> |
|
51 |
#include <avr/interrupt.h> |
|
52 |
#include <string.h> |
|
53 |
#include <stdio.h> |
|
54 |
||
55 |
#include "Descriptors.h" |
|
56 |
||
3
by Tim Marston
added timer utilities (wiring.c) from arduino library |
57 |
#include <LUFA/Version.h> |
1
by Tim Marston
initial commit |
58 |
#include <LUFA/Drivers/Board/LEDs.h> |
59 |
#include <LUFA/Drivers/USB/USB.h> |
|
60 |
||
61 |
/* Macros: */ |
|
62 |
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ |
|
63 |
#define LEDMASK_USB_NOTREADY LEDS_LED1 |
|
64 |
||
65 |
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */ |
|
66 |
#define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3) |
|
67 |
||
68 |
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */ |
|
69 |
#define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4) |
|
70 |
||
71 |
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ |
|
72 |
#define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3) |
|
73 |
||
74 |
/* Function Prototypes: */ |
|
75 |
void SetupHardware(void); |
|
76 |
||
77 |
void EVENT_USB_Device_Connect(void); |
|
78 |
void EVENT_USB_Device_Disconnect(void); |
|
79 |
void EVENT_USB_Device_ConfigurationChanged(void); |
|
80 |
void EVENT_USB_Device_ControlRequest(void); |
|
81 |
||
82 |
#endif |
|
83 |