RA Flexible Software Package Documentation  Release v5.6.0

 
USB HCDC_ECM (r_usb_hcdc_ecm)

Functions

fsp_err_t R_USB_HCDC_ECM_Open (ether_ctrl_t *const p_ctrl, ether_cfg_t const *const p_cfg)
 After USB, CDC are reset in software.Implements ether_api_t::open. More...
 
fsp_err_t R_USB_HCDC_ECM_Close (ether_ctrl_t *const p_ctrl)
 Disables interrupts. Removes power and releases hardware lock. Implements ether_api_t::close. More...
 
fsp_err_t R_USB_HCDC_ECM_BufferRelease (ether_ctrl_t *const p_ctrl)
 Move to the next buffer in the circular receive buffer list. Implements ether_api_t::bufferRelease. More...
 
fsp_err_t R_USB_HCDC_ECM_RxBufferUpdate (ether_ctrl_t *const p_ctrl, void *const p_buffer)
 Not support this function in HCDC-ECM. Implements ether_api_t::rxBufferUpdate. More...
 
fsp_err_t R_USB_HCDC_ECM_LinkProcess (ether_ctrl_t *const p_ctrl)
 The Link up processing, the Link down processing, and the magic packet detection processing are executed. Implements ether_api_t::linkProcess. More...
 
fsp_err_t R_USB_HCDC_ECM_WakeOnLANEnable (ether_ctrl_t *const p_ctrl)
 Not support this function in HCDC-ECM. Implements ether_api_t::wakeOnLANEnable. More...
 
fsp_err_t R_USB_HCDC_ECM_Read (ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t *const p_length_bytes)
 Receive USB data. Receives data to the location specified by the pointer to the receive buffer. Implements ether_api_t::read. More...
 
fsp_err_t R_USB_HCDC_ECM_Write (ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t const length)
 Transmit USB data. Transmits data from the location specified by the pointer to the transmit buffer, with the data size equal to the specified frame length. Implements ether_api_t::write. More...
 
fsp_err_t R_USB_HCDC_ECM_TxStatusGet (ether_ctrl_t *const p_ctrl, void *const p_buffer_address)
 Not support this function in HCDC-ECM. Implements ether_api_t::txStatusGet. More...
 
fsp_err_t R_USB_HCDC_ECM_CallbackSet (ether_ctrl_t *const p_api_ctrl, void(*p_callback)(ether_callback_args_t *), void const *const p_context, ether_callback_args_t *const p_callback_memory)
 

Detailed Description

This module provides a USB Host Communications Device Class (HCDC-ECM) driver. It implements the USB HCDC_ECM (r_usb_hcdc_ecm).

Functions

Refer to USB (r_usb_basic) for the common API (r_usb_basic) to be called from the application.

Detailed Description

Overview

The r_usb_hcdc_ecm module, when used in combination with the r_usb_basic and r_usb_hcdc modules, operates as a USB Host Communications Device Class (HCDC-ECM) driver. The HCDC-ECM conforms to subclass ethernet control model of the USB Communications Device Class (CDC) specification and enables communication with a CDC peripheral device.

Features

The r_usb_hcdc_ecm module has the following key features:

Usage Notes

Basic Functions

The main functions of HCDC are the following:

Class Request

This driver uses the following class request.

Limitations

This driver has the following limitations:

Dependenies

Requirements

Constraints

This driver has the following constrains.

Operation Checking Convertes

The following converters have been confirmed to work properly:

Examples

USB HCDC-ECM Example

The following is the porting layere example code for FreeRTOS Plus TCP

