/
HardwareProfile - APPT.h
executable file
·155 lines (131 loc) · 6.72 KB
/
HardwareProfile - APPT.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/********************************************************************
FileName: HardwareProfile - PICDEM FSUSB.h
Dependencies: See INCLUDES section
Processor: PIC18 USB Microcontrollers
Hardware: PICDEM FSUSB
Compiler: Microchip C18
Company: Microchip Technology, Inc.
Software License Agreement:
The software supplied herewith by Microchip Technology Incorporated
(the “Company”) for its PIC® Microcontroller is intended and
supplied to you, the Company’s customer, for use solely and
exclusively on Microchip PIC Microcontroller products. The
software is owned by the Company and/or its supplier, and is
protected under applicable copyright laws. All rights are reserved.
Any use in violation of the foregoing restrictions may subject the
user to criminal sanctions under applicable laws, as well as to
civil liability for the breach of the terms and conditions of this
license.
THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
********************************************************************
File Description:
Change History:
Rev Date Description
1.0 11/19/2004 Initial release
2.1 02/26/2007 Updated for simplicity and to use common
coding style
2.3 09/15/2008 Broke out each hardware platform into its own
"HardwareProfile - xxx.h" file
********************************************************************/
#ifndef HARDWARE_PROFILE_APPT
#define HARDWARE_PROFILE_APPT
/*******************************************************************/
/******** USB stack hardware selection options *********************/
/*******************************************************************/
//This section is the set of definitions required by the MCHPFSUSB
// framework. These definitions tell the firmware what mode it is
// running in, and where it can find the results to some information
// that the stack needs.
//These definitions are required by every application developed with
// this revision of the MCHPFSUSB framework. Please review each
// option carefully and determine which options are desired/required
// for your application.
//The PICDEM FS USB Demo Board platform supports the USE_SELF_POWER_SENSE_IO
//and USE_USB_BUS_SENSE_IO features. Uncomment the below line(s) if
//it is desireable to use one or both of the features.
//#define USE_SELF_POWER_SENSE_IO
#define tris_self_power TRISAbits.TRISA2 // Input
#if defined(USE_SELF_POWER_SENSE_IO)
#define self_power PORTAbits.RA2
#else
#define self_power 1
#endif
#define USE_USB_BUS_SENSE_IO
#define tris_usb_bus_sense TRISCbits.TRISC6 // Input
#if defined(USE_USB_BUS_SENSE_IO)
#define USB_BUS_SENSE PORTCbits.RC6
#else
#define USB_BUS_SENSE 1
#endif
//Uncomment the following line to make the output HEX of this
// project work with the MCHPUSB Bootloader
//#define PROGRAMMABLE_WITH_USB_MCHPUSB_BOOTLOADER
//Uncomment the following line to make the output HEX of this
// project work with the HID Bootloader
#define PROGRAMMABLE_WITH_USB_HID_BOOTLOADER
/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/******** Application specific definitions *************************/
/*******************************************************************/
/*******************************************************************/
/*******************************************************************/
/** Board definition ***********************************************/
//These defintions will tell the main() function which board is
// currently selected. This will allow the application to add
// the correct configuration bits as wells use the correct
// initialization functions for the board. These defitions are only
// required in the stack provided demos. They are not required in
// final application design.
#define DEMO_BOARD APPT_BOARD
#define APPT_BOARD
#define CLOCK_FREQ 48000000
/** LED ************************************************************/
/*
#define mInitAllLEDs() LATD &= 0xF0; TRISD &= 0xF0;
#define mLED_1 LATDbits.LATD0
#define mLED_2 LATDbits.LATD1
#define mLED_3 LATDbits.LATD2
#define mLED_4 LATDbits.LATD3
#define mGetLED_1() mLED_1
#define mGetLED_2() mLED_2
#define mGetLED_3() mLED_3
#define mGetLED_4() mLED_4
#define mLED_1_On() mLED_1 = 1;
#define mLED_2_On() mLED_2 = 1;
#define mLED_3_On() mLED_3 = 1;
#define mLED_4_On() mLED_4 = 1;
#define mLED_1_Off() mLED_1 = 0;
#define mLED_2_Off() mLED_2 = 0;
#define mLED_3_Off() mLED_3 = 0;
#define mLED_4_Off() mLED_4 = 0;
#define mLED_1_Toggle() mLED_1 = !mLED_1;
#define mLED_2_Toggle() mLED_2 = !mLED_2;
#define mLED_3_Toggle() mLED_3 = !mLED_3;
#define mLED_4_Toggle() mLED_4 = !mLED_4;
*/
/** SWITCH *********************************************************/
#define mInitAllSwitches() TRISBbits.TRISB7=1;TRISBbits.TRISB6=1;
#define mInitSwitch2() TRISBbits.TRISB7=1;
#define mInitSwitch3() TRISBbits.TRISB6=1;
#define sw2 PORTBbits.RB7
#define sw3 PORTBbits.RB6
/** USB external transceiver interface (optional) ******************/
/*
#define tris_usb_vpo TRISBbits.TRISB3 // Output
#define tris_usb_vmo TRISBbits.TRISB2 // Output
#define tris_usb_rcv TRISAbits.TRISA4 // Input
#define tris_usb_vp TRISCbits.TRISC5 // Input
#define tris_usb_vm TRISCbits.TRISC4 // Input
#define tris_usb_oe TRISCbits.TRISC1 // Output
#define tris_usb_suspnd TRISAbits.TRISA3 // Output
*/
/** I/O pin definitions ********************************************/
#define INPUT_PIN 1
#define OUTPUT_PIN 0
#endif //HARDWARE_PROFILE_APPT