Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 99be98c

Browse files
QSPI driver: API parameters fix
1 parent 3057c6c commit 99be98c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

drivers/QSPI.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ qspi_status_t QSPI::set_frequency(int hz)
9191
return ret_status;
9292
}
9393

94-
qspi_status_t QSPI::read(unsigned int address, char *rx_buffer, size_t *rx_length)
94+
qspi_status_t QSPI::read(int address, char *rx_buffer, size_t *rx_length)
9595
{
9696
qspi_status_t ret_status = QSPI_STATUS_ERROR;
9797

@@ -115,7 +115,7 @@ qspi_status_t QSPI::read(unsigned int address, char *rx_buffer, size_t *rx_lengt
115115
return ret_status;
116116
}
117117

118-
qspi_status_t QSPI::write(unsigned int address, const char *tx_buffer, size_t *tx_length)
118+
qspi_status_t QSPI::write(int address, const char *tx_buffer, size_t *tx_length)
119119
{
120120
qspi_status_t ret_status = QSPI_STATUS_ERROR;
121121

@@ -139,7 +139,7 @@ qspi_status_t QSPI::write(unsigned int address, const char *tx_buffer, size_t *t
139139
return ret_status;
140140
}
141141

142-
qspi_status_t QSPI::read(unsigned int instruction, unsigned int alt, unsigned int address, char *rx_buffer, size_t *rx_length)
142+
qspi_status_t QSPI::read(int instruction, int alt, int address, char *rx_buffer, size_t *rx_length)
143143
{
144144
qspi_status_t ret_status = QSPI_STATUS_ERROR;
145145

@@ -163,7 +163,7 @@ qspi_status_t QSPI::read(unsigned int instruction, unsigned int alt, unsigned in
163163
return ret_status;
164164
}
165165

166-
qspi_status_t QSPI::write(unsigned int instruction, unsigned int alt, unsigned int address, const char *tx_buffer, size_t *tx_length)
166+
qspi_status_t QSPI::write(int instruction, int alt, int address, const char *tx_buffer, size_t *tx_length)
167167
{
168168
qspi_status_t ret_status = QSPI_STATUS_ERROR;
169169

@@ -187,7 +187,7 @@ qspi_status_t QSPI::write(unsigned int instruction, unsigned int alt, unsigned i
187187
return ret_status;
188188
}
189189

190-
qspi_status_t QSPI::command_transfer(unsigned int instruction, int address, const char *tx_buffer, size_t tx_length, const char *rx_buffer, size_t rx_length)
190+
qspi_status_t QSPI::command_transfer(int instruction, int address, const char *tx_buffer, size_t tx_length, const char *rx_buffer, size_t rx_length)
191191
{
192192
qspi_status_t ret_status = QSPI_STATUS_ERROR;
193193

drivers/QSPI.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class QSPI : private NonCopyable<QSPI> {
118118
* @returns
119119
* Returns QSPI_STATUS_SUCCESS on successful reads and QSPI_STATUS_ERROR on failed reads.
120120
*/
121-
qspi_status_t read(unsigned int address, char *rx_buffer, size_t *rx_length);
121+
qspi_status_t read(int address, char *rx_buffer, size_t *rx_length);
122122

123123
/** Write to QSPI peripheral using custom write instruction
124124
*
@@ -129,38 +129,38 @@ class QSPI : private NonCopyable<QSPI> {
129129
* @returns
130130
* Returns QSPI_STATUS_SUCCESS on successful reads and QSPI_STATUS_ERROR on failed reads.
131131
*/
132-
qspi_status_t write(unsigned int address, const char *tx_buffer, size_t *tx_length);
132+
qspi_status_t write(int address, const char *tx_buffer, size_t *tx_length);
133133

134134
/** Read from QSPI peripheral using custom read instruction, alt values
135135
*
136136
* @param instruction Instruction value to be used in instruction phase
137-
* @param alt Alt value to be used in instruction phase
137+
* @param alt Alt value to be used in Alternate-byte phase. Use -1 for ignoring Alternate-byte phase
138138
* @param address Address to be accessed in QSPI peripheral
139139
* @param rx_buffer Buffer for data to be read from the peripheral
140140
* @param rx_length Pointer to a variable containing the length of rx_buffer, and on return this variable will be updated with the actual number of bytes read
141141
*
142142
* @returns
143143
* Returns QSPI_STATUS_SUCCESS on successful reads and QSPI_STATUS_ERROR on failed reads.
144144
*/
145-
qspi_status_t read(unsigned int instruction, unsigned int alt, unsigned int address, char *rx_buffer, size_t *rx_length);
145+
qspi_status_t read(int instruction, int alt, int address, char *rx_buffer, size_t *rx_length);
146146

147147
/** Write to QSPI peripheral using custom write instruction, alt values
148148
*
149149
* @param instruction Instruction value to be used in instruction phase
150-
* @param alt Alt value to be used in instruction phase
150+
* @param alt Alt value to be used in Alternate-byte phase. Use -1 for ignoring Alternate-byte phase
151151
* @param address Address to be accessed in QSPI peripheral
152152
* @param tx_buffer Buffer containing data to be sent to peripheral
153153
* @param tx_length Pointer to a variable containing the length of data to be transmitted, and on return this variable will be updated with the actual number of bytes written
154154
*
155155
* @returns
156156
* Returns QSPI_STATUS_SUCCESS on successful reads and QSPI_STATUS_ERROR on failed reads.
157157
*/
158-
qspi_status_t write(unsigned int instruction, unsigned int alt, unsigned int address, const char *tx_buffer, size_t *tx_length);
158+
qspi_status_t write(int instruction, int alt, int address, const char *tx_buffer, size_t *tx_length);
159159

160160
/** Perform a transaction to write to an address(a control register) and get the status results
161161
*
162162
* @param instruction Instruction value to be used in instruction phase
163-
* @param address Some instruction might require address. Use -1 for ignoring the address value
163+
* @param address Some instruction might require address. Use -1 if no address
164164
* @param tx_buffer Buffer containing data to be sent to peripheral
165165
* @param tx_length Pointer to a variable containing the length of data to be transmitted, and on return this variable will be updated with the actual number of bytes written
166166
* @param rx_buffer Buffer for data to be read from the peripheral
@@ -169,7 +169,7 @@ class QSPI : private NonCopyable<QSPI> {
169169
* @returns
170170
* Returns QSPI_STATUS_SUCCESS on successful reads and QSPI_STATUS_ERROR on failed reads.
171171
*/
172-
qspi_status_t command_transfer(unsigned int instruction, int address, const char *tx_buffer, size_t tx_length, const char *rx_buffer, size_t rx_length);
172+
qspi_status_t command_transfer(int instruction, int address, const char *tx_buffer, size_t tx_length, const char *rx_buffer, size_t rx_length);
173173

174174
protected:
175175
/** Acquire exclusive access to this SPI bus

0 commit comments

Comments
 (0)