亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usb_drv.h

?? avr USBusbdemoavr USBusbdemo
?? H
?? 第 1 頁 / 共 3 頁
字號:

   //! enables host start of frame interrupt
   #define Host_enable_sof_interrupt()            (UHIEN |= (1<<HSOFE))
   //! enables host start of frame interrupt
   #define Host_disable_sof_interrupt()           (UHIEN &= ~(1<<HSOFE))
#define Is_host_sof_interrupt_enabled()        ((UHIEN &  (1<<HSOFE))   ? TRUE : FALSE)
   //! tests if SOF detected
#define Host_is_sof()                          ((UHINT & (1<<HSOFI)) ? TRUE : FALSE)
#define Is_host_sof()                          ((UHINT & (1<<HSOFI)) ? TRUE : FALSE)
#define Host_ack_sof()                         (UHINT &= ~(1<<HSOFI))

   //! enables host wake up interrupt detection
#define Host_enable_hwup_interrupt()            (UHIEN |= (1<<HWUPE))
   //! disables host wake up interrupt detection
#define Host_disable_hwup_interrupt()           (UHIEN &= ~(1<<HWUPE))
#define Is_host_hwup_interrupt_enabled()        ((UHIEN &  (1<<HWUPE))   ? TRUE : FALSE)
   //! tests if host wake up detected
#define Host_is_hwup()                          ((UHINT & (1<<HWUPI)) ? TRUE : FALSE)
   //! Ack host wake up detection
#define Is_host_hwup()                          ((UHINT & (1<<HWUPI)) ? TRUE : FALSE)
#define Host_ack_hwup()                         (UHINT &= ~(1<<HWUPI))

   //! enables host down stream rsm sent interrupt detection
#define Host_enable_down_stream_resume_interrupt()            (UHIEN |= (1<<RSMEDE))
   //! disables host down stream rsm sent interrupt detection
#define Host_disable_down_stream_resume_interrupt()           (UHIEN &= ~(1<<RSMEDE))
#define Is_host_down_stream_resume_interrupt_enabled()        ((UHIEN &  (1<<RSMEDE))   ? TRUE : FALSE)
   //! Ack host down stream resume sent
#define Is_host_down_stream_resume()                          ((UHINT & (1<<RSMEDI)) ? TRUE : FALSE)
#define Host_ack_down_stream_resume()                         (UHINT &= ~(1<<RSMEDI))

   //! enables host remote wake up interrupt detection
#define Host_enable_remote_wakeup_interrupt()         (UHIEN |= (1<<RXRSME))
   //! disables host remote wake up interrupt detection
#define Host_disable_remote_wakeup_interrupt()        (UHIEN &= ~(1<<RXRSME))
#define Is_host_remote_wakeup_interrupt_enabled()     ((UHIEN &  (1<<RXRSME))   ? TRUE : FALSE)
   //! tests if host wake up detected
#define Host_is_remote_wakeup()                       ((UHINT & (1<<RXRSMI)) ? TRUE : FALSE)
   //! Ack host wake up detection
#define Is_host_remote_wakeup()                       ((UHINT & (1<<RXRSMI)) ? TRUE : FALSE)
#define Host_ack_remote_wakeup()                      (UHINT &= ~(1<<RXRSMI))

   //! enables host device connection interrupt
#define Host_enable_device_connection_interrupt()        (UHIEN |= (1<<DCONNE))
   //! disables USB device connection interrupt
#define Host_disable_device_connection_interrupt()    (UHIEN &= ~(1<<DCONNE))
#define Is_host_device_connection_interrupt_enabled()    ((UHIEN &  (1<<DCONNE))   ? TRUE : FALSE)
   //! tests if a USB device has been detected
#define Is_device_connection()                 (UHINT & (1<<DCONNI))
   //! acks device connection
#define Host_ack_device_connection()           (UHINT = ~(1<<DCONNI))

   //! enables host device disconnection interrupt
#define Host_enable_device_disconnection_interrupt()     (UHIEN |= (1<<DDISCE))
   //! disables USB device connection interrupt
#define Host_disable_device_disconnection_interrupt()    (UHIEN &= ~(1<<DDISCE))
#define Is_host_device_disconnection_interrupt_enabled() ((UHIEN &  (1<<DDISCE))   ? TRUE : FALSE)
   //! tests if a USB device has been removed
#define Is_device_disconnection()              (UHINT & (1<<DDISCI)   ? TRUE : FALSE)
   //! acks device disconnection
