krüe :: avrforth :: usb-device

usb device mode

words

word stack description
usb-wakeup ( -- ) send remote wakeup
usb-attach ( -- ) attach device
usb-detach ( -- ) detach device
usb-reset? ( -- f ) detect reset
usb-reset-ack ( -- ) acknowledge reset
usb-address ( n -- ) set device address
usb-address-enable ( -- ) enable device address
ep-set ( n -- ) set current endpoint
ep-get ( -- n ) get current endpoint
ep-stall ( -- ) stall endpoint
ep-continue ( -- ) resume endpoint
ep-reset-toggle ( -- ) reset endpoint data page toggle
ep-enable ( -- ) enable endpoint
ep-disable ( -- ) disable endpoint
ep-enabled? ( -- f ) check if endpoint is enabled
ep-type ( n -- ) configure endpoint type
ep-dir ( n -- ) configure endpoint direction
ep-size ( n -- ) configure endpoint size
ep-bank ( n -- ) configure number of endpoint data banks
ep-allocate ( -- ) allocate endpoint ram
ep-deallocate ( -- ) deallocate endpoint ram
ep-ready? ( -- f ) check if endpoint is ready
rx-setup? ( -- f ) check if a setup request has been received by a control endpoint
setup-ack ( -- ) acknowledge setup request
rx-out? ( -- f ) check if an out packet has been received
out-ack ( -- ) acknowledge out packet
tx-in? ( -- f ) check if an in packet can be transmitted
in-ack ( -- ) acknowledge in packet
epc! ( c -- ) store character to endpoint
ep! ( x -- ) store cell to endpoint
epc@ ( -- c ) fetch character from endpoint
ep@ ( -- x ) fetch cell from endpoint
ep-bytes ( -- n ) get number of bytes in data buffer

constants

endpoint type

These constants can be passed to ep-type to select the type of endpoint.

endpoint direction

These constants can be passed to ep-dir to configure endpoint direction.

endpoint size

These constants can be passed to ep-size to configure endpoint size.

endpoint banks

These constants can be passed to ep-bank to configure the number of endpoint data banks.