Versions Compared

Key

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

...

For example, a BSP interface structure for the #2 RS9110-N21 wireless module on an Atmel AT91SAM9263-EK board should be named NetDev_BSP_AT91SAM9263-EK_RS9110N21_2{} and declared in the AT91SAM9263-EK board’s net_bsp.c:

And in order for the application to configure an interface with this BSP interface structure, the structure must be externally declared in the AT91SAM9263-EK board’s net_bsp.h :

extern const NET_DEV_BSP_WIFI_SPI NetDev_BSP_AT91SAM9263-EK_RS9110N21_2;

...

Code Block
languagecpp
themeConfluence
firstline1
linenumberstrue
                                                                     /* AT91SAM9263-EK RS9110-N21 #2's BSP fnct ptrs : */
const NET_DEV_BSP_WIFI_SPI NetDev_BSP_AT91SAM9263-EK_RS9110N21_2 = {
                                                                     NetDev_RS9110N21_Start_2
                                                                     NetDev_RS9110N21_Stop_2,
                                                                     NetDev_RS9110N21_CfgGPIO_2,
                                                                     NetDev_RS9110N21_CfgExtIntCtrl_2
                                                                     NetDev_RS9110N21_ExtIntCtrl_2,
                                                                     NetDev_RS9110N21_SPI_Cfg_2,
                                                                     NetDev_RS9110N21_SPI_Lock_2,
                                                                     NetDev_RS9110N21_SPI_Unlock_2,
                                                                     NetDev_RS9110N21_SPI_WrRd_2,
                                                                     NetDev_RS9110N21_SPI_ChipSelEn_2,
                                                                     NetDev_RS9110N21_SPI_ChipSelDis_2,
                                                                     NetDev_RS9110N21_SetCfg_2
                                                                   };


And in order for the application to configure an interface with this BSP interface structure, the structure must be externally declared in the AT91SAM9263-EK board’s net_bsp.h :

extern const NET_DEV_BSP_WIFI_SPI NetDev_BSP_AT91SAM9263-EK_RS9110N21_2;

Lastly, the board’s RS9110-N-21 #2 BSP functions must also be declared in net_bsp.c:

Code Block
languagecpp
themeConfluence
firstline1
linenumberstrue
static void NetDev_RS9110N21_Start_2         (NET_IF                          *p_if,
                                              NET_ERR                         *p_err);
 
static void NetDev_RS9110N21_Stop_2          (NET_IF                          *p_if,
                                              NET_ERR                         *p_err);
 
static void NetDev_RS9110N21_CfgGPIO_2       (NET_IF                          *p_if,
                                              NET_ERR                         *p_err);
 
static void NetDev_RS9110N21_CfgIntCtrl_2    (NET_IF                          *p_if,
                                              NET_ERR                         *p_err);

static void NetDev_RS9110N21_IntCtrl_2       (NET_IF                          *p_if,
                                              CPU_BOOLEAN                      en,
                                              NET_ERR                         *p_err);

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

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

static void NetDev_RS9110N21_SPI_Unlock_2    (NET_IF                          *p_if);

static void NetDev_RS9110N21_SPI_WrRd_2      (NET_IF                          *p_if,
                                              CPU_INT08U                      *p_buf_wr,
                                              CPU_INT08U                      *p_buf_rd,
                                              CPU_INT16U                       len,
                                              NET_ERR                         *p_err);

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

static void NetDev_RS9110N21_SPI_ChipSelDis_2(NET_IF                          *p_if);

static void NetDev_RS9110N21_SPI_Cfg_2       (NET_IF                          *p_if,
                                              NET_DEV_CFG_SPI_CLK_FREQ         freq,
                                              NET_DEV_CFG_SPI_CLK_POL          pol,
                                              NET_DEV_CFG_SPI_CLK_PHASE        phase,
                                              NET_DEV_CFG_SPI_XFER_UNIT_LEN    xfer_unit_len,
                                              NET_DEV_CFG_SPI_XFER_SHIFT_DIR   xfer_shift_dir,
                                              NET_ERR                         *p_err);


Note that since all network device BSP functions are accessed only by function pointer via their corresponding BSP interface structure, they don’t need to be globally available and should therefore be declared as static .

...

Each network device's NetDev_WiFi_Start() must set GPIO pins to power down the wireless chip to reduce the power consumption. For wireless devices, this function is necessary to configure the power pin and other required pins to power down the wireless chip.

See funciton function NetDev_WiFi_Stop for more information.

...