#define Host_ack_device_disconnection()        (UHINT = ~(1<<DDISCI))

   //! enables host USB reset interrupt
#define Host_enable_reset_interrupt()          (UHIEN   |=  (1<<RSTE))
   //! disables host USB reset interrupt
#define Host_disable_reset_interrupt()         (UHIEN   &= ~(1<<RSTE))
#define Is_host_reset_interrupt_enabled()      ((UHIEN &  (1<<RSTE))   ? TRUE : FALSE)
   //! acks host USB reset sent
#define Host_ack_reset()                       (UHINT   = ~(1<<RSTI))
   //! tests if USB reset has been sent
#define Is_host_reset()                        Host_is_reset()


   //! switches on VBus
#define Host_vbus_request()                    (OTGCON |= (1<<VBUSREQ))
   //! switches off VBus
#define Host_clear_vbus_request()              (OTGCON |= (1<<VBUSRQC))
   //! configures the address to use for the device
#define Host_configure_address(addr)           (UHADDR = addr & MSK_HADDR)

   //! Get connected device speed, returns TRUE when in full speed mode
#define Is_host_full_speed()                   ((USBSTA &  (1<<SPEED))   ? TRUE : FALSE)
//! @}



//! @defgroup general_pipe USB pipe drivers
//! These macros manage the common features of the pipes.
//! @{
   //! selects pipe for CPU interface
#define Host_select_pipe(p)                    (UPNUM = (U8)p)

   //! get the currently selected pipe number
#define Host_get_selected_pipe()              (UPNUM )

   //! enables pipe
#define Host_enable_pipe()                     (UPCONX |= (1<<PEN))
   //! disables pipe
#define Host_disable_pipe()                    (UPCONX &= ~(1<<PEN))

   //! sets SETUP token
#define Host_set_token_setup()                 (UPCFG0X =  UPCFG0X & ~MSK_TOKEN_SETUP)
   //! sets IN token
#define Host_set_token_in()                    (UPCFG0X = (UPCFG0X & ~MSK_TOKEN_SETUP) | MSK_TOKEN_IN)
   //! sets OUT token
#define Host_set_token_out()                   (UPCFG0X = (UPCFG0X & ~MSK_TOKEN_SETUP) | MSK_TOKEN_OUT)

   //! returns the number of the endpoint associated to the current pipe
#define Host_get_endpoint_number()             (UPCFG0X & (MSK_PEPNUM))

   //! returns pipe interrupt register
#define Host_get_pipe_interrupt()              (UPINT)

   //! sets the interrupt frequency
#define Host_set_interrupt_frequency(frq)      (UPCFG2X = (U8)frq)

   //! tests if current pipe is configured
#define Is_pipe_configured()                   (UPSTAX  &  (1<<CFGOK))
   //! tests if at least one bank is busy
#define Is_host_one_bank_busy()                ((UPSTAX &  (1<<MSK_NBUSYBK)) != 0)
   //! returns the number of busy banks
#define Host_number_of_busy_bank()             (UPSTAX &  (1<<MSK_NBUSYBK))

   //! resets the pipe
#define Host_reset_pipe(p)                     (UPRST = 1<<p , UPRST = 0)

   //! writes a byte into the pipe FIFO
#define Host_write_byte(dat)                   (UPDATX = dat)
   //! reads a byte from the pipe FIFO
#define Host_read_byte()                       (UPDATX)

   //! freezes the pipe
#define Host_freeze_pipe()                     (UPCONX |=  (1<<PFREEZE))
   //! un-freezees the pipe
#define Host_unfreeze_pipe()                   (UPCONX &= ~(1<<PFREEZE))
   //! tests if the current pipe is frozen
#define Is_host_pipe_freeze()                  (UPCONX &   (1<<PFREEZE))

   //! resets data toggle
#define Host_reset_pipe_data_toggle()          (UPCONX |=  (1<<RSTDT)  )

   //! tests if SETUP has been sent
#define Is_host_setup_sent()                   ((UPINTX & (1<<TXSTPI))    ? TRUE : FALSE)
   //! tests if control IN has been received
#define Is_host_control_in_received()          ((UPINTX & (1<<RXINI))    ? TRUE : FALSE)
   //! tests if control OUT has been sent
#define Is_host_control_out_sent()             ((UPINTX & (1<<TXOUTI))    ? TRUE : FALSE)
   //! tests if a STALL has been received
#define Is_host_stall()                        ((UPINTX & (1<<RXSTALLI))    ? TRUE : FALSE)
   //! tests if an error occurs on current pipe
