Soltek Ethernet Driver For Mac

0302

Driver API for Ethernet MAC Peripheral (DriverETHMAC.h) Content The Ethernet MAC driver generates call back events that are notified via the function. Configure and control the Ethernet MAC using the. Control codes for function. Specify frame transmit flags. Data Structures struct Ethernet MAC Capabilities. Struct Access structure of the Ethernet MAC Driver. Struct Ethernet MAC Time.

Soltek

Typedefs typedef void(. )(uint32t event) Pointer to: Signal Ethernet Event. Functions (void) Get driver version. (void) Get driver capabilities.

Int32t ( cbevent) Initialize Ethernet MAC Device. Int32t (void) De-initialize Ethernet MAC Device.

Int32t ( state) Control Ethernet MAC Device Power. Int32t (.ptraddr) Get Ethernet MAC Address. Int32t (const.ptraddr) Set Ethernet MAC Address. Int32t (const.ptraddr, uint32t numaddr) Configure Address Filter. Int32t (const uint8t.frame, uint32t len, uint32t flags) Send Ethernet frame. Int32t (uint8t.frame, uint32t len) Read data of received Ethernet frame.

Uint32t (void) Get size of received Ethernet frame. Int32t (.time) Get time of received Ethernet frame. Int32t (.time) Get time of transmitted Ethernet frame. Int32t (uint32t control, uint32t arg) Control Ethernet Interface.

Int32t (uint32t control,.time) Control Precision Timer. Int32t (uint8t phyaddr, uint8t regaddr, uint16t.data) Read Ethernet PHY Register through Management Interface. Int32t (uint8t phyaddr, uint8t regaddr, uint16t data) Write Ethernet PHY Register through Management Interface. Void (uint32t event) Callback function that signals a Ethernet Event. Description Driver API for Ethernet MAC Peripheral (DriverETHMAC.h) The following section describes the Ethernet MAC Interface as defined in the DriverETHMAC.h header file. Data Structure Documentation.

Ethernet MAC Capabilities. An Ethernet MAC driver can be implemented with different capabilities. The data fields of this struct encode the capabilities implemented by this driver.

Access structure of the Ethernet MAC Driver. The functions of the Ethernet MAC are accessed by function pointers. Refer to for overview information. Each instance of an Ethernet MAC provides such an access struct. The instance is indicated by a postfix in the symbol name of the access struct, for example:.

