Delta / NNN50_WIFI_API

Dependents:   NNN50_CE_Test_UDP NNN50_linux_firmware NNN50_SoftAP_HelloWorld NNN50_BLEWIFISensor ... more

Embed: (wiki syntax)

« Back to documentation index

nmspi.c File Reference

nmspi.c File Reference

This module contains NMC1000 SPI protocol bus APIs implementation. More...

Go to the source code of this file.

Functions

static sint8 spi_cmd_rsp (uint8 cmd)
static int spi_cmd_complete (uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz, uint8_t clockless)
static sint8 spi_data_read (uint8 *b, uint16 sz, uint8 clockless)
static sint8 spi_data_write (uint8 *b, uint16 sz)
static sint8 spi_write_reg (uint32 addr, uint32 u32data)
static sint8 nm_spi_write (uint32 addr, uint8 *buf, uint16 size)
static sint8 spi_read_reg (uint32 addr, uint32 *u32data)
static sint8 nm_spi_read (uint32 addr, uint8 *buf, uint16 size)
sint8 nm_spi_init (void)

Detailed Description

This module contains NMC1000 SPI protocol bus APIs implementation.

Copyright (c) 2016-2017 Atmel Corporation. All rights reserved.

Definition in file nmspi.c.


Function Documentation

sint8 nm_spi_init ( void   )

configure protocol

make sure can read back chip id correctly

Definition at line 1206 of file nmspi.c.

static sint8 nm_spi_read ( uint32  addr,
uint8 buf,
uint16  size 
) [static]

Command

Data

Definition at line 1093 of file nmspi.c.

static sint8 nm_spi_write ( uint32  addr,
uint8 buf,
uint16  size 
) [static]

Command

Data

Data RESP

Definition at line 952 of file nmspi.c.

static int spi_cmd_complete ( uint8_t  cmd,
uint32_t  adr,
uint8_t *  b,
uint32_t  sz,
uint8_t  clockless 
) [static]

Command/Control response

State response

Data Respnose header

Read bytes

Read Crc

Read bytes

Read Crc

read data response only on the next DMA cycles not the first DMA since data response header is already handled above for the first DMA.

Data Respnose header

Read bytes

Read Crc

Definition at line 379 of file nmspi.c.

static sint8 spi_cmd_rsp ( uint8  cmd ) [static]

Command/Control response

State response

Definition at line 331 of file nmspi.c.

static sint8 spi_data_read ( uint8 b,
uint16  sz,
uint8  clockless 
) [static]

Data

Data Respnose header

Read bytes

Read Crc

Definition at line 744 of file nmspi.c.

static sint8 spi_data_write ( uint8 b,
uint16  sz 
) [static]

Data

Write command

Write data

Write Crc

Definition at line 813 of file nmspi.c.

static sint8 spi_read_reg ( uint32  addr,
uint32 u32data 
) [static]

NMC1000 clockless registers.

Definition at line 1020 of file nmspi.c.

static sint8 spi_write_reg ( uint32  addr,
uint32  u32data 
) [static]

NMC1000 clockless registers.

Definition at line 893 of file nmspi.c.