#define USR_TEST_DOMAIN_NAME "www.freertos.org"
#define USR_TEST_PING_IP "172.217.160.174"
#define USR_PING_COUNT 100
#define USR_APP_DELAY_TICKS 100
#define USR_PING_WAIT_MS 100
#define USR_PING_DATA_SIZE 8
#define MAC_ADDRESS_BYTES 6
#define SUCCESS 0
#define PRINT_UP_MSG_DISABLE 0x01
#define PRINT_DOWN_MSG_DISABLE 0x02
#define PRINT_NWK_USR_MSG_DISABLE 0x04
#define ETHERNET_LINK_DOWN 0x01
#define ETHERNET_LINK_UP 0x00
#define IP_LINK_DOWN 0x02
#define IP_LINK_UP 0x00
/* Domain for the DNS Host lookup is used in this Example Project.
* The project can be built with different *domain_name to validate the DNS client
*/
char * domain_name = USR_TEST_DOMAIN_NAME;
/* IP address of the PC or any Device on the LAN/WAN where the Ping request is sent.
* Note: Users needs to change this according to the LAN settings of your Test PC or device
* when running this project.
*/
#if (ipconfigUSE_DHCP != 0)
char ip_address_buffer[16] = {RESET_VALUE};
char * remote_ip_address = ip_address_buffer;
#else
char * remote_ip_address = "192.168.10.1";
#endif
#if (ipconfigSUPPORT_OUTGOING_PINGS == 1)
#define PING_INTERVAL_TICKS 200
uint32_t usrPingCount = RESET_VALUE;
typedef struct st_ping_data
{
uint32_t sent; // Ping Request
uint32_t received; // Ping Response
uint32_t lost; // Ping failure
} ping_data_t;
ping_data_t ping_data = {RESET_VALUE, RESET_VALUE, RESET_VALUE};
#endif
BaseType_t xRet;
BaseType_t xEndPointCount = 0;
static NetworkInterface_t xInterfaces[1];
static NetworkEndPoint_t xEndPoints[4];
extern NetworkInterface_t * pxFSP_Eth_FillInterfaceDescriptor(BaseType_t xEMACIndex, NetworkInterface_t * pxInterface);
#if (ipconfigUSE_DHCP != 0)
/* DHCP populates these IP address, Sub net mask and Gateway Address. So start with this is zeroed out values
* The MAC address is Test MAC address.
*/
static uint8_t ucMACAddress[6] = {RESET_VALUE};
static uint8_t ucIPAddress[4] = {RESET_VALUE};
static uint8_t ucNetMask[4] = {RESET_VALUE};
static uint8_t ucGatewayAddress[4] = {RESET_VALUE};
static uint8_t ucDNSServerAddress[4] = {RESET_VALUE};
#else
/* Static IP configuration, when DHCP mode is not used for the Example Project.
* This needs to be populated by the user according to the Network Settings of your LAN.
* This sample address taken from the LAN where it is tested. This is different for different LAN.
* get the Address using the PC IPconfig details.
*/
static uint8_t ucMACAddress[6] = {RESET_VALUE};
static uint8_t ucIPAddress[4] = {192, 168, 10, 2};
static uint8_t ucNetMask[4] = {255, 255, 255, 0};
static uint8_t ucGatewayAddress[4] = {192, 168, 10, 0};
static uint8_t ucDNSServerAddress[4] = {RESET_VALUE};
#endif
#if (ipconfigUSE_DHCP != 0)
NetworkAddressingParameters_t xNetworkAddressing = {0, 0, 0, 0, 0};
NetworkAddressingParameters_t xNd = {RESET_VALUE, RESET_VALUE, RESET_VALUE, RESET_VALUE, RESET_VALUE};
#endif
#if (ipconfigUSE_DHCP != 0)
void updateDhcpResponseToUsr(void);
eDHCPCallbackAnswer_t xApplicationDHCPHook(eDHCPCallbackPhase_t eDHCPPhase, uint32_t ulIPAddress);
eDHCPCallbackAnswer_t xApplicationDHCPHook_Multi(eDHCPCallbackPhase_t eDHCPPhase,
struct xNetworkEndPoint * pxEndPoint,
IP_Address_t * pxIPAddress);
#endif
extern usb_hcdc_ecm_instance_ctrl_t g_ether_usb_ctrl;
static uint32_t usr_print_ability = RESET_VALUE;
uint32_t dhcp_in_use = RESET_VALUE;
uint32_t isNetworkUp(void);
BaseType_t vSendPing(const char * pcIPAddress);
void pingSendFunc(void);
void print_ipconfig(void);
void print_pingResult(void);
void dnsQuerryFunc(char * domain_name);
void vTatgetEventProcess(ether_callback_args_t * p_args);
BaseType_t vSendPing (const char * pcIPAddress)
{
uint32_t ulIPAddress = RESET_VALUE;
/*
* The pcIPAddress parameter holds the destination IP address as a string in
* decimal dot notation (for example, ?192.168.0.200?). Convert the string into
* the required 32-bit format.
*/
ulIPAddress = FreeRTOS_inet_addr(pcIPAddress);
/*
* Send a ping request containing 8 data bytes. Wait (in the Blocked state) a
* maximum of 100ms for a network buffer into which the generated ping request
* can be written and sent.
*/
return FreeRTOS_SendPingRequest(ulIPAddress, USR_PING_DATA_SIZE, USR_PING_WAIT_MS / portTICK_PERIOD_MS);
}
#if (ipconfigSUPPORT_OUTGOING_PINGS == 1)
void vApplicationPingReplyHook (ePingReplyStatus_t eStatus, uint16_t usIdentifier)
{
(void) usIdentifier;
switch (eStatus)
{
/* A valid ping reply has been received */
case eSuccess:
ping_data.received++;
break;
/* A reply was received but it was not valid. */
case eInvalidData:
default:
ping_data.lost++;
break;
}
}
#endif
uint32_t isNetworkUp (void)
{
BaseType_t networkUp = pdFALSE;
uint32_t status;
networkUp = FreeRTOS_IsNetworkUp();
if (pdTRUE == networkUp)
{
status = SUCCESS;
}
else
{
status = IP_LINK_DOWN;
}
return status;
}
void new_thread0_entry (void * pvParameters)
{
fsp_pack_version_t version = {RESET_VALUE};
FSP_PARAMETER_NOT_USED(pvParameters);
/* version get API for FLEX pack information */
R_FSP_VersionGet(&version);
R_USB_HCDC_ECM_CallbackSet((ether_ctrl_t * const) &g_ether_usb_ctrl, vTatgetEventProcess, NULL, NULL);
/* Example Project information printed on the RTT */
APP_PRINT(BANNER_INFO,
EP_VERSION,
version.version_id_b.major,
version.version_id_b.minor,
version.version_id_b.patch);
/* Prints the Ethernet Configuration prior to the IP Init*/
APP_PRINT(ETH_PREINIT);
print_ipconfig();
/* Initialize the interface descriptor. */
pxFSP_Eth_FillInterfaceDescriptor(0, &xInterfaces[0]);
/* === End-point 0 === */
#if (ipconfigUSE_IPv4 != 0)
FreeRTOS_FillEndPoint(&(xInterfaces[0]),
&(xEndPoints[xEndPointCount]),
ucIPAddress,
ucNetMask,
ucGatewayAddress,
ucDNSServerAddress,
ucMACAddress);
#if (ipconfigUSE_DHCP != 0)
{
/* End-point 0 wants to use DHCPv4. */
xEndPoints[xEndPointCount].bits.bWantDHCP = pdTRUE;
}
#endif /* ( ipconfigUSE_DHCP != 0 ) */
xEndPointCount += 1;
#endif /* ( ipconfigUSE_IPv4 != 0 */
FreeRTOS_IPInit_Multi();
APP_PRINT(ETH_POSTINIT);
while (true)
{
/* Check if Both the Ethernet Link and IP link are UP */
if (SUCCESS == isNetworkUp())
{
/* usr_print_ability is added to avoid multiple UP messages or Down Messages repeating*/
if (!(PRINT_UP_MSG_DISABLE & usr_print_ability))
{
APP_PRINT("\r\nNetwork is Up");
usr_print_ability |= PRINT_UP_MSG_DISABLE;
}
if (!(PRINT_NWK_USR_MSG_DISABLE & usr_print_ability))
{
#if (ipconfigUSE_DHCP != 0)
if (dhcp_in_use)
{
/* Display the New IP credentials obtained from the DHCP server */
updateDhcpResponseToUsr();
FreeRTOS_GetEndPointConfiguration(NULL,
&xNd.ulNetMask,
&xNd.ulGatewayAddress,
&xNd.ulDNSServerAddress,
&xEndPoints[0]);
/* Updated IP credentials on to the RTT console */
print_ipconfig();
/*DNS lookup for the Domain name requested. This is Synchronous Activity */
dnsQuerryFunc(domain_name);
pingSendFunc();
print_pingResult();
usr_print_ability |= PRINT_NWK_USR_MSG_DISABLE;
}
#else
/* Updated IP credentials on to the RTT console */
print_ipconfig();
pingSendFunc();
print_pingResult();
usr_print_ability |= PRINT_NWK_USR_MSG_DISABLE;
#endif
}
}
else
{
if (!(PRINT_DOWN_MSG_DISABLE & usr_print_ability))
{
APP_PRINT("\r\nNetwork is Down");
usr_print_ability |= PRINT_DOWN_MSG_DISABLE;
}
else
{
APP_PRINT(".");
}
}
vTaskDelay(USR_APP_DELAY_TICKS);
}
}
#if (ipconfigUSE_DHCP != 0)
eDHCPCallbackAnswer_t xApplicationDHCPHook (eDHCPCallbackPhase_t eDHCPPhase, uint32_t ulIPAddress)
{
eDHCPCallbackAnswer_t eReturn = eDHCPContinue;
/*
* This hook is called in a couple of places during the DHCP process, as identified by the eDHCPPhase parameter.
*/
switch (eDHCPPhase)
{
case eDHCPPhasePreDiscover:
/*
* A DHCP discovery is about to be sent out. eDHCPContinue is returned to allow the discovery to go out.
* If eDHCPUseDefaults had been returned instead then the DHCP process would be stopped and the statically
* configured IP address would be used.
* If eDHCPStopNoChanges had been returned instead then the DHCP process would be stopped and whatever the
* current network configuration was would continue to be used.
*/
break;
case eDHCPPhasePreRequest:
/* An offer has been received from the DHCP server, and the offered IP address is passed in the ulIPAddress
* parameter.
*/
/*
* The sub-domains don?t match, so continue with the DHCP process so the offered IP address is used.
*/
/* Update the Structure, the DHCP state Machine is not updating this */
xNetworkAddressing.ulDefaultIPAddress = ulIPAddress;
dhcp_in_use = 1;
break;
default:
/*
* Cannot be reached, but set eReturn to prevent compiler warnings where compilers are disposed to generating one.
*/
break;
}
return eReturn;
}
eDHCPCallbackAnswer_t xApplicationDHCPHook_Multi (eDHCPCallbackPhase_t eDHCPPhase,
struct xNetworkEndPoint * pxEndPoint,
IP_Address_t * pxIPAddress)
{
eDHCPCallbackAnswer_t eReturn = eDHCPContinue;
/*
* This hook is called in a couple of places during the DHCP process, as identified by the eDHCPPhase parameter.
*/
switch (eDHCPPhase)
{
case eDHCPPhasePreDiscover:
/*
* A DHCP discovery is about to be sent out. eDHCPContinue is returned to allow the discovery to go out.
* If eDHCPUseDefaults had been returned instead then the DHCP process would be stopped and the statically
* configured IP address would be used.
* If eDHCPStopNoChanges had been returned instead then the DHCP process would be stopped and whatever the
* current network configuration was would continue to be used.
*/
break;
case eDHCPPhasePreRequest:
/* An offer has been received from the DHCP server, and the offered IP address is passed in the ulIPAddress
* parameter.
*/
/*
* The sub-domains don?t match, so continue with the DHCP process so the offered IP address is used.
*/
/* Update the Structure, the DHCP state Machine is not updating this */
xNetworkAddressing.ulDefaultIPAddress = pxIPAddress->ulIP_IPv4;
dhcp_in_use = 1;
break;
default:
/*
* Cannot be reached, but set eReturn to prevent compiler warnings where compilers are disposed to generating one.
*/
break;
}
return eReturn;
}
#endif
void pingSendFunc (void)
{
#if (ipconfigSUPPORT_OUTGOING_PINGS == 1)
BaseType_t status = pdFALSE;
APP_PRINT("\r\n");
while (usrPingCount < USR_PING_COUNT)
{
/* Send a ICMP Ping request to the requested IP address
* USR_PING_COUNT (100) is used in this Example Project
* For Continuous testing the count can be increased to bigger number
*/
status = vSendPing((char *) remote_ip_address);
if (status != pdFALSE)
{
ping_data.sent++;
APP_PRINT("!");
}
else
{
ping_data.lost++;
APP_PRINT(".");
}
usrPingCount++;
/* Add some delay between Pings */
vTaskDelay(PING_INTERVAL_TICKS);
}
#endif
}
void print_pingResult (void)
{
#if (ipconfigSUPPORT_OUTGOING_PINGS == 1)
APP_PRINT("\r\n \r\nPing Statistics for %s :\r\n", (char *) remote_ip_address);
APP_PRINT("\r\nPackets: Sent = %02d, Received = %02d, Lost = %02d \r\n",
ping_data.sent,
ping_data.received,
ping_data.lost);
#endif
}
void print_ipconfig (void)
{
#if (ipconfigUSE_DHCP != 0)
if (dhcp_in_use)
{
ucNetMask[3] = (uint8_t) ((xNd.ulNetMask & 0xFF000000) >> 24);
ucNetMask[2] = (uint8_t) ((xNd.ulNetMask & 0x00FF0000) >> 16);
ucNetMask[1] = (uint8_t) ((xNd.ulNetMask & 0x0000FF00) >> 8);
ucNetMask[0] = (uint8_t) (xNd.ulNetMask & 0x000000FF);
ucGatewayAddress[3] = (uint8_t) ((xNd.ulGatewayAddress & 0xFF000000) >> 24);;
ucGatewayAddress[2] = (uint8_t) ((xNd.ulGatewayAddress & 0x00FF0000) >> 16);
ucGatewayAddress[1] = (uint8_t) ((xNd.ulGatewayAddress & 0x0000FF00) >> 8);
ucGatewayAddress[0] = (uint8_t) (xNd.ulGatewayAddress & 0x000000FF);
ucDNSServerAddress[3] = (uint8_t) ((xNd.ulDNSServerAddress & 0xFF000000) >> 24);
ucDNSServerAddress[2] = (uint8_t) ((xNd.ulDNSServerAddress & 0x00FF0000) >> 16);
ucDNSServerAddress[1] = (uint8_t) ((xNd.ulDNSServerAddress & 0x0000FF00) >> 8);
ucDNSServerAddress[0] = (uint8_t) (xNd.ulDNSServerAddress & 0x000000FF);
ucIPAddress[3] = (uint8_t) ((xNd.ulDefaultIPAddress & 0xFF000000) >> 24);
ucIPAddress[2] = (uint8_t) ((xNd.ulDefaultIPAddress & 0x00FF0000) >> 16);
ucIPAddress[1] = (uint8_t) ((xNd.ulDefaultIPAddress & 0x0000FF00) >> 8);
ucIPAddress[0] = (uint8_t) (xNd.ulDefaultIPAddress & 0x000000FF);
}
#endif
APP_PRINT("\r\nEthernet adapter for Renesas "KIT_NAME ":\r\n")
APP_PRINT("\tDescription . . . . . . . . . . . : Renesas "KIT_NAME " Ethernet\r\n");
APP_PRINT("\tPhysical Address. . . . . . . . . : %02x-%02x-%02x-%02x-%02x-%02x\r\n",
ucMACAddress[0],
ucMACAddress[1],
ucMACAddress[2],
ucMACAddress[3],
ucMACAddress[4],
ucMACAddress[5]);
APP_PRINT("\tDHCP Enabled. . . . . . . . . . . : %s\r\n", dhcp_in_use ? "Yes" : "No")
APP_PRINT("\tIPv4 Address. . . . . . . . . . . : %d.%d.%d.%d\r\n",
ucIPAddress[0],
ucIPAddress[1],
ucIPAddress[2],
ucIPAddress[3]);
APP_PRINT("\tSubnet Mask . . . . . . . . . . . : %d.%d.%d.%d\r\n",
ucNetMask[0],
ucNetMask[1],
ucNetMask[2],
ucNetMask[3]);
APP_PRINT("\tDefault Gateway . . . . . . . . . : %d.%d.%d.%d\r\n",
ucGatewayAddress[0],
ucGatewayAddress[1],
ucGatewayAddress[2],
ucGatewayAddress[3]);
APP_PRINT("\tDNS Servers . . . . . . . . . . . : %d.%d.%d.%d\r\n",
ucDNSServerAddress[0],
ucDNSServerAddress[1],
ucDNSServerAddress[2],
ucDNSServerAddress[3]);
}
void dnsQuerryFunc (char * domain)
{
uint32_t ulIPAddress = RESET_VALUE;
int8_t cBuffer[16] = {RESET_VALUE};
/* Lookup the IP address of the FreeRTOS.org website. */
ulIPAddress = FreeRTOS_gethostbyname((char *) domain);
if (ulIPAddress != 0)
{
/* Convert the IP address to a string. */
FreeRTOS_inet_ntoa(ulIPAddress, (char *) cBuffer);
/* Print out the IP address obtained from the DNS lookup. */
APP_PRINT("\r\nDNS Lookup for \"www.freertos.org\" is : %s \r\n", cBuffer);
/* Overwrites the user-specified Ping request destination with the IP address obtained from the domain.*/
memcpy((void *) remote_ip_address, (const void *) cBuffer, strlen((const char *) cBuffer) + 1);
}
else
{
APP_PRINT("\r\nDNS Lookup failed for \"www.freertos.org\" \r\n");
remote_ip_address = USR_TEST_PING_IP;
}
}
#if (ipconfigUSE_DHCP != 0)
void updateDhcpResponseToUsr (void)
{
if (dhcp_in_use)
{
memcpy(&xNd, &xNetworkAddressing, sizeof(xNd));
}
}
#endif
#if (ipconfigDHCP_REGISTER_HOSTNAME == 1)
const char * pcApplicationHostnameHook (void)
{
return KIT_NAME;
}
#endif
void vTatgetEventProcess (ether_callback_args_t * p_args)
{
uint8_t * mac_address;
mac_address = (uint8_t *) p_args->p_context;
FreeRTOS_UpdateMACAddress(mac_address);
memcpy(ucMACAddress, mac_address, MAC_ADDRESS_BYTES);
}

