![]() |
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"
Functions | |
| uint32_t | usb_controller_open_otg (uint32_t otg_no) |
| Open the USB OTG controller. | |
| int | usb_controller_close_otg (uint64_t husb) |
| Close the USB OTG controller. | |
| static uint32_t | usb_controller_wake_up_clear_change_detect (uint32_t reg_val) |
| static void | usb_controller_force_id_low (uint32_t addr) |
| static void | usb_controller_force_id_high (uint32_t addr) |
| static void | usb_controller_force_id_disable (uint32_t addr) |
| void | usb_controller_force_id_status (uint64_t husb, uint32_t id_type) |
| Set the ID status for the USB controller. | |
| static void | usb_controller_force_vbus_valid_disable (uint32_t addr) |
| static void | usb_controller_force_vbus_valid_low (uint32_t addr) |
| static void | usb_controller_force_vbus_valid_high (uint32_t addr) |
| void | usb_controller_force_vbus_valid (uint64_t husb, uint32_t vbus_type) |
| Force the VBUS valid state for the USB controller. | |
| void | usb_controller_id_pull_enable (uint64_t husb) |
| Enable the ID pull-up resistor for the USB controller. | |
| void | usb_controller_id_pull_disable (uint64_t husb) |
| Disable the ID pull-up resistor for the USB controller. | |
| void | usb_controller_dpdm_pull_enable (uint64_t husb) |
| Enable the DP/DM pull-up resistors for the USB controller. | |
| void | usb_controller_dpdm_pull_disable (uint64_t husb) |
| Disable the DP/DM pull-up resistors for the USB controller. | |
| void | usb_controller_select_bus (uint64_t husb, uint32_t io_type, uint32_t ep_type, uint32_t ep_index) |
| void | usb_controller_int_disable_usb_misc_all (uint64_t husb) |
| Disable all miscellaneous USB interrupts. | |
| void | usb_controller_int_disable_ep_all (uint64_t husb, uint32_t ep_type) |
| Disable all endpoint-specific interrupts. | |
| void | usb_controller_int_enable_usb_misc_uint (uint64_t husb, uint32_t mask) |
| Enable specific miscellaneous USB interrupts. | |
| void | usb_controller_int_disable_usb_misc_uint (uint64_t husb, uint32_t mask) |
| Disable specific miscellaneous USB interrupts. | |
| void | usb_controller_int_enable_ep (uint64_t husb, uint32_t ep_type, uint32_t ep_index) |
| Enable interrupts for a specific endpoint. | |
| uint32_t | usb_controller_get_active_ep (uint64_t husb) |
| Get the active endpoint for the USB controller. | |
| void | usb_controller_select_active_ep (uint64_t husb, uint8_t ep_index) |
| Select the active endpoint for the USB controller. | |
| void | usb_controller_config_fifo_tx_ep_default (uint32_t addr) |
| Configure the FIFO for a default transmit endpoint. | |
| void | usb_controller_config_fifo_tx_ep (uint32_t addr, uint32_t is_double_fifo, uint32_t fifo_size, uint32_t fifo_addr) |
| Configure the FIFO for a transmit endpoint. | |
| void | usb_controller_config_fifo_rx_ep_default (uint32_t addr) |
| Configure the FIFO for a default receive endpoint. | |
| void | usb_controller_config_fifo_rx_ep (uint32_t addr, uint32_t is_double_fifo, uint32_t fifo_size, uint32_t fifo_addr) |
| Configure the FIFO for a receive endpoint. | |
| void | usb_controller_config_fifo (uint64_t husb, uint32_t ep_type, uint32_t is_double_fifo, uint32_t fifo_size, uint32_t fifo_addr) |
| Configure the FIFO for a specific endpoint. | |
| uint32_t | usb_controller_int_ep_pending (uint64_t husb, uint32_t ep_type) |
| Get the pending interrupt status for a specific endpoint. | |
| void | usb_controller_int_clear_ep_pending (uint64_t husb, uint32_t ep_type, uint8_t ep_index) |
| Clear the pending interrupt flag for a specific endpoint. | |
| void | usb_controller_int_clear_ep_pending_all (uint64_t husb, uint32_t ep_type) |
| Clear the pending interrupt flags for all endpoints of a specific type. | |
| uint32_t | usb_controller_int_misc_pending (uint64_t husb) |
| Get the pending miscellaneous interrupt status. | |
| void | usb_controller_int_clear_misc_pending (uint64_t husb, uint32_t mask) |
| Clear the pending miscellaneous interrupt flag. | |
| void | usb_controller_int_clear_misc_pending_all (uint64_t husb) |
| Clear the pending miscellaneous interrupt flags for all interrupts. | |
| void | usb_controller_int_disable_ep (uint64_t husb, uint32_t ep_type, uint8_t ep_index) |
| Disable interrupts for a specific endpoint. | |
| uint32_t | usb_controller_get_vbus_status (uint64_t husb) |
| uint32_t | usb_controller_read_len_from_fifo (uint64_t husb, uint32_t ep_type) |
| uint32_t | usb_controller_write_packet (uint64_t husb, uint32_t fifo, uint32_t cnt, void *buff) |
| uint32_t | usb_controller_read_packet (uint64_t husb, uint32_t fifo, uint32_t cnt, void *buff) |
| void | usb_controller_config_fifo_base (uint64_t husb, uint32_t sram_base) |
| uint32_t | usb_controller_get_port_fifo_start_addr (uint64_t husb) |
| uint32_t | usb_controller_get_port_fifo_size (uint64_t husb) |
| uint32_t | usb_controller_select_fifo (uint64_t husb, uint32_t ep_index) |
Variables | |
| static uint32_t | usbc_base_address [USBC_MAX_CTL_NUM] = {SUNXI_USB0_BASE} |
| static usb_controller_otg_t | usbc_otg_array [USBC_MAX_OPEN_NUM] |
| static fifo_info_t | usbc_info_g |
| int usb_controller_close_otg | ( | uint64_t | husb | ) |
Close the USB OTG controller.
| husb | The handle to the USB controller. |
| void usb_controller_config_fifo | ( | uint64_t | husb, |
| uint32_t | ep_type, | ||
| uint32_t | is_double_fifo, | ||
| uint32_t | fifo_size, | ||
| uint32_t | fifo_addr | ||
| ) |
Configure the FIFO for a specific endpoint.
| husb | The handle to the USB controller. |
| ep_type | The type of endpoint. |
| is_double_fifo | Whether the endpoint has double buffering enabled. |
| fifo_size | The size of the FIFO. |
| fifo_addr | The base address of the FIFO. |
| void usb_controller_config_fifo_rx_ep | ( | uint32_t | addr, |
| uint32_t | is_double_fifo, | ||
| uint32_t | fifo_size, | ||
| uint32_t | fifo_addr | ||
| ) |
Configure the FIFO for a receive endpoint.
| addr | The address of the USB controller. |
| is_double_fifo | Whether the endpoint has double buffering enabled. |
| fifo_size | The size of the FIFO. |
| fifo_addr | The base address of the FIFO. |
| void usb_controller_config_fifo_rx_ep_default | ( | uint32_t | addr | ) |
Configure the FIFO for a default receive endpoint.
| addr | The address of the USB controller. |
| void usb_controller_config_fifo_tx_ep | ( | uint32_t | addr, |
| uint32_t | is_double_fifo, | ||
| uint32_t | fifo_size, | ||
| uint32_t | fifo_addr | ||
| ) |
Configure the FIFO for a transmit endpoint.
| addr | The address of the USB controller. |
| is_double_fifo | Whether the endpoint has double buffering enabled. |
| fifo_size | The size of the FIFO. |
| fifo_addr | The base address of the FIFO. |
| void usb_controller_config_fifo_tx_ep_default | ( | uint32_t | addr | ) |
Configure the FIFO for a default transmit endpoint.
| addr | The address of the USB controller. |
| void usb_controller_dpdm_pull_disable | ( | uint64_t | husb | ) |
Disable the DP/DM pull-up resistors for the USB controller.
| husb | The handle to the USB controller. |
| void usb_controller_dpdm_pull_enable | ( | uint64_t | husb | ) |
Enable the DP/DM pull-up resistors for the USB controller.
| husb | The handle to the USB controller. |
|
static |
|
static |
|
static |
Set the ID status for the USB controller.
| husb | The handle to the USB controller. |
| id_type | The type of ID status to set. |
Force the VBUS valid state for the USB controller.
| husb | The handle to the USB controller. |
| vbus_type | The type of VBUS state to force. |
|
static |
|
static |
|
static |
Get the active endpoint for the USB controller.
| husb | The handle to the USB controller. |
| void usb_controller_id_pull_disable | ( | uint64_t | husb | ) |
Disable the ID pull-up resistor for the USB controller.
| husb | The handle to the USB controller. |
| void usb_controller_id_pull_enable | ( | uint64_t | husb | ) |
Enable the ID pull-up resistor for the USB controller.
| husb | The handle to the USB controller. |
Clear the pending interrupt flag for a specific endpoint.
| husb | The handle to the USB controller. |
| ep_type | The type of endpoint. |
| ep_index | The index of the endpoint. |
Clear the pending interrupt flags for all endpoints of a specific type.
| husb | The handle to the USB controller. |
| ep_type | The type of endpoint. |
Clear the pending miscellaneous interrupt flag.
| husb | The handle to the USB controller. |
| mask | The interrupt mask to clear. |
| void usb_controller_int_clear_misc_pending_all | ( | uint64_t | husb | ) |
Clear the pending miscellaneous interrupt flags for all interrupts.
| husb | The handle to the USB controller. |
Disable interrupts for a specific endpoint.
| husb | The handle to the USB controller. |
| ep_type | The type of endpoint. |
| ep_index | The index of the endpoint. |
Disable all endpoint-specific interrupts.
| husb | The handle to the USB controller. |
| ep_type | The type of endpoint to disable interrupts for. |
| void usb_controller_int_disable_usb_misc_all | ( | uint64_t | husb | ) |
Disable all miscellaneous USB interrupts.
| husb | The handle to the USB controller. |
Disable specific miscellaneous USB interrupts.
| husb | The handle to the USB controller. |
| mask | The interrupt mask to enable. |
Enable interrupts for a specific endpoint.
| husb | The handle to the USB controller. |
| ep_type | The type of endpoint to enable interrupts for. |
| ep_index | The index of the endpoint to enable interrupts for. |
Enable specific miscellaneous USB interrupts.
| husb | The handle to the USB controller. |
| mask | The interrupt mask to enable. |
Get the pending interrupt status for a specific endpoint.
| husb | The handle to the USB controller. |
| ep_type | The type of endpoint. |
Get the pending miscellaneous interrupt status.
| husb | The handle to the USB controller. |
Open the USB OTG controller.
| otg_no | The OTG controller number. |
Select the active endpoint for the USB controller.
| husb | The handle to the USB controller. |
| ep_index | The index of the endpoint to select as active. |
| void usb_controller_select_bus | ( | uint64_t | husb, |
| uint32_t | io_type, | ||
| uint32_t | ep_type, | ||
| uint32_t | ep_index | ||
| ) |
|
static |
|
static |
|
static |