![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include "reg/reg-usb.h"

Go to the source code of this file.
Classes | |
| struct | fifo_info |
| struct | usb_controller_otg |
Macros | |
| #define | USBC_MAX_OPEN_NUM 8 |
| #define | USBC_MAX_CTL_NUM 3 |
| #define | USBC_MAX_EP_NUM 6 |
| #define | USBC0_MAX_FIFO_SIZE (8 * 1024) |
| #define | USBC_EP0_FIFOSIZE 64 |
Typedefs | |
| typedef struct fifo_info | fifo_info_t |
| typedef struct usb_controller_otg | usb_controller_otg_t |
Functions | |
| static uint32_t | usb_controller_int_tx_pending (uint32_t addr) |
| Get the interrupt pending flag of a TX endpoint. | |
| static void | usb_controller_int_clear_tx_pending (uint32_t addr, uint8_t ep_index) |
| Clear the interrupt pending flag of a TX endpoint. | |
| static void | usb_controller_int_clear_tx_pending_all (uint32_t addr) |
| Clear the interrupt pending flags of all TX endpoints. | |
| static uint32_t | usb_controller_int_rx_pending (uint32_t addr) |
| Get the interrupt pending flag of an RX endpoint. | |
| static void | usb_controller_int_clear_rx_pending (uint32_t addr, uint8_t ep_index) |
| Clear the interrupt pending flag of an RX endpoint. | |
| static void | usb_controller_int_clear_rx_pending_all (uint32_t addr) |
| Clear the interrupt pending flags of all RX endpoints. | |
| static void | usb_controller_int_enable_tx_ep (uint32_t addr, uint8_t ep_index) |
| Enable the interrupt of a TX endpoint. | |
| static void | usb_controller_int_enable_rx_ep (uint32_t addr, uint8_t ep_index) |
| Enable the interrupt of an RX endpoint. | |
| static void | usb_controller_int_disable_tx_ep (uint32_t addr, uint8_t ep_index) |
| Disable the interrupt of a TX endpoint. | |
| static void | usb_controller_int_disable_rx_ep (uint32_t addr, uint8_t ep_index) |
| Disable the interrupt of an RX endpoint. | |
| static void | usb_controller_int_disable_tx_all (uint32_t addr) |
| Disable the interrupts of all TX endpoints. | |
| static void | usb_controller_int_disable_rx_all (uint32_t addr) |
| Disable the interrupts of all RX endpoints. | |
| 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. | |
| void | usb_controller_force_id_status (uint64_t husb, uint32_t id_type) |
| Set the ID status for the USB controller. | |
| 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_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_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. | |
| uint32_t | usb_controller_get_active_ep (uint64_t husb) |
| Get the active endpoint for the USB controller. | |
| void | usb_controller_int_disable_ep (uint64_t husb, uint32_t ep_type, uint8_t ep_index) |
| Disable interrupts for a specific endpoint. | |
| 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_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) |
| #define USBC0_MAX_FIFO_SIZE (8 * 1024) |
| #define USBC_EP0_FIFOSIZE 64 |
| #define USBC_MAX_CTL_NUM 3 |
| #define USBC_MAX_EP_NUM 6 |
| #define USBC_MAX_OPEN_NUM 8 |
| typedef struct fifo_info fifo_info_t |
| typedef struct usb_controller_otg usb_controller_otg_t |
| 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. |
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. |
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. |
Clear the interrupt pending flag of an RX endpoint.
| addr | The address of the USB controller. |
| ep_index | The index of the RX endpoint. |
|
inlinestatic |
Clear the interrupt pending flags of all RX endpoints.
| addr | The address of the USB controller. |
Clear the interrupt pending flag of a TX endpoint.
| addr | The address of the USB controller. |
| ep_index | The index of the TX endpoint. |
|
inlinestatic |
Clear the interrupt pending flags of all TX endpoints.
| addr | The address of 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. |
|
inlinestatic |
Disable the interrupts of all RX endpoints.
| addr | The address of the USB controller. |
Disable the interrupt of an RX endpoint.
| addr | The address of the USB controller. |
| ep_index | The index of the RX endpoint. |
|
inlinestatic |
Disable the interrupts of all TX endpoints.
| addr | The address of the USB controller. |
Disable the interrupt of a TX endpoint.
| addr | The address of the USB controller. |
| ep_index | The index of the TX endpoint. |
| 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 the interrupt of an RX endpoint.
| addr | The address of the USB controller. |
| ep_index | The index of the RX endpoint. |
Enable the interrupt of a TX endpoint.
| addr | The address of the USB controller. |
| ep_index | The index of the TX endpoint. |
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. |
Get the interrupt pending flag of an RX endpoint.
| addr | The address of the USB controller. |
Get the interrupt pending flag of a TX endpoint.
| addr | The address of 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. |