Versions Compared

Key

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

...

Device Driver

...

BSP Functions

...

NetDev_

...

CfgClk()

...

This function is called by a device driver’s NetDev_StartInit() to start and power up the wireless hardware. Anchor11067791106779 Files Anchor11067801106780configure a specific network device’s clocks on a specific interface.

Files

net_bsp.c Anchor11067361106736

Prototype

...

rowspan2

...

Anchor11067371106737 

 

Note: since NetDev_WiFi_StartCfgClk() 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’. Anchor11068571106857static’.

Arguments

Anchor11068791106879 p_if Anchor11322761132276pif

Pointer to specific interface to

...

configure device’s

...

clocks.

Anchor11068801106880 p_err Anchor11322781132278perr

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

...

NET_DEV_ERR_NONE

...

NET_DEV_ERR_FAULT

...

 

...

11081131108113This 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. Anchor11071551107155

Returned Value

...

1107156None. Anchor11071681107168

Required Configuration

Anchor11071691107169None. Anchor11069041106904

Notes / Warnings

Anchor11424191142419Each 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.

Since each network device requires a unique NetDev_WiFi_StartCfgClk(), it is recommended that each device’s NetDev_WiFi_StartCfgClk() function be named using the following convention:anchor

11424201142420NetDev_WiFi_[Device]_StartCfgClk[Number]() Anchor11515441151544

 

Anchor11424211142421[Device] Anchor11424221142422

Network device name or type, e.g.

...

MACB (optional if the development board does not support multiple devices)

Anchor11424231142423[Number] Anchor11424241142424

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

Anchor11069051106905For example, the NetDev_WiFi_StartCfgClk() function for the #2 RS9110 wireless devie MACB Ethernet controller on an Atmel AT91SAM9263-EK should be named NetDev_WiFiMACB_RS9110_Start2CfgClk2(), or NetDev_WiFIMACB_RS9110_StartCfgClk_2() with additional underscore optional.

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