Mistake on this page?
Report an issue in GitHub or email us
Modules | Data Structures | Typedefs | Enumerations | Functions
QSPI HAL

Modules

 Tests
 QSPI tests of the HAL.
 

Data Structures

struct  qspi_pinmap_t
 
struct  qspi_command
 QSPI command. More...
 

Typedefs

typedef struct qspi_s qspi_t
 QSPI HAL object. More...
 
typedef enum qspi_bus_width qspi_bus_width_t
 QSPI Bus width. More...
 
typedef enum qspi_address_size qspi_address_size_t
 Address size in bits. More...
 
typedef uint8_t qspi_alt_size_t
 Alternative size in bits. More...
 
typedef struct qspi_command qspi_command_t
 QSPI command. More...
 
typedef enum qspi_status qspi_status_t
 QSPI return status. More...
 

Enumerations

Functions

qspi_status_t qspi_init (qspi_t *obj, PinName io0, PinName io1, PinName io2, PinName io3, PinName sclk, PinName ssel, uint32_t hz, uint8_t mode)
 Initialize QSPI peripheral. More...
 
qspi_status_t qspi_init_direct (qspi_t *obj, const qspi_pinmap_t *pinmap, uint32_t hz, uint8_t mode)
 Initialize QSPI peripheral. More...
 
qspi_status_t qspi_free (qspi_t *obj)
 Deinitilize QSPI peripheral. More...
 
qspi_status_t qspi_frequency (qspi_t *obj, int hz)
 Set the QSPI baud rate. More...
 
qspi_status_t qspi_write (qspi_t *obj, const qspi_command_t *command, const void *data, size_t *length)
 Send a command and block of data. More...
 
qspi_status_t qspi_command_transfer (qspi_t *obj, const qspi_command_t *command, const void *tx_data, size_t tx_size, void *rx_data, size_t rx_size)
 Send a command (and optionally data) and get the response. More...
 
qspi_status_t qspi_read (qspi_t *obj, const qspi_command_t *command, void *data, size_t *length)
 Receive a command and block of data. More...
 
const PinMapqspi_master_sclk_pinmap (void)
 Get the pins that support QSPI SCLK. More...
 
const PinMapqspi_master_ssel_pinmap (void)
 Get the pins that support QSPI SSEL. More...
 
const PinMapqspi_master_data0_pinmap (void)
 Get the pins that support QSPI DATA0. More...
 
const PinMapqspi_master_data1_pinmap (void)
 Get the pins that support QSPI DATA1. More...
 
const PinMapqspi_master_data2_pinmap (void)
 Get the pins that support QSPI DATA2. More...
 
const PinMapqspi_master_data3_pinmap (void)
 Get the pins that support QSPI DATA3. More...
 

Detailed Description

Typedef Documentation

Address size in bits.

typedef uint8_t qspi_alt_size_t

Alternative size in bits.

Definition at line 79 of file qspi_api.h.

QSPI Bus width.

Some parts of commands provide variable bus width

typedef struct qspi_command qspi_command_t

QSPI command.

Defines a frame format. It consists of instruction, address, alternative, dummy count and data

typedef enum qspi_status qspi_status_t

QSPI return status.

typedef struct qspi_s qspi_t

QSPI HAL object.

Definition at line 40 of file qspi_api.h.

Enumeration Type Documentation

Address size in bits.

Definition at line 70 of file qspi_api.h.

QSPI Bus width.

Some parts of commands provide variable bus width

Definition at line 62 of file qspi_api.h.

QSPI return status.

Enumerator
QSPI_STATUS_ERROR 

Generic error >

QSPI_STATUS_INVALID_PARAMETER 

The parameter is invalid >

QSPI_STATUS_OK 

Function executed sucessfully >

Definition at line 118 of file qspi_api.h.

Function Documentation

qspi_status_t qspi_command_transfer ( qspi_t obj,
const qspi_command_t command,
const void *  tx_data,
size_t  tx_size,
void *  rx_data,
size_t  rx_size 
)

Send a command (and optionally data) and get the response.

Can be used to send/receive device specific commands

Parameters
objQSPI object
commandQSPI command
tx_dataTX buffer
tx_sizeTX buffer length in bytes
rx_dataRX buffer
rx_sizeRX buffer length in bytes
Returns
QSPI_STATUS_OK if the data has been succesfully sent QSPI_STATUS_INVALID_PARAMETER if invalid parameter found QSPI_STATUS_ERROR otherwise
qspi_status_t qspi_free ( qspi_t obj)

Deinitilize QSPI peripheral.

It should release pins that are associated with the QSPI object, and disable clocks for QSPI peripheral module that was associated with the object