#define Is_host_pipe_error()                   ((UPINTX & (1<<PERRI))    ? TRUE : FALSE)
   //! sends a setup
#define Host_send_setup()                      (UPINTX  &= ~(1<<FIFOCON))
   //! sends a control IN
#define Host_send_control_in()                 (UPINTX  &= ~(1<<FIFOCON))
   //! sends a control OUT
#define Host_send_control_out()                (UPINTX  &= ~(1<<FIFOCON))
   //! acks control OUT
#define Host_ack_control_out()                 (UPINTX  &= ~(1<<TXOUTI))
   //! acks control IN
#define Host_ack_control_in()                  (UPINTX  &= ~(1<<RXINI))
   //! acks setup
#define Host_ack_setup()                       (UPINTX  &= ~(1<<TXSTPI))
   //! acks STALL reception
#define Host_ack_stall()                       (UPINTX  &= ~(1<<RXSTALLI))

   //! sends a OUT
#define Host_send_out()                        (UPINTX &= ~(1<<FIFOCON))
   //! tests if OUT has been sent
#define Is_host_out_sent()                     ((UPINTX & (1<<TXOUTI))    ? TRUE : FALSE)
   //! acks OUT sent
#define Host_ack_out_sent()                    (UPINTX &= ~(1<<TXOUTI))
   //! tests if IN received
#define Is_host_in_received()                  ((UPINTX & (1<<RXINI))    ? TRUE : FALSE)
   //! acks IN reception
#define Host_ack_in_received()                 (UPINTX &= ~(1<<RXINI))
   //! sends a IN
#define Host_send_in()                         (UPINTX &= ~(1<<FIFOCON))
   //! tests if nak handshake has been received
#define Is_host_nak_received()                 ((UPINTX & (1<<NAKEDI))    ? TRUE : FALSE)
   //! acks NAk received sent
#define Host_ack_nak_received()                (UPINTX &= ~(1<<NAKEDI))



   //! tests if endpoint read allowed
#define Is_host_read_enabled()                 (UPINTX&(1<<RWAL))
   //! tests if endpoint read allowed
#define Is_host_write_enabled()                 (UPINTX&(1<<RWAL))

   //! sets IN in standard mode
#define Host_standard_in_mode()                (UPCONX &= ~(1<<INMODE))
   //! sets IN in continuous mode
#define Host_continuous_in_mode()              (UPCONX |=  (1<<INMODE))

   //! sets number of IN requests to perform before freeze
#define Host_in_request_number(in_num)         (UPINRQX = (U8)in_num)
   //! returns number of remaining IN requests
#define Host_get_in_request_number()           (UPINRQX)

   //! returns number of bytes (8 bits)
#define Host_data_length_U8()                  (UPBCLX)
   //! returns number of bytes (16 bits)
#define Host_data_length_U16()                 ((((U16)UPBCHX)<<8) | UPBCLX)
   //! for device compatibility
#define Host_byte_counter()                    Host_data_length_U16()
   //! for device compatibility
#define Host_byte_counter_8()                  Host_data_length_U8()

   //! returns the size of the current pipe
#define Host_get_pipe_length()                 ((U16)0x08 << ((UPCFG1X & MSK_PSIZE)>>4))

   //! returns the type of the current pipe
#define Host_get_pipe_type()                   (UPCFG0X>>6)

   //! tests if error occurs on pipe
#define Host_error_status()                    (UPERRX & MSK_ERROR)
   //! acks all pipe error
#define Host_ack_all_errors()                  (UPERRX = 0x00)

   //! Enable pipe end transmission interrupt
#define Host_enable_transmit_interrupt()       (UPIENX |= (1<<TXOUTE))
   //! Disable pipe end transmission interrupt
#define Host_disable_transmit_interrupt()      (UPIENX &= ~(1<<TXOUTE))

   //! Enable pipe reception interrupt
#define Host_enable_receive_interrupt()        (UPIENX |= (1<<RXINE))
   //! Disable pipe recption interrupt
#define Host_disable_receive_interrupt()       (UPIENX &= ~(1<<RXINE))

   //! Enable pipe stall interrupt
#define Host_enable_stall_interrupt()        (UPIENX |= (1<<RXSTALLE))
   //! Disable pipe stall interrupt
#define Host_disable_stall_interrupt()       (UPIENX &= ~(1<<RXSTALLE))

   //! Enable pipe error interrupt
