mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Embed: (wiki syntax)

« Back to documentation index

QSPI HAL

Data Structures

struct  qspi_command
 QSPI command. More...

Typedefs

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

Enumerations

enum  qspi_bus_width
 

QSPI Bus width.

More...
enum  qspi_address_size
 

Address size in bits.

More...
enum  qspi_alt_size
 

Alternative size in bits.

More...
enum  qspi_status {
  QSPI_STATUS_ERROR = -1, QSPI_STATUS_INVALID_PARAMETER = -2, QSPI_STATUS_OK = 0, QSPI_STATUS_ERROR = -1,
  QSPI_STATUS_INVALID_PARAMETER = -2, QSPI_STATUS_OK = 0
}
 

QSPI return status.

More...
enum  qspi_bus_width
 

QSPI Bus width.

More...
enum  qspi_address_size
 

Address size in bits.

More...
enum  qspi_alt_size
 

Alternative size in bits.

More...
enum  qspi_status {
  QSPI_STATUS_ERROR = -1, QSPI_STATUS_INVALID_PARAMETER = -2, QSPI_STATUS_OK = 0, QSPI_STATUS_ERROR = -1,
  QSPI_STATUS_INVALID_PARAMETER = -2, QSPI_STATUS_OK = 0
}
 

QSPI return status.

More...

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.
qspi_status_t qspi_free (qspi_t *obj)
 Deinitilize QSPI peripheral.
qspi_status_t qspi_frequency (qspi_t *obj, int hz)
 Set the QSPI baud rate.
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.
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.
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.

Typedef Documentation

Address size in bits.

Address size in bits.

Alternative size in bits.

Alternative size in bits.

QSPI Bus width.

Some parts of commands provide variable bus width

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 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 enum qspi_status qspi_status_t

QSPI return status.

typedef struct qspi_s qspi_t

QSPI HAL object.

Definition at line 39 of file cmsis/BUILD/mbed/hal/qspi_api.h.

typedef struct qspi_s qspi_t

QSPI HAL object.

Definition at line 39 of file hal/qspi_api.h.


Enumeration Type Documentation

Address size in bits.

Definition at line 53 of file cmsis/BUILD/mbed/hal/qspi_api.h.

Address size in bits.

Definition at line 53 of file hal/qspi_api.h.

Alternative size in bits.

Definition at line 62 of file hal/qspi_api.h.

Alternative size in bits.

Definition at line 62 of file cmsis/BUILD/mbed/hal/qspi_api.h.

QSPI Bus width.

Some parts of commands provide variable bus width

Definition at line 45 of file hal/qspi_api.h.

QSPI Bus width.

Some parts of commands provide variable bus width

Definition at line 45 of file cmsis/BUILD/mbed/hal/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 >

QSPI_STATUS_ERROR 

Generic error >

QSPI_STATUS_INVALID_PARAMETER 

The parameter is invalid >

QSPI_STATUS_OK 

Function executed sucessfully >

Definition at line 99 of file hal/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 >

QSPI_STATUS_ERROR 

Generic error >

QSPI_STATUS_INVALID_PARAMETER 

The parameter is invalid >

QSPI_STATUS_OK 

Function executed sucessfully >

Definition at line 99 of file cmsis/BUILD/mbed/hal/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_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