文件名称:STM8S-USB-master
介绍说明--下载内容来自于网络,使用问题请自行百度
这是一个stm8S003模拟USB键盘HID的程序,首先,通过中断来接收USB数据,接收完后,调用 void usb_rx_ok(void) 来应答或不应答,并识别数据包,把相应的状态写usb这个结构体里面。
然后,在主循环中不断的调用 void usb_process(void) 来根据 usb 里面的状态来做相应的动作。
设备描述符的发送是这样的:调用 void usb_send_data(uint8_t * buffer, uint8_t lenght), 将描述符打包,放到 usb.tx_buffer 里面,然后将状态改为已经准备好发送usb.event = USB_EVENT_READY_DATA_IN,等待主机发送 DATA IN 包。
usb_rx_ok 识别到 DATA IN 包并且 usb.event 为准备发送, 就会调用 void usb_send_answer(void) 来完成数据发送。-This is an analog stm8S003 HID USB keyboard procedures, first, the received USB data to the interrupt, after receiving call void usb_rx_ok (void) to answer or not to answer, and the identification data packet, to write the corresponding status of this structure usb inside.
Then, in the main loop continually calls void usb_process (void) to do the appropriate action according to usb inside the state.
Send device descr iptor is this: call void usb_send_data (uint8_t* buffer, uint8_t lenght), the descr iptor packaged into usb.tx_buffer inside, then the state is ready to send usb.event = USB_EVENT_READY_DATA_IN, waiting for the host send DATA IN packets.
usb_rx_ok recognized DATA IN packets and usb.event is ready to send, it will call the void usb_send_answer (void) to complete the data transmission.
然后,在主循环中不断的调用 void usb_process(void) 来根据 usb 里面的状态来做相应的动作。
设备描述符的发送是这样的:调用 void usb_send_data(uint8_t * buffer, uint8_t lenght), 将描述符打包,放到 usb.tx_buffer 里面,然后将状态改为已经准备好发送usb.event = USB_EVENT_READY_DATA_IN,等待主机发送 DATA IN 包。
usb_rx_ok 识别到 DATA IN 包并且 usb.event 为准备发送, 就会调用 void usb_send_answer(void) 来完成数据发送。-This is an analog stm8S003 HID USB keyboard procedures, first, the received USB data to the interrupt, after receiving call void usb_rx_ok (void) to answer or not to answer, and the identification data packet, to write the corresponding status of this structure usb inside.
Then, in the main loop continually calls void usb_process (void) to do the appropriate action according to usb inside the state.
Send device descr iptor is this: call void usb_send_data (uint8_t* buffer, uint8_t lenght), the descr iptor packaged into usb.tx_buffer inside, then the state is ready to send usb.event = USB_EVENT_READY_DATA_IN, waiting for the host send DATA IN packets.
usb_rx_ok recognized DATA IN packets and usb.event is ready to send, it will call the void usb_send_answer (void) to complete the data transmission.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
STM8S-USB-master/device/usb/usb.c
STM8S-USB-master/device/usb/usb.h
STM8S-USB-master/device/usb/usb_rx.S
STM8S-USB-master/device/usb/usb_tx.S
STM8S-USB-master/LICENSE
STM8S-USB-master/main.c
STM8S-USB-master/main.h
STM8S-USB-master/Makefile
STM8S-USB-master/mcu/peripherals/mcu_gpio.h
STM8S-USB-master/mcu/std_lib/inc/stm8s.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_adc1.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_adc2.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_awu.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_beep.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_can.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_clk.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_exti.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_flash.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_gpio.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_i2c.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_itc.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_iwdg.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_rst.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_spi.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim1.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim2.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim3.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim4.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim5.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim6.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_uart1.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_uart2.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_uart3.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_wwdg.h
STM8S-USB-master/mcu/std_lib/Release_Notes.html
STM8S-USB-master/mcu/std_lib/src/stm8s_adc1.c
STM8S-USB-master/mcu/std_lib/src/stm8s_adc2.c
STM8S-USB-master/mcu/std_lib/src/stm8s_awu.c
STM8S-USB-master/mcu/std_lib/src/stm8s_beep.c
STM8S-USB-master/mcu/std_lib/src/stm8s_can.c
STM8S-USB-master/mcu/std_lib/src/stm8s_clk.c
STM8S-USB-master/mcu/std_lib/src/stm8s_exti.c
STM8S-USB-master/mcu/std_lib/src/stm8s_flash.c
STM8S-USB-master/mcu/std_lib/src/stm8s_gpio.c
STM8S-USB-master/mcu/std_lib/src/stm8s_i2c.c
STM8S-USB-master/mcu/std_lib/src/stm8s_itc.c
STM8S-USB-master/mcu/std_lib/src/stm8s_iwdg.c
STM8S-USB-master/mcu/std_lib/src/stm8s_rst.c
STM8S-USB-master/mcu/std_lib/src/stm8s_spi.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim1.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim2.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim3.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim4.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim5.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim6.c
STM8S-USB-master/mcu/std_lib/src/stm8s_uart1.c
STM8S-USB-master/mcu/std_lib/src/stm8s_uart2.c
STM8S-USB-master/mcu/std_lib/src/stm8s_uart3.c
STM8S-USB-master/mcu/std_lib/src/stm8s_wwdg.c
STM8S-USB-master/mcu/stm8s003f3.ini
STM8S-USB-master/mcu/stm8s003f3.lsf
STM8S-USB-master/mcu/stm8s_conf.h
STM8S-USB-master/mcu/stm8s_it.c
STM8S-USB-master/mcu/stm8s_it.h
STM8S-USB-master/mcu/stm8_interrupt_vector.c
STM8S-USB-master/README.md
STM8S-USB-master/source insight/Untitled Project.IAB
STM8S-USB-master/source insight/Untitled Project.IAD
STM8S-USB-master/source insight/Untitled Project.IMB
STM8S-USB-master/source insight/Untitled Project.IMD
STM8S-USB-master/source insight/Untitled Project.PFI
STM8S-USB-master/source insight/Untitled Project.PO
STM8S-USB-master/source insight/Untitled Project.PR
STM8S-USB-master/source insight/Untitled Project.PRI
STM8S-USB-master/source insight/Untitled Project.PS
STM8S-USB-master/source insight/Untitled Project.WK3
STM8S-USB-master/target/target.s19
STM8S-USB-master/utility/macros.c
STM8S-USB-master/utility/macros.h
STM8S-USB-master/mcu/std_lib/inc
STM8S-USB-master/mcu/std_lib/src
STM8S-USB-master/device/usb
STM8S-USB-master/mcu/peripherals
STM8S-USB-master/mcu/std_lib
STM8S-USB-master/device
STM8S-USB-master/mcu
STM8S-USB-master/source insight
STM8S-USB-master/target
STM8S-USB-master/utility
STM8S-USB-master
STM8S-USB-master/device/usb/usb.h
STM8S-USB-master/device/usb/usb_rx.S
STM8S-USB-master/device/usb/usb_tx.S
STM8S-USB-master/LICENSE
STM8S-USB-master/main.c
STM8S-USB-master/main.h
STM8S-USB-master/Makefile
STM8S-USB-master/mcu/peripherals/mcu_gpio.h
STM8S-USB-master/mcu/std_lib/inc/stm8s.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_adc1.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_adc2.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_awu.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_beep.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_can.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_clk.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_exti.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_flash.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_gpio.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_i2c.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_itc.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_iwdg.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_rst.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_spi.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim1.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim2.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim3.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim4.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim5.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_tim6.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_uart1.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_uart2.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_uart3.h
STM8S-USB-master/mcu/std_lib/inc/stm8s_wwdg.h
STM8S-USB-master/mcu/std_lib/Release_Notes.html
STM8S-USB-master/mcu/std_lib/src/stm8s_adc1.c
STM8S-USB-master/mcu/std_lib/src/stm8s_adc2.c
STM8S-USB-master/mcu/std_lib/src/stm8s_awu.c
STM8S-USB-master/mcu/std_lib/src/stm8s_beep.c
STM8S-USB-master/mcu/std_lib/src/stm8s_can.c
STM8S-USB-master/mcu/std_lib/src/stm8s_clk.c
STM8S-USB-master/mcu/std_lib/src/stm8s_exti.c
STM8S-USB-master/mcu/std_lib/src/stm8s_flash.c
STM8S-USB-master/mcu/std_lib/src/stm8s_gpio.c
STM8S-USB-master/mcu/std_lib/src/stm8s_i2c.c
STM8S-USB-master/mcu/std_lib/src/stm8s_itc.c
STM8S-USB-master/mcu/std_lib/src/stm8s_iwdg.c
STM8S-USB-master/mcu/std_lib/src/stm8s_rst.c
STM8S-USB-master/mcu/std_lib/src/stm8s_spi.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim1.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim2.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim3.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim4.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim5.c
STM8S-USB-master/mcu/std_lib/src/stm8s_tim6.c
STM8S-USB-master/mcu/std_lib/src/stm8s_uart1.c
STM8S-USB-master/mcu/std_lib/src/stm8s_uart2.c
STM8S-USB-master/mcu/std_lib/src/stm8s_uart3.c
STM8S-USB-master/mcu/std_lib/src/stm8s_wwdg.c
STM8S-USB-master/mcu/stm8s003f3.ini
STM8S-USB-master/mcu/stm8s003f3.lsf
STM8S-USB-master/mcu/stm8s_conf.h
STM8S-USB-master/mcu/stm8s_it.c
STM8S-USB-master/mcu/stm8s_it.h
STM8S-USB-master/mcu/stm8_interrupt_vector.c
STM8S-USB-master/README.md
STM8S-USB-master/source insight/Untitled Project.IAB
STM8S-USB-master/source insight/Untitled Project.IAD
STM8S-USB-master/source insight/Untitled Project.IMB
STM8S-USB-master/source insight/Untitled Project.IMD
STM8S-USB-master/source insight/Untitled Project.PFI
STM8S-USB-master/source insight/Untitled Project.PO
STM8S-USB-master/source insight/Untitled Project.PR
STM8S-USB-master/source insight/Untitled Project.PRI
STM8S-USB-master/source insight/Untitled Project.PS
STM8S-USB-master/source insight/Untitled Project.WK3
STM8S-USB-master/target/target.s19
STM8S-USB-master/utility/macros.c
STM8S-USB-master/utility/macros.h
STM8S-USB-master/mcu/std_lib/inc
STM8S-USB-master/mcu/std_lib/src
STM8S-USB-master/device/usb
STM8S-USB-master/mcu/peripherals
STM8S-USB-master/mcu/std_lib
STM8S-USB-master/device
STM8S-USB-master/mcu
STM8S-USB-master/source insight
STM8S-USB-master/target
STM8S-USB-master/utility
STM8S-USB-master
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.