@@ -70,16 +70,25 @@ typedef struct spi_inst spi_inst_t;
70
70
#define spi_default PICO_DEFAULT_SPI_INSTANCE
71
71
#endif
72
72
73
+ /** \brief Enumeration of SPI CPHA (clock phase) values.
74
+ * \ingroup hardware_spi
75
+ */
73
76
typedef enum {
74
77
SPI_CPHA_0 = 0 ,
75
78
SPI_CPHA_1 = 1
76
79
} spi_cpha_t ;
77
80
81
+ /** \brief Enumeration of SPI CPOL (clock polarity) values.
82
+ * \ingroup hardware_spi
83
+ */
78
84
typedef enum {
79
85
SPI_CPOL_0 = 0 ,
80
86
SPI_CPOL_1 = 1
81
87
} spi_cpol_t ;
82
88
89
+ /** \brief Enumeration of SPI bit-order values.
90
+ * \ingroup hardware_spi
91
+ */
83
92
typedef enum {
84
93
SPI_LSB_FIRST = 0 ,
85
94
SPI_MSB_FIRST = 1
@@ -123,7 +132,7 @@ void spi_deinit(spi_inst_t *spi);
123
132
*/
124
133
uint spi_set_baudrate (spi_inst_t * spi , uint baudrate );
125
134
126
- /*! \brief Convert I2c instance to hardware instance number
135
+ /*! \brief Convert SPI instance to hardware instance number
127
136
* \ingroup hardware_spi
128
137
*
129
138
* \param spi SPI instance
@@ -272,7 +281,7 @@ int spi_read_blocking(spi_inst_t *spi, uint8_t repeated_tx_data, uint8_t *dst, s
272
281
* \param src Buffer of data to write
273
282
* \param dst Buffer for read data
274
283
* \param len Length of BOTH buffers in halfwords
275
- * \return Number of bytes written/read
284
+ * \return Number of halfwords written/read
276
285
*/
277
286
int spi_write16_read16_blocking (spi_inst_t * spi , const uint16_t * src , uint16_t * dst , size_t len );
278
287
@@ -287,7 +296,7 @@ int spi_write16_read16_blocking(spi_inst_t *spi, const uint16_t *src, uint16_t *
287
296
* \param spi SPI instance specifier, either \ref spi0 or \ref spi1
288
297
* \param src Buffer of data to write
289
298
* \param len Length of buffers
290
- * \return Number of bytes written/read
299
+ * \return Number of halfwords written/read
291
300
*/
292
301
int spi_write16_blocking (spi_inst_t * spi , const uint16_t * src , size_t len );
293
302
@@ -305,8 +314,8 @@ int spi_write16_blocking(spi_inst_t *spi, const uint16_t *src, size_t len);
305
314
* \param spi SPI instance specifier, either \ref spi0 or \ref spi1
306
315
* \param repeated_tx_data Buffer of data to write
307
316
* \param dst Buffer for read data
308
- * \param len Length of buffer \p dst in halfwords
309
- * \return Number of bytes written/read
317
+ * \param len Length of buffer \p dst in halfwords
318
+ * \return Number of halfwords written/read
310
319
*/
311
320
int spi_read16_blocking (spi_inst_t * spi , uint16_t repeated_tx_data , uint16_t * dst , size_t len );
312
321
0 commit comments