MAX32620HSP (MAXREFDES100) RPC Example for Graphical User Interface

Dependencies:   USBDevice

Fork of HSP_Release by Jerry Bradshaw

Embed: (wiki syntax)

« Back to documentation index

QuadSPI Class Reference

QuadSPI Class Reference

This class provides a Quad SPI interface for quad spi devices the class also allows single (4-Wire) communication. More...

#include <QuadSpi.h>

Public Member Functions

 QuadSPI (PinName mosi, PinName miso, PinName sclk, PinName ssel=NC)
 Create a QuadSPI master connected to the specified pins.
virtual int write (int value)
 Write to the Quad SPI Slave and return the response.
int read (void)
 Read from the Quad SPI Slave and return the response.
void setSingleMode ()
 Allow switching to and from Single SPI and Quad SPI.

Detailed Description

This class provides a Quad SPI interface for quad spi devices the class also allows single (4-Wire) communication.

Definition at line 45 of file QuadSpi.h.


Constructor & Destructor Documentation

QuadSPI ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  ssel = NC 
)

Create a QuadSPI master connected to the specified pins.

Initialize a SPI master for Quad SPI.

mosi or miso can be specfied as NC if not used

Parameters:
mosiQuadSPI Master Out, Slave In pin
misoQuadSPI Master In, Slave Out pin
sclkQuadSPI Clock pin
sselQuadSPI chip select pin
mosiPin used for Master Out Slave In
misoPin used for Master In Slave Out
sclkPin used for Clock
sselPin used for Chip Select

Definition at line 43 of file QuadSpi.cpp.


Member Function Documentation

int read ( void   )

Read from the Quad SPI Slave and return the response.

Read a byte in master mode using Quad SPI simplex transfer.

Parameters:
none
Returns:
Response from the SPI slave
Returns the value received from Quad SPI

Definition at line 67 of file QuadSpi.cpp.

void setSingleMode (  )

Allow switching to and from Single SPI and Quad SPI.

Parameters:
none
Returns:
Response from the SPI slave

Definition at line 50 of file QuadSpi.cpp.

int write ( int  value ) [virtual]

Write to the Quad SPI Slave and return the response.

Write a byte out in master mode and receive a value.

Parameters:
valueData to be sent to the SPI slave
Returns:
none
Parameters:
valueByte Value to send
Returns:
Returns Zero

Definition at line 57 of file QuadSpi.cpp.