Data Structures

struct  usb_hcdc_ecm_instance_ctrl_t
 

Data Structure Documentation

◆ usb_hcdc_ecm_instance_ctrl_t

struct usb_hcdc_ecm_instance_ctrl_t

USB HCDC ECM control block. DO NOT INITIALIZE. Initialization occurs when ether_api_t::open is called.

Public Member Functions

uint8_t read_buffer [HCDC_ECM_READ_DATA_LEN] __attribute__ ((__aligned__(4)))
 Buffer area for read data.
 

Data Fields

uint32_t open
 Used to determine if the channel is configured.
 
uint32_t receive_size
 Received data size.
 
uint32_t receive_status
 Status of receive result.
 

Function Documentation

◆ R_USB_HCDC_ECM_Open()

fsp_err_t R_USB_HCDC_ECM_Open ( ether_ctrl_t *const  p_ctrl,
ether_cfg_t const *const  p_cfg 
)

After USB, CDC are reset in software.Implements ether_api_t::open.

Return values
FSP_SUCCESSChannel opened successfully.
FSP_ERR_USB_NOT_OPENUSB module is not open..
FSP_ERR_ALREADY_OPENRTOS internal error.

◆ R_USB_HCDC_ECM_Close()

fsp_err_t R_USB_HCDC_ECM_Close ( ether_ctrl_t *const  p_ctrl)

