You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/mbed/api/SPI.h
+19-46Lines changed: 19 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -115,48 +115,21 @@ class SPI {
115
115
*
116
116
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
117
117
* the default SPI value is sent
118
-
* @param tx_length The length of TX buffer
118
+
* @param tx_length The length of TX buffer in bytes
119
119
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
120
120
* received data are ignored
121
-
* @param rx_length The length of RX buffer
121
+
* @param rx_length The length of RX buffer in bytes
122
122
* @param callback The event callback function
123
-
* @param event The logical OR of events to modify
124
-
* @return Zero if the transfer has started, or -1 if SPI peripheral is busy
125
-
*/
126
-
virtualinttransfer(uint8_t *tx_buffer, int tx_length, uint8_t *rx_buffer, int rx_length, constevent_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
/** Start non-blocking SPI transfer using 16bit buffers.
131
-
*
132
-
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
133
-
* the default SPI value is sent
134
-
* @param tx_length The length of TX buffer
135
-
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
136
-
* received data are ignored
137
-
* @param rx_length The length of RX buffer
138
-
* @param callback The event callback function
139
-
* @param event The logical OR of events to modify
140
-
* @return Zero if the transfer has started, or -1 if SPI peripheral is busy
141
-
*/
142
-
virtualinttransfer(uint16_t *tx_buffer, int tx_length, uint16_t *rx_buffer, int rx_length, constevent_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
/** Start non-blocking SPI transfer using 32bit buffers.
147
-
*
148
-
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
149
-
* the default SPI value is sent
150
-
* @param tx_length The length of TX buffer
151
-
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
152
-
* received data are ignored
153
-
* @param rx_length The length of RX buffer
154
-
* @param callback The event callback function
155
-
* @param event The logical OR of events to modify
123
+
* @param event The logical OR of events to modify. Look at spi hal header file for SPI events.
156
124
* @return Zero if the transfer has started, or -1 if SPI peripheral is busy
157
125
*/
158
-
virtualinttransfer(uint32_t *tx_buffer, int tx_length, uint32_t *rx_buffer, int rx_length, constevent_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
/** Abort the on-going SPI transfer, and continue with transfer's in the queue if any.
@@ -188,45 +161,45 @@ class SPI {
188
161
*
189
162
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
190
163
* the default SPI value is sent
191
-
* @param tx_length The length of TX buffer
164
+
* @param tx_length The length of TX buffer in bytes
192
165
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
193
166
* received data are ignored
194
-
* @param rx_length The length of RX buffer
167
+
* @param rx_length The length of RX buffer in bytes
195
168
* @param bit_width The buffers element width
196
169
* @param callback The event callback function
197
170
* @param event The logical OR of events to modify
198
171
* @return Zero if the transfer has started or was added to the queue, or -1 if SPI peripheral is busy/buffer is full
199
172
*/
200
-
inttransfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsignedchar bit_width, constevent_callback_t& callback, int event);
173
+
inttransfer(constvoid *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsignedchar bit_width, constevent_callback_t& callback, int event);
201
174
202
175
/**
203
176
*
204
177
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
205
178
* the default SPI value is sent
206
-
* @param tx_length The length of TX buffer
179
+
* @param tx_length The length of TX buffer in bytes
207
180
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
208
181
* received data are ignored
209
-
* @param rx_length The length of RX buffer
182
+
* @param rx_length The length of RX buffer in bytes
210
183
* @param bit_width The buffers element width
211
184
* @param callback The event callback function
212
185
* @param event The logical OR of events to modify
213
186
* @return Zero if a transfer was added to the queue, or -1 if the queue is full
214
187
*/
215
-
intqueue_transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsignedchar bit_width, constevent_callback_t& callback, int event);
188
+
intqueue_transfer(constvoid *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsignedchar bit_width, constevent_callback_t& callback, int event);
216
189
217
190
/** Configures a callback, spi peripheral and initiate a new transfer
218
191
*
219
192
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
220
193
* the default SPI value is sent
221
-
* @param tx_length The length of TX buffer
194
+
* @param tx_length The length of TX buffer in bytes
222
195
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
223
196
* received data are ignored
224
-
* @param rx_length The length of RX buffer
197
+
* @param rx_length The length of RX buffer in bytes
225
198
* @param bit_width The buffers element width
226
199
* @param callback The event callback function
227
200
* @param event The logical OR of events to modify
228
201
*/
229
-
voidstart_transfer(void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsignedchar bit_width, constevent_callback_t& callback, int event);
202
+
voidstart_transfer(constvoid *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsignedchar bit_width, constevent_callback_t& callback, int event);
0 commit comments