|
48 | 48 | //IEC0-IEC7 on PIC24FJ128GB204 Family devices |
49 | 49 | //IEC0-IEC7 on PIC24FJ256GB412 Family devices |
50 | 50 | #if defined(__PIC24FJ64GB004__) || defined(__PIC24FJ32GB004__) || defined(__PIC24FJ32GB004__) || defined(__PIC24FJ32GB002__) \ |
51 | | - || defined(__PIC24FJ256GB110__) || defined(__PIC24FJ192GB110__) || defined(__PIC24FJ128GB110__) || defined(__PIC24FJ64GB110__) || defined(__PIC24FJ256GB108__) || defined(__PIC24FJ192GB108__) || defined(__PIC24FJ128GB108__) || defined(__PIC24FJ64GB108__) || defined(__PIC24FJ256GB106__) || defined(__PIC24FJ192GB106__) || defined(__PIC24FJ128GB106__) || defined(__PIC24FJ64GB106__) \ |
52 | | - || defined(__PIC24FJ256GB210__) || defined(__PIC24FJ128GB210__) || defined(__PIC24FJ256GB206__) || defined(__PIC24FJ128GB206__) |
| 51 | + || defined(__PIC24FJ256GB110__) || defined(__PIC24FJ192GB110__) || defined(__PIC24FJ128GB110__) || defined(__PIC24FJ64GB110__) || defined(__PIC24FJ256GB108__) || defined(__PIC24FJ192GB108__) || defined(__PIC24FJ128GB108__) || defined(__PIC24FJ64GB108__) || defined(__PIC24FJ256GB106__) || defined(__PIC24FJ192GB106__) || defined(__PIC24FJ128GB106__) || defined(__PIC24FJ64GB106__) |
53 | 52 |
|
54 | 53 | #define DEVICE_SPECIFIC_IEC_REGISTER_COUNT 6 //Number of IECx registers implemented in the microcontroller (varies from device to device, make sure this is set correctly for the intended CPU) |
| 54 | + #define USB_HAL_VBUSTristate() //No GPIO driver on VBUS on these devices. |
| 55 | + |
| 56 | +#elif defined(__PIC24FJ256GB210__) || defined(__PIC24FJ128GB210__) || defined(__PIC24FJ256GB206__) || defined(__PIC24FJ128GB206__) |
| 57 | + |
| 58 | + #define DEVICE_SPECIFIC_IEC_REGISTER_COUNT 6 //Number of IECx registers implemented in the microcontroller (varies from device to device, make sure this is set correctly for the intended CPU) |
| 59 | + #define USB_HAL_VBUSTristate() {TRISFbits.TRISF7 = 1;} |
55 | 60 |
|
56 | 61 | #elif defined(__PIC24FJ256DA210__) || defined(__PIC24FJ128DA210__) || defined(__PIC24FJ256DA206__) || defined(__PIC24FJ128DA206__) || defined(__PIC24FJ256DA110__) || defined(__PIC24FJ128DA110__) || defined(__PIC24FJ256DA106__) || defined(__PIC24FJ128DA106__) |
57 | 62 |
|
58 | 63 | #define DEVICE_SPECIFIC_IEC_REGISTER_COUNT 7 //Number of IECx registers implemented in the microcontroller (varies from device to device, make sure this is set correctly for the intended CPU) |
| 64 | + #define USB_HAL_VBUSTristate() {TRISFbits.TRISF7 = 1;} |
59 | 65 |
|
60 | | -#elif defined(__PIC24FJ128GC010__) || defined(__PIC24FJ64GC010__) || defined(__PIC24FJ128GC006__) || defined(__PIC24FJ64GC006__) \ |
61 | | - || defined(__PIC24FJ128GB204__) || defined(__PIC24FJ64GB204) || defined(__PIC24FJ128GB202__) || defined(__PIC24FJ64GB202) |
| 66 | +#elif defined(__PIC24FJ128GB204__) || defined(__PIC24FJ64GB204__) || defined(__PIC24FJ128GB202__) || defined(__PIC24FJ64GB202__) |
62 | 67 |
|
63 | 68 | #define DEVICE_SPECIFIC_IEC_REGISTER_COUNT 8 //Number of IECx registers implemented in the microcontroller (varies from device to device, make sure this is set correctly for the intended CPU) |
| 69 | + #define USB_HAL_VBUSTristate() {TRISBbits.TRISB6 = 1;} |
64 | 70 |
|
| 71 | +#elif defined(__PIC24FJ128GC010__) || defined(__PIC24FJ64GC010__) || defined(__PIC24FJ128GC006__) || defined(__PIC24FJ64GC006__) \ |
| 72 | + || defined(__PIC24FJ128GB204__) || defined(__PIC24FJ64GB204__) || defined(__PIC24FJ128GB202__) || defined(__PIC24FJ64GB202__) \ |
| 73 | + || defined(__PIC24FJ256GB410__) || defined(__PIC24FJ256GB412__) || defined(__PIC24FJ256GB406__) \ |
| 74 | + || defined(__PIC24FJ128GB410__) || defined(__PIC24FJ128GB412__) || defined(__PIC24FJ128GB406__) \ |
| 75 | + || defined(__PIC24FJ64GB410__) || defined(__PIC24FJ64GB412__) || defined(__PIC24FJ64GB406__) |
| 76 | + #define DEVICE_SPECIFIC_IEC_REGISTER_COUNT 8 //Number of IECx registers implemented in the microcontroller (varies from device to device, make sure this is set correctly for the intended CPU) |
| 77 | + #define USB_HAL_VBUSTristate() {TRISFbits.TRISF7 = 1;} |
65 | 78 | #else |
66 | 79 | #error "Unknown processor type selected. Refer to device datasheet and update the definition for DEVICE_SPECIFIC_IEC_REGISTER_COUNT." |
67 | | - //#define DEVICE_SPECIFIC_IEC_REGISTER_COUNT 8 // <--- Update this number with the real number for your device and uncomment (and delete the above #error). |
| 80 | + //#define DEVICE_SPECIFIC_IEC_REGISTER_COUNT 8 // <--- Update this number with the real number for your device and uncomment (and delete the above #error). |
| 81 | + //#define USB_HAL_VBUSTristate() {TRISxbits.TRISxx = 1;} // <-- replace the "x" characters with the correct values for the VBUS GPIO pin (if the microcontroller selected has GPIO functionality on VBUS) |
| 82 | + |
68 | 83 | #endif |
69 | 84 |
|
70 | 85 |
|
|
83 | 98 | #endif |
84 | 99 |
|
85 | 100 |
|
86 | | -//----- USBEnableEndpoint() input defintions ---------------------------------- |
| 101 | +//----- USBEnableEndpoint() input definitions ---------------------------------- |
87 | 102 | #define USB_HANDSHAKE_ENABLED 0x01 |
88 | 103 | #define USB_HANDSHAKE_DISABLED 0x00 |
89 | 104 |
|
|
98 | 113 |
|
99 | 114 | #define USB_STALL_ENDPOINT 0x02 |
100 | 115 |
|
101 | | -//----- usb_config.h input defintions ----------------------------------------- |
| 116 | +//----- usb_config.h input definitions ----------------------------------------- |
102 | 117 | #define USB_PULLUP_ENABLE 0x00 |
103 | 118 | //#define USB_PULLUP_DISABLE 0x00 |
104 | 119 |
|
|
166 | 181 | #define USBRESUMEIFReg U1IR |
167 | 182 | #define USBRESUMEIFBitNum 5 |
168 | 183 |
|
169 | | -//----- Event call back defintions -------------------------------------------- |
| 184 | +//----- Event call back definitions -------------------------------------------- |
170 | 185 | #if defined(USB_DISABLE_SOF_HANDLER) |
171 | 186 | #define USB_SOF_INTERRUPT 0x00 |
172 | 187 | #else |
@@ -620,12 +635,12 @@ bool USBRemoteWakeupAssertBlocking(void); |
620 | 635 | that the read could not be performed (ex: if the comparators are currently off). |
621 | 636 |
|
622 | 637 | Specify true, if you want this function to perform a forceful read operation. |
623 | | - In this case, this function will turn on the USB module and/or un-suspend it if |
| 638 | + In this case, this function will turn on the USB module and/or unsuspend it if |
624 | 639 | needed, in order to read the actual value. The function will always return 0 or 1 |
625 | 640 | in this case. However, the function may block for as much time as required to |
626 | 641 | ensure that any necessary analog startup/settling/propagation times have |
627 | 642 | elapsed, so as to get an accurate reading. If invasive reads are allowed, and |
628 | | - this function turns on the USB module or un-suspends it, the module will remain |
| 643 | + this function turns on the USB module or unsuspends it, the module will remain |
629 | 644 | on and unsuspended subsequent to returning from this function. |
630 | 645 | It is the caller's responsibility to turn the USB module off if |
631 | 646 | desired/appropriate for the application (ex: because the returned value was |
|
0 commit comments