Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This function is called by a device driver’s NetDev_Init() to configure a specific network device’s clocks on a specific interface.

Files

net_bsp.c

Prototype

Code Block

          static void NetDev_CfgClk (NET_IF  *p_if,
                                     NET_ERR *p_err);


Note: since NetDev_CfgClk() is accessed only by function pointer via a BSP interface structure, it doesn’t need to be globally available and should therefore be declared as ‘static’.

Arguments

pifp_if

Pointer to specific interface to configure device’s clocks.

perrp_err

Pointer to variable that will receive the return error code from this function:

...

This is not an exclusive list of return errors and specific network device’s or device BSP functions may return any other specific errors as required.

Returned Value

None.

Required Configuration

None.

Notes / Warnings

Each network device’s NetDev_CfgClk() should configure and enable all required clocks for the network device. For example, on some devices it may be necessary to enable clock gating for an embedded Ethernet MAC as well as various GPIO modules in order to configure Ethernet Phy pins for (R)MII mode and interrupts.

...

NetDev_[Device]CfgClk[Number]()

[Device]

Network device name or type, e.g. MACB (optional if the development board does not support multiple devices)

[Number]

Network device number for each specific instance of device (optional if the development board does not support multiple instances of the specific device)

For example, the NetDev_CfgClk() function for the #2 MACB Ethernet controller on an Atmel AT91SAM9263-EK should be named NetDev_MACB_CfgClk2(), or NetDev_MACB_CfgClk_2() with additional underscore optional.

See also Chapter 6, “Network Network Board Support Package”Package.