![]() |
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_dma.h"
Macros | |
| #define | SUNXI_USB_DMA_MAX (8) |
Functions | |
| static int | lowlevel_usb_dma_set_channal_para (uint64_t husb, uint32_t dma_chan, uint32_t trans_dir, uint32_t ep_type) |
| Set the parameters for a USB DMA channel. | |
| static int | lowlevel_usb_dma_set_packet_len (uint64_t husb, uint32_t dma_chan, uint32_t pkt_len) |
| Set the packet length for a USB DMA channel. | |
| static int | lowlevel_usb_dma_start (uint64_t husb, uint32_t dma_chan, uint32_t addr, uint32_t pkt_len) |
| Start a USB DMA transfer on a specific channel. | |
| static int | lowlevel_usb_dma_int_stop (uint64_t husb, uint32_t dma_chan) |
| Stop a USB DMA transfer on a specific channel. | |
| static int | lowlevel_usb_dma_int_query (uint64_t husb) |
| Query the status of USB DMA transfers. | |
| static int | lowlevel_usb_dma_int_clear (uint64_t husb) |
| Clear the status of USB DMA transfers. | |
| static int | usb_index_check (uint32_t dma_index) |
| Check if the USB DMA index is valid. | |
| int | usb_dma_init (uint64_t husb) |
| Initialize USB DMA. | |
| int | usb_dma_request (void) |
| Request a USB DMA channel. | |
| int | usb_dma_release (uint32_t dma_index) |
| Release a USB DMA channel. | |
| int | usb_dma_setting (uint32_t dma_index, uint32_t trans_dir, uint32_t ep) |
| Set the parameters of a USB DMA channel. | |
| int | usb_dma_set_pktlen (uint32_t dma_index, uint32_t pkt_len) |
| Set the packet length of a USB DMA channel. | |
| int | usb_dma_start (uint32_t dma_index, uint32_t addr, uint32_t bytes) |
| Start a USB DMA transfer. | |
| int | usb_dma_stop (uint32_t dma_index) |
| Stop a USB DMA transfer. | |
| int | usb_dma_int_query (uint32_t dma_index) |
| Query the interrupt status of a USB DMA channel. | |
| int | usb_dma_int_clear (void) |
| Clear the interrupt status of all USB DMA channels. | |
Variables | |
| static uint32_t | usb_hd |
| static uint32_t | usb_dma_used [SUNXI_USB_DMA_MAX] |
| #define SUNXI_USB_DMA_MAX (8) |
|
static |
Clear the status of USB DMA transfers.
This function is used to clear the status of USB DMA transfers.
| husb | The USB controller handle |
|
static |
Query the status of USB DMA transfers.
This function is used to query the status of USB DMA transfers.
| husb | The USB controller handle |
Stop a USB DMA transfer on a specific channel.
This function is used to stop a USB DMA transfer on a specific channel.
| husb | The USB controller handle |
| dma_chan | The DMA channel number |
|
static |
Set the parameters for a USB DMA channel.
This function is used to configure the parameters for a specific USB DMA channel.
| husb | The USB controller handle |
| dma_chan | The DMA channel number |
| trans_dir | The transfer direction (0: OUT, 1: IN) |
| ep_type | The endpoint type |
|
static |
Set the packet length for a USB DMA channel.
This function is used to set the packet length for a specific USB DMA channel.
| husb | The USB controller handle |
| dma_chan | The DMA channel number |
| pkt_len | The packet length to be set |
|
static |
Start a USB DMA transfer on a specific channel.
This function is used to start a USB DMA transfer on a specific channel with the given address and packet length.
| husb | The USB controller handle |
| dma_chan | The DMA channel number |
| addr | The address of the buffer to be transferred |
| pkt_len | The length of the packet to be transferred |
| int usb_dma_init | ( | uint64_t | husb | ) |
Initialize USB DMA.
This function is used to initialize USB DMA.
| husb | The USB controller handle |
| int usb_dma_int_clear | ( | void | ) |
Clear the interrupt status of all USB DMA channels.
This function is used to clear the interrupt status of all USB DMA channels.
| int usb_dma_int_query | ( | uint32_t | dma_index | ) |
Query the interrupt status of a USB DMA channel.
This function is used to query the interrupt status of a USB DMA channel.
| dma_index | The DMA index to query |
| int usb_dma_release | ( | uint32_t | dma_index | ) |
Release a USB DMA channel.
This function is used to release a USB DMA channel.
| dma_index | The DMA index to release |
| int usb_dma_request | ( | void | ) |
Request a USB DMA channel.
This function is used to request a USB DMA channel.
Set the packet length of a USB DMA channel.
This function is used to set the packet length of a USB DMA channel.
| dma_index | The DMA index to configure |
| pkt_len | The packet length to set |
Set the parameters of a USB DMA channel.
This function is used to set the parameters of a USB DMA channel.
| dma_index | The DMA index to configure |
| trans_dir | The transfer direction (IN or OUT) |
| ep | The endpoint number |
Start a USB DMA transfer.
This function is used to start a USB DMA transfer.
| dma_index | The DMA index to use |
| addr | The address of the buffer for the transfer |
| bytes | The number of bytes to transfer |
| int usb_dma_stop | ( | uint32_t | dma_index | ) |
Stop a USB DMA transfer.
This function is used to stop a USB DMA transfer.
| dma_index | The DMA index to stop |
|
static |
Check if the USB DMA index is valid.
This function is used to check if the USB DMA index is within range and is currently in use.
| dma_index | The USB DMA index to check |
|
static |
|
static |