![]() |
#include <stdio.h>#include <stdint.h>#include <string.h>#include "../Arduino.h"#include "variant.h"#include "USB_host.h"#include "samd21_host.h"#include "sam.h"#include "wiring_digital.h"#include "wiring_private.h"Macros | |
| #define | HOST_DEFINED |
| #define | TRACE_UOTGHS_HOST(x) |
| #define | NVM_USB_PAD_TRANSN_POS 45 |
| #define | NVM_USB_PAD_TRANSN_SIZE 5 |
| #define | NVM_USB_PAD_TRANSP_POS 50 |
| #define | NVM_USB_PAD_TRANSP_SIZE 5 |
| #define | NVM_USB_PAD_TRIM_POS 55 |
| #define | NVM_USB_PAD_TRIM_SIZE 3 |
Fonctions | |
| __attribute__ ((__aligned__(4))) volatile | |
| Initialize the SAMD21 host driver. Plus de détails... | |
| void | UHD_Handler (void) |
| Interrupt sub routine for USB Host state machine management. Plus de détails... | |
| uhd_vbus_state_t | UHD_GetVBUSState (void) |
| Get VBUS state. Plus de détails... | |
| uint32_t | UHD_Pipe0_Alloc (uint32_t ul_add, uint32_t ul_ep_size) |
| Allocate FIFO for pipe 0. Plus de détails... | |
| uint32_t | UHD_Pipe_Alloc (uint32_t ul_dev_addr, uint32_t ul_dev_ep, uint32_t ul_type, uint32_t ul_dir, uint32_t ul_maxsize, uint32_t ul_interval, uint32_t ul_nb_bank) |
| Allocate a new pipe. Plus de détails... | |
| void | UHD_Pipe_CountZero (uint32_t ul_pipe) |
| void | UHD_Pipe_Free (uint32_t ul_pipe) |
| Free a pipe. Plus de détails... | |
| uint32_t | UHD_Pipe_Read (uint32_t pipe_num, uint32_t buf_size, uint8_t *buf) |
| Read from a pipe. Plus de détails... | |
| void | UHD_Pipe_Write (uint32_t ul_pipe, uint32_t ul_size, uint8_t *buf) |
| Write into a pipe. Plus de détails... | |
| void | UHD_Pipe_Send (uint32_t ul_pipe, uint32_t ul_token_type) |
| Send a pipe content. Plus de détails... | |
| uint32_t | UHD_Pipe_Is_Transfer_Complete (uint32_t ul_pipe, uint32_t ul_token_type) |
| Check for pipe transfer completion. Plus de détails... | |
| #define HOST_DEFINED |
| #define NVM_USB_PAD_TRANSN_POS 45 |
| #define NVM_USB_PAD_TRANSN_SIZE 5 |
| #define NVM_USB_PAD_TRANSP_POS 50 |
| #define NVM_USB_PAD_TRANSP_SIZE 5 |
| #define NVM_USB_PAD_TRIM_POS 55 |
| #define NVM_USB_PAD_TRIM_SIZE 3 |
| #define TRACE_UOTGHS_HOST | ( | x | ) |
| __attribute__ | ( | (__aligned__(4)) | ) | volatile |
Initialize the SAMD21 host driver.
| uhd_vbus_state_t UHD_GetVBUSState | ( | void | ) |
Get VBUS state.
| void UHD_Handler | ( | void | ) |
Interrupt sub routine for USB Host state machine management.
| uint32_t UHD_Pipe0_Alloc | ( | uint32_t | ul_add, |
| uint32_t | ul_ep_size | ||
| ) |
Allocate FIFO for pipe 0.
| ul_add | Address of remote device for pipe 0. |
| ul_ep_size | Actual size of the FIFO in bytes. |
| 0 | success. |
| 1 | error. |
| uint32_t UHD_Pipe_Alloc | ( | uint32_t | ul_dev_addr, |
| uint32_t | ul_dev_ep, | ||
| uint32_t | ul_type, | ||
| uint32_t | ul_dir, | ||
| uint32_t | ul_maxsize, | ||
| uint32_t | ul_interval, | ||
| uint32_t | ul_nb_bank | ||
| ) |
Allocate a new pipe.
| ul_dev_addr | Address of remote device. |
| ul_dev_ep | Targeted endpoint of remote device. |
| ul_type | Pipe type. |
| ul_dir | Pipe direction. |
| ul_maxsize | Pipe size. |
| ul_interval | Polling interval (if applicable to pipe type). |
| ul_nb_bank | Number of banks associated with this pipe. |
| void UHD_Pipe_CountZero | ( | uint32_t | ul_pipe | ) |
| void UHD_Pipe_Free | ( | uint32_t | ul_pipe | ) |
Free a pipe.
| ul_pipe | Pipe number to free. |
| uint32_t UHD_Pipe_Is_Transfer_Complete | ( | uint32_t | ul_pipe, |
| uint32_t | ul_token_type | ||
| ) |
Check for pipe transfer completion.
| ul_pipe | Pipe number. |
| ul_token_type | Token type. |
| 0 | transfer is not complete. |
| 1 | transfer is complete. |
| uint32_t UHD_Pipe_Read | ( | uint32_t | pipe_num, |
| uint32_t | buf_size, | ||
| uint8_t * | buf | ||
| ) |
Read from a pipe.
| ul_pipe | Pipe number. |
| ul_size | Maximum number of data to read. |
| data | Buffer to store the data. |
| void UHD_Pipe_Send | ( | uint32_t | ul_pipe, |
| uint32_t | ul_token_type | ||
| ) |
Send a pipe content.
| ul_pipe | Pipe number. |
| ul_token_type | Token type. |
| void UHD_Pipe_Write | ( | uint32_t | ul_pipe, |
| uint32_t | ul_size, | ||
| uint8_t * | buf | ||
| ) |
Write into a pipe.
| ul_pipe | Pipe number. |
| ul_size | Maximum number of data to read. |
| data | Buffer containing data to write. |
1.8.15