#define Host_enable_error_interrupt()        (UPIENX |= (1<<PERRE))
   //! Disable pipe error interrupt
#define Host_disable_error_interrupt()       (UPIENX &= ~(1<<PERRE))

   //! Enable pipe NAK interrupt
#define Host_enable_nak_interrupt()        (UPIENX |= (1<<NAKEDE))
   //! Disable pipe NAK interrupt
#define Host_disable_nak_interrupt()       (UPIENX &= ~(1<<NAKEDE))

#define Get_pipe_token(x)                 ((x & (0x80)) ? TOKEN_IN : TOKEN_OUT)

//! @}

//! wSWAP
//! This macro swaps the U8 order in words.
//!
//! @param x        (U16) the 16 bit word to swap
//!
//! @return         (U16) the 16 bit word x with the 2 bytes swaped

#define wSWAP(x)        \
   (   (((x)>>8)&0x00FF) \
   |   (((x)<<8)&0xFF00) \
   )


//! Usb_write_word_enum_struc
//! This macro help to fill the U16 fill in USB enumeration struct.
//! Depending on the CPU architecture, the macro swap or not the nibbles
//!
//! @param x        (U16) the 16 bit word to be written
//!
//! @return         (U16) the 16 bit word written
#if !defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)
	#error YOU MUST Define the Endian Type of target: LITTLE_ENDIAN or BIG_ENDIAN
#endif
#ifdef LITTLE_ENDIAN
	#define Usb_write_word_enum_struc(x)	(x)
#else //BIG_ENDIAN
	#define Usb_write_word_enum_struc(x)	(wSWAP(x))
#endif


//! @}

//_____ D E C L A R A T I O N ______________________________________________

U8      usb_config_ep                (U8, U8);
U8      usb_select_enpoint_interrupt (void);
U16     usb_get_nb_byte_epw          (void);
U8      usb_send_packet              (U8 , U8*, U8);
U8      usb_read_packet              (U8 , U8*, U8);
void    usb_halt_endpoint            (U8);
void    usb_reset_endpoint           (U8);
U8      usb_init_device              (void);

U8      host_config_pipe             (U8, U8);
U8      host_determine_pipe_size     (U16);
void    host_disable_all_pipe        (void);
U8      usb_get_nb_pipe_interrupt    (void);