Parameters
objQSPI object
Returns
QSPI_STATUS_OK if deinitialisation successfully executed QSPI_STATUS_INVALID_PARAMETER if invalid parameter found QSPI_STATUS_ERROR otherwise
qspi_status_t qspi_frequency ( qspi_t obj,
int  hz 
)

Set the QSPI baud rate.

Actual frequency may differ from the desired frequency due to available dividers and the bus clock Configures the QSPI peripheral's baud rate

Parameters
objThe SPI object to configure
hzThe baud rate in Hz
Returns
QSPI_STATUS_OK if frequency was set QSPI_STATUS_INVALID_PARAMETER if invalid parameter found QSPI_STATUS_ERROR otherwise
qspi_status_t qspi_init ( qspi_t obj,
PinName  io0,
PinName  io1,
PinName  io2,
PinName  io3,
PinName  sclk,
PinName  ssel,
uint32_t  hz,
uint8_t  mode 
)

Initialize QSPI peripheral.

It should initialize QSPI pins (io0-io3, sclk and ssel), set frequency, clock polarity and phase mode. The clock for the peripheral should be enabled

Parameters
objQSPI object
io0Data pin 0
io1Data pin 1
io2Data pin 2
io3Data pin 3
sclkThe clock pin
sselThe chip select pin
hzThe bus frequency
modeClock polarity and phase mode (0 - 3)
Returns
QSPI_STATUS_OK if initialisation successfully executed QSPI_STATUS_INVALID_PARAMETER if invalid parameter found QSPI_STATUS_ERROR otherwise
qspi_status_t qspi_init_direct ( qspi_t obj,
const qspi_pinmap_t pinmap,
uint32_t  hz,
uint8_t  mode 
)

Initialize QSPI peripheral.

It should initialize QSPI pins (io0-io3, sclk and ssel), set frequency, clock polarity and phase mode. The clock for the peripheral should be enabled

Parameters
objQSPI object
pinmappointer to structure which holds static pinmap
hzThe bus frequency
modeClock polarity and phase mode (0 - 3)
Returns
QSPI_STATUS_OK if initialisation successfully executed QSPI_STATUS_INVALID_PARAMETER if invalid parameter found QSPI_STATUS_ERROR otherwise
const PinMap* qspi_master_data0_pinmap ( void  )

Get the pins that support QSPI DATA0.

Return a PinMap array of pins that support QSPI DATA0 in master mode. The array is terminated with {NC, NC, 0}.

Returns
PinMap array
const PinMap* qspi_master_data1_pinmap ( void  )

Get the pins that support QSPI DATA1.

Return a PinMap array of pins that support QSPI DATA1 in master mode. The array is terminated with {NC, NC, 0}.

Returns
PinMap array
const PinMap* qspi_master_data2_pinmap ( void  )

Get the pins that support QSPI DATA2.

Return a PinMap array of pins that support QSPI DATA2 in master mode. The array is terminated with {NC, NC, 0}.

Returns
PinMap array
const PinMap* qspi_master_data3_pinmap ( void  )

Get the pins that support QSPI DATA3.

Return a PinMap array of pins that support QSPI DATA3 in master mode. The array is terminated with {NC, NC, 0}.

Returns
PinMap array
const PinMap* qspi_master_sclk_pinmap ( void  )

Get the pins that support QSPI SCLK.

Return a PinMap array of pins that support QSPI SCLK in master mode. The array is terminated with {NC, NC, 0}.

Returns
PinMap array
const PinMap* qspi_master_ssel_pinmap ( void  )

Get the pins that support QSPI SSEL.

Return a PinMap array of pins that support QSPI SSEL in master mode. The array is terminated with {NC, NC, 0}.

Returns
PinMap array
qspi_status_t qspi_read ( qspi_t obj,
const qspi_command_t command,
void *  data,
size_t *  length 
)

Receive a command and block of data.

Parameters
objQSPI object
commandQSPI command
dataRX buffer
[in,out]lengthin - RX buffer length in bytes, out - number of bytes read
Returns
QSPI_STATUS_OK if data has been succesfully received QSPI_STATUS_INVALID_PARAMETER if invalid parameter found QSPI_STATUS_ERROR otherwise
qspi_status_t qspi_write ( qspi_t obj,
const qspi_command_t command,
const void *  data,
size_t *  length 
)

Send a command and block of data.

Parameters
objQSPI object
commandQSPI command
dataTX buffer
[in,out]lengthin - TX buffer length in bytes, out - number of bytes written
Returns
QSPI_STATUS_OK if the data has been succesfully sent QSPI_STATUS_INVALID_PARAMETER if invalid parameter found QSPI_STATUS_ERROR otherwise
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.