Disables interrupts. Removes power and releases hardware lock. Implements ether_api_t::close.

Return values
FSP_SUCCESSChannel successfully closed.

◆ R_USB_HCDC_ECM_BufferRelease()

fsp_err_t R_USB_HCDC_ECM_BufferRelease ( ether_ctrl_t *const  p_ctrl)

Move to the next buffer in the circular receive buffer list. Implements ether_api_t::bufferRelease.

Return values
FSP_ERR_UNSUPPORTEDThis function is not supported.

◆ R_USB_HCDC_ECM_RxBufferUpdate()

fsp_err_t R_USB_HCDC_ECM_RxBufferUpdate ( ether_ctrl_t *const  p_ctrl,
void *const  p_buffer 
)

Not support this function in HCDC-ECM. Implements ether_api_t::rxBufferUpdate.

Return values
FSP_ERR_UNSUPPORTEDThis function is not supported.

◆ R_USB_HCDC_ECM_LinkProcess()

fsp_err_t R_USB_HCDC_ECM_LinkProcess ( ether_ctrl_t *const  p_ctrl)

The Link up processing, the Link down processing, and the magic packet detection processing are executed. Implements ether_api_t::linkProcess.

Return values
FSP_SUCCESSLink is up.
FSP_ERR_USB_FAILEDLink is not up.