#endif  // _USB_DRV_H_

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久影院官网| 国产精品99久| 国产精品自拍网站| 在线免费视频一区二区| 国产日韩精品一区二区三区在线| 一区二区三区精密机械公司| 国产福利一区二区三区视频在线| 欧美日韩精品高清| 亚洲欧美区自拍先锋| 成人午夜av影视| 精品福利一区二区三区免费视频| 亚洲18女电影在线观看| 91久久香蕉国产日韩欧美9色| 久久久蜜臀国产一区二区| 亚洲一区二区三区在线播放| 9i看片成人免费高清| 亚洲国产精品av| 国产成人免费视频网站高清观看视频| 91精品在线麻豆| 同产精品九九九| 欧美日韩中文国产| 亚洲午夜三级在线| 欧美成人a在线| 亚洲一区二区综合| 欧美午夜精品一区二区三区| 亚洲乱码中文字幕综合| 97久久精品人人做人人爽| 中文欧美字幕免费| 成人免费视频国产在线观看| 日本一区二区三区在线不卡| 成人午夜电影网站| 综合久久久久综合| 色综合久久久久久久久| 一区二区三区在线观看视频| 色噜噜狠狠色综合中国| 亚洲婷婷在线视频| 在线视频你懂得一区| 亚洲成人免费在线| 日韩一级完整毛片| 国产精品一区二区黑丝| 国产精品日日摸夜夜摸av| 91麻豆视频网站| 一级精品视频在线观看宜春院 | 一区二区三区在线播放| 色妞www精品视频| 一区二区三区日韩欧美精品| 欧美吻胸吃奶大尺度电影 | 中文字幕欧美三区| 91免费在线播放| 亚洲专区一二三| 日韩精品中文字幕一区二区三区| 久久精品国产一区二区三区免费看 | 亚洲黄一区二区三区| 欧美三级日本三级少妇99| 美国十次综合导航| 国产精品色噜噜| 欧美日韩大陆在线| 国产中文字幕精品| 亚洲欧美另类图片小说| 欧美成人高清电影在线| 91在线视频免费观看| 天天做天天摸天天爽国产一区| 精品理论电影在线| 91网站在线观看视频| 三级在线观看一区二区| 国产拍欧美日韩视频二区| 91久久奴性调教| 国产精品一区二区视频| 亚洲图片有声小说| 中文字幕二三区不卡| 欧美精品一级二级| 99国产精品国产精品毛片| 日韩1区2区日韩1区2区| 亚洲欧洲另类国产综合| 日韩美女视频在线| 在线视频欧美精品| 成人激情动漫在线观看| 五月婷婷色综合| 国产精品高潮久久久久无| 欧美一区二区免费视频| 91黄色免费版| 国产成人h网站| 久久国产欧美日韩精品| 一区二区三区日本| 国产拍欧美日韩视频二区| 欧美一级片在线看| 在线观看91视频| 波多野结衣91| 国产精品一二三四五| 蜜臀av一区二区三区| 亚洲成人手机在线| 一区二区欧美视频| 国产精品理论片| 国产视频一区在线观看| 日韩精品一区二区三区四区| 欧美三级三级三级爽爽爽| 91极品视觉盛宴| 色综合久久66| 一本大道av伊人久久综合| av色综合久久天堂av综合| 懂色中文一区二区在线播放| 国产精品资源网站| 国产精品77777| 国产精品18久久久久| 久久国产精品露脸对白| 免费成人美女在线观看| 美女网站色91| 久久电影网电视剧免费观看| 久久国产精品色婷婷| 久久精品av麻豆的观看方式| 蜜桃av一区二区三区| 蜜桃在线一区二区三区| 日韩有码一区二区三区| 日韩—二三区免费观看av| 五月婷婷综合网| 免费观看30秒视频久久| 久久黄色级2电影| 国内精品免费**视频| 国产成人精品免费一区二区| 成人晚上爱看视频| 色综合一个色综合亚洲| 91成人国产精品| 欧美日韩高清一区二区不卡| 欧美一区二区三区电影| 久久综合视频网| 国产精品久久久久7777按摩| 亚洲欧美日韩中文字幕一区二区三区 | 欧美主播一区二区三区| 欧美中文字幕一区二区三区| 国产伦精品一区二区三区免费 | 欧美精品在线观看播放| 日韩视频一区二区三区在线播放| 欧美电影免费观看高清完整版在线| 欧美xxxxx裸体时装秀| 国产亚洲精品福利| 一区二区三区四区蜜桃| 日韩av电影免费观看高清完整版 | 在线一区二区视频| 在线播放一区二区三区| 久久网站最新地址| 中文字幕一区视频| 午夜电影久久久| 国产91丝袜在线播放九色| 色综合婷婷久久| 日韩美一区二区三区| 亚洲欧洲精品一区二区精品久久久| 亚洲国产精品一区二区久久 | 欧美国产日韩一二三区| 洋洋av久久久久久久一区| 精品在线观看视频| 在线视频国产一区| 精品免费日韩av| 亚洲一区二区三区中文字幕| 国精产品一区一区三区mba桃花| 91美女视频网站| 日韩欧美精品三级| 亚洲免费电影在线| 国产精品1区2区| 欧美久久久久久久久中文字幕| 国产嫩草影院久久久久| 日韩精品亚洲一区二区三区免费| 成人性视频网站| 日韩三区在线观看| 一区二区三区在线观看国产| 国产精品一区二区三区网站| 欧美一区二区三区四区在线观看| 自拍偷在线精品自拍偷无码专区| 奇米精品一区二区三区在线观看一 | 欧美一卡二卡在线| 亚洲欧美国产毛片在线| 国产精品一区免费视频| 制服丝袜国产精品| 亚洲男人电影天堂| 福利电影一区二区| 日韩免费高清电影| 午夜精品一区二区三区三上悠亚| 9久草视频在线视频精品| 26uuu色噜噜精品一区二区| 丝瓜av网站精品一区二区| 91麻豆国产福利在线观看| 国产欧美精品国产国产专区| 日本不卡免费在线视频| 欧美乱妇一区二区三区不卡视频| 一区二区三区四区在线免费观看| 成人av影院在线| 中文字幕欧美日韩一区| 福利一区二区在线| 国产调教视频一区| 国产精品亚洲专一区二区三区| 日韩欧美电影在线| 日本视频一区二区| 日韩一本二本av| 免费成人小视频| 精品国产露脸精彩对白 | 日韩电影一二三区| 欧美日韩国产在线播放网站| 亚洲高清免费观看高清完整版在线观看| 色悠悠久久综合| 亚洲高清中文字幕| 欧美一区二区二区|