DriverETHMAC0 is the name of the access struct of the first instance (no. DriverETHMAC1 is the name of the access struct of the second instance (no.

A configuration setting in the middleware allows connecting the middleware to a specific driver instance DriverETHMAC n. The default is 0, which connects a middleware to the first instance of a driver. Data Fields (. )(void) Pointer to: Get driver version. (.

)(void) Pointer to: Get driver capabilities. Int32t(. )( cbevent) Pointer to: Initialize Ethernet MAC Device. Int32t(. )(void) Pointer to: De-initialize Ethernet MAC Device. Int32t(.

)( state) Pointer to: Control Ethernet MAC Device Power. Int32t(. )(.ptraddr) Pointer to: Get Ethernet MAC Address. Int32t(. )(const.ptraddr) Pointer to: Set Ethernet MAC Address. Int32t(.

)(const.ptraddr, uint32t numaddr) Pointer to: Configure Address Filter. Int32t(.

)(const uint8t.frame, uint32t len, uint32t flags) Pointer to: Send Ethernet frame. Int32t(. )(uint8t.frame, uint32t len) Pointer to: Read data of received Ethernet frame. Uint32t(. )(void) Pointer to: Get size of received Ethernet frame. Int32t(.

)(.time) Pointer to: Get time of received Ethernet frame. Int32t(. )(.time) Pointer to: Get time of transmitted Ethernet frame. Int32t(. )(uint32t control,.time) Pointer to: Control Precision Timer. Int32t(. )(uint32t control, uint32t arg) Pointer to: Control Ethernet Interface.

Int32t(. )(uint8t phyaddr, uint8t regaddr, uint16t.data) Pointer to: Read Ethernet PHY Register through Management Interface. Int32t(. )(uint8t phyaddr, uint8t regaddr, uint16t data) Pointer to: Write Ethernet PHY Register through Management Interface. Field Documentation.

Initialize Ethernet MAC Device. Parameters in cbevent Pointer to Returns The function ARMETHMACInitialize initializes the Ethernet MAC interface. It is called when the middleware component starts operation.

The function performs the following operations:. Initializes the resources needed for the Ethernet MAC peripheral. Registers the callback function. The parameter cbevent is a pointer to the callback function; use a NULL pointer when no callback signals are required.

Example:. see - Driver Functions.

Control Ethernet MAC Device Power. Parameters in state Power state Returns The function ARMETHMACPowerControl allows you to configure the power modes of the Ethernet MAC interface. The parameter state can be:.

ARMPOWEROFF: Ethernet MAC peripheral is turned off. ARMPOWERFULL: Ethernet MAC peripheral is turned on and fully operational. If power state specifies an unsupported mode, the function returns as status information and the previous power state of the peripheral is unchanged. Multiple calls with the same state generate no error. Example:. see - Driver Functions. Set Ethernet MAC Address.

Parameters in ptraddr Pointer to address Returns The function ARMETHMACSetMacAddress configures Ethernet MAC own address. The Ethernet MAC accepts packets which contains a MAC destination address that matches the address specified with ptraddr.

The Ethernet MAC receiver will accept also packets with addresses configured by function. MAC receiver can be configured to accept also packets with broadcast address, any multicast address or even all packets regardless of address (Promiscuity Mode). This is configured by function with as control parameter. Configure Address Filter. Parameters in ptraddr Pointer to addresses in numaddr Number of addresses to configure Returns The function ARMETHMACSetAddressFilter configures Ethernet MAC receiver address filtering. The Ethernet MAC accepts packets which contains a MAC destination address of the list supplied with ptraddr. The parameter ptraddr provides and array of Ethernet MAC addresses.

The number of addresses is supplied by numaddr. Specifying numadr = 0 disables address filtering previously set with this function. The Ethernet MAC receiver will accept packets addressed to its own address and packets with addresses configured by this function.

MAC receiver can be configured to accept also packets with broadcast address, any multicast address or even all packets regardless of address (Promiscuity Mode). This is configured by function with as control parameter.

Send Ethernet frame. Parameters in frame Pointer to frame buffer with data to send in len Frame buffer length in bytes in flags Frame transmit flags (see ARMETHMACTXFRAME.) Returns The function ARMETHMACSendFrame writes an to the Ethernet MAC transmit buffer.

The Ethernet MAC transmit engine must be enabled by using the function (ARMETHMACCONTROLTX, 1) before a call to this function. The frame data addressed by buf starts with MAC destination and ends with the last Payload data byte. The frame data is copied into the transmit buffer of the Ethernet MAC interface. The function does not wait until the transmission over the Ethernet is complete, however the memory addressed by buf is available for the next Ethernet frame after return. The maximum value for len is implied by the size restrictions of the Ethernet frame but is not verified. Using an invalid value for len may generate unpredicted results. The parameter flags specifies additional attributes for the function as shown in the following table.

Multiple flags can be combined, for example: ARMETHMACTXFRAMEEVENT ARMETHMACTXFRAMETIMESTAMP. Flag bit Description Indicates that it is a fragment of the frame. Allows you to collect multiple fragments before the frame is sent. With event bit set will be called when frame send is complete. Capture the time stamp of the frame. The time stamp can be obtained using the function.

Read data of received Ethernet frame. Parameters in frame Pointer to frame buffer for data to read into in len Frame buffer length in bytes Returns number of data bytes read or execution status. value = 0: number of data bytes read. value. Get size of received Ethernet frame. Returns number of bytes in received frame The function ARMETHMACGetRxFrameSize returns the size of a received.

This function is called before and supplies the value len. The frame size includes MAC destination and ends with the last Payload data byte. Value 0 indicates that no Ethernet frame is available in the receive buffer. Values smaller than minimum size of Ethernet frame or larger than maximum size of Ethernet frame indicate an invalid frame which needs to be discarded by calling. Example:.

see. Control Ethernet Interface. Parameters in control Operation in arg Argument of operation (optional) Returns The function ARMETHMACControl controls the Ethernet MAC interface and executes various operations.

After initialization, the Ethernet transceiver and receiver are disabled. The parameter control specifies an operation as defined in the table Parameter control. The parameter arg provides, depending on the operation, additional information or values. The table lists values for the parameter control. Parameter control Operation Configure the Ethernet MAC interface; For arg values, see table Parameter arg for CONFIGURE Enable or disable the transmitter; arg: 0=disable; 1=enable Enable or disable the receiver; arg: 0=disable; 1=enable Flush a buffer; arg: see table Parameter arg for FLUSH Exit/Enter Sleep mode; arg: 0=exit; 1=enter and wait for Magic packet Configure VLAN Filter for received frames; arg: See table Parameter arg for VLAN Filter The table Parameter arg for CONFIGURE lists the arg values for the control ARMETHMACCONFIGURE.

The values can be ORed in the following way. Mac-(); Parameter arg CONFIGURE Parameter arg Bit Category Description 0.1 Link Speed Set the link speed to 10 Mbps Set the link speed to 100 Mbps Set the link speed to 1 Gbps 2 Link Mode Set the link mode to half duplex Set the link mode to full duplex n.a.

For

Reserved 4 Loopback Test Mode Set the interface into a Loop-back test mode 5 Receiver Checksum offload Enable Receiver Checksum offload 6 Transmitter Checksum offload Enable Transmitter Checksum offload 7 Broadcast Frame address Accept frames with Broadcast address 8 Multicast Frame address Accept frames with any Multicast address 9 Any Frame address Accept frames with any address (Promiscuous Mode) The table Parameter arg for FLUSH lists the arg values for the control ARMETHMACFLUSH. The arg values can be ORed. Parameter arg for FLUSH Parameter arg Bit Category Description 1 Receive buffer Flush the Receive buffer 2 Transmit buffer Flush the Transmit buffer The table Parameter arg for VLAN Filter lists the arg values for the control ARMETHMACVLANFILTER. The arg values can be ORed.

Parameter arg for VLAN Filter Parameter arg Bit Category Description value 0.15 VLAN Tag Set VLAN Tag value 0 16 Use of VLAN Compare the complete 16-bit VLAN Tag value Compare only the 12-bit VLAN Identifier 0 0.16 Disable Disable the VLAN Filter Example. Control Precision Timer. Parameters in control Operation in time Pointer to time structure Returns The function ARMETHMACControlTimer controls the timer required for PTP (Precision Time Protocol).

The parameter control receives ARMETHMACTIMERxxx codes to manage the timer for a PTP enabled Ethernet MAC interface. The parameter time is pointer to a structure that holds time information. Mode Parameters: Timer Controls Description Retrieve the current time and update the content.time.

Set the new time using the values provided with.time. Increment the current time by using the values provided with.time. Decrement the current time by using the values provided with.time. Set the alarm time to the values provided with.time. Set the clock frequency; the value in time-ns is the correction factor in fractional format q31.

Soltek Ethernet Driver For Mac Windows 10

Callback function that signals a Ethernet Event. Parameters in event event notification mask Returns none The function ARMETHMACSignalEvent is a callback function registered by the function. This function is typically called from interrupt service routines (ISR) to indicate that a frame is processed or a special event occurred. The parameter event indicates one or more events that occurred during driver operation. Each event is encoded in a separate bit and therefore it is possible to signal multiple events within the same call.

Not every event is necessarily generated by the driver. This depends on the implemented capabilities stored in the data fields of the structure, which can be retrieved with the function. The following events can be generated: Parameter event Bit Description 0 Occurs after a frame is received. Frame can be read by calling.

1 Occurs after call to to indicate that the frame is transmitted. 2 Indicates that a Magic Packet is received while the driver is in Sleep mode (set by using ). 3 Indicates that a Timer Alarm occurred that was set with using ARMETHMACControlTimer.

This entry was posted on 02.03.2020.