RZT Flexible Software Package Documentation  Release v2.3.0

 
Ethernet SELECTOR (r_ether_selector)

Functions

fsp_err_t R_ETHER_SELECTOR_Open (ether_selector_ctrl_t *const p_ctrl, ether_selector_cfg_t const *const p_cfg)
 
fsp_err_t R_ETHER_SELECTOR_Close (ether_selector_ctrl_t *const p_ctrl)
 
fsp_err_t R_ETHER_SELECTOR_ConverterSet (ether_selector_ctrl_t *const p_ctrl, ether_selector_speed_t speed, ether_selector_duplex_t duplex)
 

Detailed Description

Driver for the Ether Selector peripheral on RZ microprocessor. This module implements the Ethernet Selector Interface.

Overview

The control target is the MODCTRL, PHYLNK, and CONVCTRLn registers of the Ethernet Subsystem. There are three Ethernet functional blocks in RZ microprocessor. Gigabit Ethernet MAC (GMAC), Ethernet Switch (ETHSW), EtherCAT Slave Controller (ESC).

These Ethernet functional blocks and PHY are connected via an RGMII converter. For connection with the RGMII converter, GMAC and ETHSW support MII / GMII, and ESC supports MII. From the Ethernet functional block, the port selected by the multiplexer is connected to the port of the RGMII converter. The combination of ports that can be selected is predetermined, and in addition to selecting all ports as ESC or ETHSW, it is possible to select a combination of ESC and GMAC or a mixture of ESC and ETHSW ports.

Features

The main functions of ETHER_SELECTOR are as follows.

Configuration

Build Time Configurations for r_ether_selector

The following build time configurations are defined in fsp_cfg/r_ether_selector_cfg.h:

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) If selected code for parameter checking is included in the build.
Ethernet ModeMCU Specific OptionsSelect Ethernet Port Mode

Configurations for Networking > Ethernet (r_ether_selector)

This module can be added to the Stacks tab via New Stack > Networking > Ethernet (r_ether_selector).

ConfigurationOptionsDefaultDescription
NameName must be a valid C symbolg_ether_selector0 Module name.
Port
  • 0
  • 1
  • 2
  • 3
0 Select the Ethernet port number.
PHY Link Signal Polarity
  • Active-Low
  • Active-High
Active-Low Specify whether to use Active-Low or Active-High.
Interface Type
  • MII
  • RMII
  • RGMII
RGMII Specify whether to use MII or RMII or RGMII.
Converter Speed
  • 100Mbps
  • 1000Mbps
  • 10Mbps
1000Mbps Specify whether to use 100Mbps or 1000Mbps or 10Mbps. (1000Mbps is valid only for RGMII)
Converter Duplex
  • full duplex
  • half duplex
full duplex Specify whether to full duplex or half duplex.
Reference Clock
  • input
  • output
input Specify whether to use the RMII reference clock.

Clock Configuration

This module is used to configure the system clocks. There are no module specific clock configurations required to use it.

Pin Configuration

The ETHER_SELECTOR module is used for configuring pins.

Usage Notes

Examples

ETHER SELECTOR Basic Example

This is a basic example of minimal use of the ETHER SELECTOR in an application.

void ether_selector_basic_example (void)
{
fsp_err_t err = FSP_SUCCESS;
g_ether_selector0_ctrl.open = 0U;
/* Initializes the module. */
err = R_ETHER_SELECTOR_Open(&g_ether_selector0_ctrl, &g_ether_selector0_cfg);
/* Handle any errors. This function should be defined by the user. */
handle_error(err);
/* Change the converter speed and duplex in run-time . */
err =
handle_error(err);
}

Data Structures

struct  ether_selector_instance_ctrl_t
 

Data Structure Documentation

◆ ether_selector_instance_ctrl_t

struct ether_selector_instance_ctrl_t

ETHER SELECTOR control block. DO NOT INITIALIZE. Initialization occurs when ether_selector_api_t::open is called.

Data Fields
uint32_t open Used to determine if the channel is configured.
ether_selector_cfg_t const * p_cfg Pointer to initial configurations.
R_ETHSS_Type * p_reg Pointer to Ethernet Subsystem peripheral registers.

Function Documentation

◆ R_ETHER_SELECTOR_Open()

fsp_err_t R_ETHER_SELECTOR_Open ( ether_selector_ctrl_t *const  p_ctrl,
ether_selector_cfg_t const *const  p_cfg 
)

Initializes the ETHER_SELECTOR module instance. Implements ether_selector_api_t::open.

Return values
FSP_SUCCESSEthernet port configuration set successfully.
FSP_ERR_ASSERTIONPointer to ETHER_SELECTOR control block or configuration structure is NULL.
FSP_ERR_INVALID_CHANNELInvalid channel number is given.
FSP_ERR_INVALID_ARGUMENTConfiguration parameter error.
FSP_ERR_ALREADY_OPENR_ETHER_SELECTOR_Open has already been called for this p_ctrl.

◆ R_ETHER_SELECTOR_Close()

fsp_err_t R_ETHER_SELECTOR_Close ( ether_selector_ctrl_t *const  p_ctrl)

Close driver data. Implements ether_selector_api_t::close.

Return values
FSP_SUCCESSEthernet selector closed.
FSP_ERR_ASSERTIONp_ctrl is NULL.
FSP_ERR_NOT_OPENThe instance control structure is not opened.

◆ R_ETHER_SELECTOR_ConverterSet()

fsp_err_t R_ETHER_SELECTOR_ConverterSet ( ether_selector_ctrl_t *const  p_ctrl,
ether_selector_speed_t  speed,
ether_selector_duplex_t  duplex 
)

Set the converter speed and duplex after initilaize. Speed 1000Mbps is valid for only RGMII. Implements ether_selector_api_t::converterSet.

Return values
FSP_SUCCESSSpeed adn duplex seetings successfully changed.
FSP_ERR_ASSERTIONp_ctrl was NULL.
FSP_ERR_NOT_OPENThe instance control structure is not opened.
FSP_ERR_INVALID_ARGUMENTInvalid parameter in the argument.