/********************************************************************
File Information:
FileName: usb_device.c
Dependencies: See INCLUDES section
Processor: PIC18,PIC24, PIC32 and dsPIC33E USB Microcontrollers
Hardware: This code is natively intended to be used on Mirochip USB
demo boards. See www.microchip.com/usb (Software & Tools
section) for list of available platforms. The firmware may
be modified for use on other USB platforms by editing the
HardwareProfile.h and HardwareProfile - [platform].h files.
Complier: Microchip C18 (for PIC18),C30 (for PIC24 and dsPIC33E)
and C32 (for PIC32)
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 Companys 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.
Summary:
This file contains functions, macros, definitions, variables,
datatypes, etc. that are required for usage with the MCHPFSUSB device
stack. This file should be included in projects that use the device stack.
This file is located in the "\<Install Directory\>\\Microchip\\USB"
directory.
Description:
USB Device Stack File
This file contains functions, macros, definitions, variables,
datatypes, etc. that are required for usage with the MCHPFSUSB device
stack. This file should be included in projects that use the device stack.
This file is located in the "\<Install Directory\>\\Microchip\\USB"
directory.
When including this file in a new project, this file can either be
referenced from the directory in which it was installed or copied
directly into the user application folder. If the first method is
chosen to keep the file located in the folder in which it is installed
then include paths need to be added so that the library and the
application both know where to reference each others files. If the
application folder is located in the same folder as the Microchip
folder (like the current demo folders), then the following include
paths need to be added to the application's project:
.
..\\..\\MicrochipInclude
If a different directory structure is used, modify the paths as
required. An example using absolute paths instead of relative paths
would be the following:
C:\\Microchip Solutions\\Microchip\\Include
C:\\Microchip Solutions\\My Demo Application
********************************************************************
File Description:
Change History:
Rev Description
---- -----------
2.6 Added USBCancelIO() function. Moved and some stack
defintions to be more consistant with the host stack.
2.6a Fixed issue where a SET_CONFIGURATION received could cause
inability to transmit on an endpoint if using ping-pong
and an odd number of packets had been sent on that endpoint
2.7 Fixed error where the USB error interrupt flag was not getting
cleared properly for PIC32 resulting in lots of extra error interrupts.
http://www.microchip.com/forums/tm.aspx?m=479085
Fixed issue with dual role mode when device run in polling
mode. Interrupts were remaining enabled after the host mode
operation was complete. This was incompatible with polling
mode operation.
Changed how the bus sensing works. In previous revisions it
was impossible to use the USBDeviceDetach to detach from the
bus if the bus voltage was still present. This is now
possible. It was also possible to move the device to the
ATTACHED state in interrupt mode even if the bus voltage
wasn't available. This is now prohibited unless VBUS is
present.
Improved error case handling when the host sends more OUT
bytes in a control transfer than the firmware was expecting
to receive (based on the size parameter when calling USBEP0Receive()).
In the USBStdSetCfgHandler(), modified the code so the USBDeviceState
variable only gets updated to the CONFIGURED_STATE at the end of the
function.
2.7a Update to support the PIC18F47J53 A1 and later revision
devices.
Fixed an error on 16-bit and 32-bit processors where a word access
could be performed on a byte pointer resulting in possible address
errors with odd aligned pointers.
2.8 Several changes to the way control transfers get processed,
so as to support the ability to allow application/class specific
handler code to defer the status stage.
Implemented USBCtrlEPAllowStatusStage() API function.
Implemented USBDeferStatusStage() API function (macro).
These changes also greatly relax the USBDeviceTasks() calling frequency
requirement, while allowing USB class handlers more flexibility.
Also implemented the following API functions and macros, for delaying
the data stage of a control transfer (with data stage):
USBDeferINDataStage()
USBDeferOUTDataStage()
USBOUTDataStageDeferred()
USBINDataStageDeferred()
USBCtrlEPAllowDataStage()
Fixed USB reset event handler issue, where the USB stack would
re-initialize global interrupt settings in the interrupt context, on
PIC18 devices with the stack operated in USB_INTERRUPT mode.
Fixed handling of SET/CLEAR FEATURE (endpoint halt) host requests.
Previous implementation would not always initialize endpoints correctly
to DATA0 DTS state after a clear feature endpoint halt request, for
all ping pong mode and usage scenarios.
********************************************************************/
/*----------------------------------------------------------------------------------
The USBDeviceTasks() function is responsible for detecting and processing various
USB bus events and host requests, such as those required for USB enumeration, when
the USB cable is first attached to the host. This function is the main dispatcher
routine for the USB stack.
Additional API functions and macros are also provided by the USB stack, which can be
used to send/receive USB data to/from the host, among other things. A full list
of the available implemented functions/macros are provided in the
"MCHPFSUSB Library Help". For normal installations of the MCHPFSUSB Framework,
the USB API documentation can be found from:
Start menu --> (All Programs) --> Microchip --> MCHPFSUSB vX.x --> Documents --> MCHPFSUSB Library Help
Once the help file is opened, the API functions/macros are described in the following section:
Library
没有合适的资源?快使用搜索试试~ 我知道了~
wrk_8_base_perfect_pwm_remap.zip_Design It!_PWM PIC18f_hattps//8
共66个文件
h:23个
c:13个
o:13个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 134 浏览量
2022-07-14
22:06:54
上传
评论
收藏 324KB ZIP 举报
温馨提示
pic18f example project for mplab. it includes pwm with pin remap. uart, delay using timer0. Good design style. Question, mail urenhu@yahoo.com
资源推荐
资源详情
资源评论
收起资源包目录
wrk_8_base_perfect_pwm_remap.zip (66个子文件)
wrk_8_base_perfect_pwm_remap
keypad.h 157B
prj.vpwhist 4KB
usr_usart.c 7KB
usr_delay.o 2KB
HardwareProfile.h 464B
interrupts.err 153B
interrupts.c 6KB
usb_descriptors.i 3KB
usb_descriptors.o 10KB
interrupts.o 11KB
usr_pwm.h 132B
soft_start.h 864B
prj.vpj 6KB
main.c 12KB
cdc_base.map 164KB
usr_adc.err 446B
usr_timers.h 232B
usr_adc.h 213B
usr_delay.h 160B
interrupts.h 121B
usr_pwm.o 3KB
usr_pwm.c 3KB
usr_timers.c 3KB
usb_function_cdc.o 36KB
soft_start.o 11KB
defines.h 316B
prj.vtg 376KB
USB
usb_common.h 25KB
usb_device.h 71KB
usb_hal.h 22KB
usb_function_cdc.i 1KB
usb_hal_pic18.h 19KB
usb_function_cdc.err 239B
usb_device.c 113KB
usb_function_cdc.c 28KB
usb_ch9.h 29KB
usb_device_local.h 21KB
usb.h 6KB
usb_function_cdc.h 22KB
main.err 444B
usr_timers.o 2KB
prj.vpw 199B
common
GenericTypeDefs.h 16KB
Compiler.h 7KB
usr_usart.o 11KB
HardwareProfile - PIC18F Starter Kit.h 2KB
usr_adc.c 3KB
usr_usart.h 641B
usb_config.h 5KB
cdc_base.cof 212KB
usr_adc.o 6KB
usb_descriptors.c 13KB
cdc_base.mcs 303B
ports.c 3KB
usr_delay.c 1KB
CleanUp.bat 2KB
cdc_base.hex 28KB
ports.o 3KB
ports.h 98B
main.o 22KB
usb_device.o 103KB
soft_start.c 11KB
cdc_base.mcp 4KB
keypad.o 18KB
keypad.c 3KB
usb_descriptors.err 261B
共 66 条
- 1
资源评论
邓凌佳
- 粉丝: 65
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功