usbs_serial_start, usbs_serial_init, usbs_serial_start, usbs_serial_wait_until_configured, usbs_serial_is_configured, usbs_serial_start_tx, usbs_serial_wait_for_tx, usbs_serial_tx, usbs_serial_start_rx, usbs_serial_wait_for_rx, usbs_serial_rx, usbs_serial_state_change_handler -- eCos USB Serial like Peripherals API
For examples of how to use this API see the
files .../tests/usbserial_echo.c
and .../tests/usb2serial.c
The first function that needs calling
is usbs_serial_start(). This will initialise
the eCos USB slave layer, creating all the enumeration data and
then let the host know that the device exists.
Once the USB subsystem has been started it is necessary to wait
for the host to configure the device using the
function usbs_serial_wait_until_configured(). The
host will assign the device an ID and then load the appropriate
device driver in the host in order to make use the device.
Once the device is configured it is then possible to make use of
it, i.e. send and receive data. This transfer of data can be
accomplished either asynchronously or synchronously. It is also
possible to mix asynchronously and synchronously between
receiving and sending data.
To perform asynchronous operations the
functions usbs_serial_start_rx()
and usbs_serial_start_tx() is used to
start the operation. These functions start the necessary
actions and then return immediately. At a later time the
functions usbs_serial_wait_for_tx()
or usbs_serial_wait_for_rx() should be
called. These will, if necessary, block and then return the
status and any data for the previously started asynchronous
call.
To perform synchronous operations the
functions usbs_serial_rx()
and usbs_serial_tx() are used. These
functions will block until the requested action is complete.