◆ R_USB_HCDC_ECM_WakeOnLANEnable()

fsp_err_t R_USB_HCDC_ECM_WakeOnLANEnable ( ether_ctrl_t *const  p_ctrl)

Not support this function in HCDC-ECM. Implements ether_api_t::wakeOnLANEnable.

Return values
FSP_ERR_UNSUPPORTEDThis function is not supported.

◆ R_USB_HCDC_ECM_Read()

fsp_err_t R_USB_HCDC_ECM_Read ( ether_ctrl_t *const  p_ctrl,
void *const  p_buffer,
uint32_t *const  p_length_bytes 
)

Receive USB data. Receives data to the location specified by the pointer to the receive buffer. Implements ether_api_t::read.

Return values
FSP_SUCCESSProcessing completed successfully.
FSP_ERR_NOT_OPENThe control block has not been opened.
FSP_ERR_INVALID_STATEUSB data read failure.

◆ R_USB_HCDC_ECM_Write()

fsp_err_t R_USB_HCDC_ECM_Write ( ether_ctrl_t *const  p_ctrl,
void *const  p_buffer,
uint32_t const  length 
)

Transmit USB data. Transmits data from the location specified by the pointer to the transmit buffer, with the data size equal to the specified frame length. Implements ether_api_t::write.

Return values
FSP_SUCCESSProcessing completed successfully.
FSP_ERR_NOT_OPENThe control block has not been opened.
FSP_ERR_INVALID_STATEUSB data write failure.
FSP_ERR_INVALID_ARGUMENTValue of the send frame size is out of range.

◆ R_USB_HCDC_ECM_TxStatusGet()

fsp_err_t R_USB_HCDC_ECM_TxStatusGet ( ether_ctrl_t *const  p_ctrl,
void *const  p_buffer_address 
)

Not support this function in HCDC-ECM. Implements ether_api_t::txStatusGet.

Return values
FSP_ERR_UNSUPPORTEDThis function is not supported.

◆ R_USB_HCDC_ECM_CallbackSet()

fsp_err_t R_USB_HCDC_ECM_CallbackSet ( ether_ctrl_t *const  p_api_ctrl,
void(*)(ether_callback_args_t *)  p_callback,
void const *const  p_context,
ether_callback_args_t *const  p_callback_memory 
)

Updates the user callback with the option to provide memory for the callback argument structure. Implements ether_api_t::callbackSet.

Return values
FSP_SUCCESSCallback updated successfully.
FSP_ERR_NO_CALLBACK_MEMORYp_callback is non-secure and p_callback_memory is either secure or NULL.