![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <io.h>#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include <common.h>#include <log.h>#include <sys-clk.h>#include "usb.h"#include "usb_controller.h"#include "usb_device.h"
Functions | |
| void | usb_device_set_address_default (uint64_t husb) |
| Set the default address for the USB device. | |
| void | usb_device_set_address (uint64_t husb, uint8_t address) |
| Set the address for the USB device. | |
| uint32_t | usb_device_query_transfer_mode (uint64_t husb) |
| Query the transfer mode of the USB device. | |
| void | usb_device_config_transfer_mode (uint64_t husb, uint8_t ts_type, uint8_t speed_mode) |
| Configure the transfer mode of the USB device. | |
| void | usb_device_connect_switch (uint64_t husb, uint32_t is_on) |
| Switch the USB device connection on or off. | |
| uint32_t | usb_device_query_power_status (uint64_t husb) |
| Query the power status of the USB device. | |
| int | usb_device_config_ep (uint64_t husb, uint32_t ts_type, uint32_t ep_type, uint32_t is_double_fifo, uint32_t ep_maxpkt) |
| Configure an endpoint of the USB device. | |
| int | usb_device_config_ep_default (uint64_t husb, uint32_t ep_type) |
| Configure a default endpoint of the USB device. | |
| int | usb_device_config_ep_dma (uint64_t husb, uint32_t ep_type) |
| Configure an endpoint of the USB device to use DMA. | |
| int | usb_device_clear_ep_dma (uint64_t husb, uint32_t ep_type) |
| Clear the DMA configuration for an endpoint of the USB device. | |
| int | usb_device_get_ep_stall (uint64_t husb, uint32_t ep_type) |
| Get the stall status of an endpoint of the USB device. | |
| int | usb_device_ep_send_stall (uint64_t husb, uint32_t ep_type) |
| Send a stall condition on an endpoint of the USB device. | |
| int | usb_device_ep_clear_stall (uint64_t husb, uint32_t ep_type) |
| Clear the stall condition on an endpoint of the USB device. | |
| uint32_t | usb_device_ctrl_get_setup_end (uint64_t husb) |
| Get the setup end status of the control endpoint of the USB device. | |
| void | usb_device_ctrl_clear_setup_end (uint64_t husb) |
| Clear the setup end status of the control endpoint of the USB device. | |
| int | usb_device_write_data_status (uint64_t husb, uint32_t ep_type, uint32_t complete) |
| Check the write data status of an endpoint of the USB device. | |
| int | usb_device_read_data_status (uint64_t husb, uint32_t ep_type, uint32_t complete) |
| Check the read data status of an endpoint of the USB device. | |
| uint32_t | usb_device_get_read_data_ready (uint64_t husb, uint32_t ep_type) |
| Check if there is ready data to be read from an endpoint of the USB device. | |
| uint32_t | usb_device_get_write_data_ready (uint64_t husb, uint32_t ep_type) |
| Check if an endpoint of the USB device is ready to write data. | |
| uint32_t | usb_device_get_write_data_ready_fifo_empty (uint64_t husb, uint32_t ep_type) |
| Check if the FIFO of an endpoint of the USB device is empty and ready to write data. | |
| int | usb_device_iso_update_enable (uint64_t husb) |
| Enable ISO update for the USB device. | |
| void | usb_device_flush_fifo (uint64_t husb, uint32_t ep_type) |
| Flush the FIFO of an endpoint of the USB device. | |
Clear the DMA configuration for an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
| int usb_device_config_ep | ( | uint64_t | husb, |
| uint32_t | ts_type, | ||
| uint32_t | ep_type, | ||
| uint32_t | is_double_fifo, | ||
| uint32_t | ep_maxpkt | ||
| ) |
Configure an endpoint of the USB device.
| husb | The USB device handle. |
| ts_type | The transfer mode type. |
| ep_type | The endpoint type. |
| is_double_fifo | Whether to use double FIFO or not. |
| ep_maxpkt | The maximum packet size of the endpoint. |
Configure a default endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Configure an endpoint of the USB device to use DMA.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Configure the transfer mode of the USB device.
| husb | The USB device handle. |
| ts_type | The transfer mode type. |
| speed_mode | The speed mode. |
Switch the USB device connection on or off.
| husb | The USB device handle. |
| is_on | Whether to turn the connection on (1) or off (0). |
| void usb_device_ctrl_clear_setup_end | ( | uint64_t | husb | ) |
Clear the setup end status of the control endpoint of the USB device.
| husb | The USB device handle. |
Get the setup end status of the control endpoint of the USB device.
| husb | The USB device handle. |
Clear the stall condition on an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Send a stall condition on an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Flush the FIFO of an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Get the stall status of an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Check if there is ready data to be read from an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Check if an endpoint of the USB device is ready to write data.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
Check if the FIFO of an endpoint of the USB device is empty and ready to write data.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
| int usb_device_iso_update_enable | ( | uint64_t | husb | ) |
Enable ISO update for the USB device.
| husb | The USB device handle. |
Query the power status of the USB device.
| husb | The USB device handle. |
Query the transfer mode of the USB device.
| husb | The USB device handle. |
Check the read data status of an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
| complete | Whether the read operation is complete (1) or not (0). |
Set the address for the USB device.
| husb | The USB device handle. |
| address | The address to set. |
| void usb_device_set_address_default | ( | uint64_t | husb | ) |
Set the default address for the USB device.
| husb | The USB device handle. |
Check the write data status of an endpoint of the USB device.
| husb | The USB device handle. |
| ep_type | The endpoint type. |
| complete | Whether the write operation is complete (1) or not (0). |