aboutsummaryrefslogtreecommitdiff
path: root/examples/io/pads/spi.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/io/pads/spi.h')
-rw-r--r--examples/io/pads/spi.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/io/pads/spi.h b/examples/io/pads/spi.h
index c50e065..7d4d75b 100644
--- a/examples/io/pads/spi.h
+++ b/examples/io/pads/spi.h
@@ -9,8 +9,9 @@
#include <stdint.h>
#include <psxpad.h>
-// Maximum request/response length (34 bytes for pads, 140 for memory cards)
-//#define SPI_BUFF_LEN 34
+// Maximum request/response length (34 bytes for pads, 140 for memory cards).
+// Must be a multiple of 4 to avoid memory alignment issues.
+//#define SPI_BUFF_LEN 36
#define SPI_BUFF_LEN 140
/* Request structures */
@@ -30,6 +31,10 @@ typedef struct _SPI_Request {
/* Public API */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @brief Allocates a new request object and adds it to the request queue. The
* object must be populated afterwards by setting the length, callback and
@@ -49,7 +54,7 @@ void SPI_SetPollRate(uint32_t value);
/**
* @brief Installs the SPI and timer 2 interrupt handlers and starts the poll
* timer. By default the polling rate is set to 250 Hz (125 Hz per port),
- * however it can be changed at any time by calling spi_set_poll_rate().
+ * however it can be changed at any time by calling SPI_SetPollRate().
*
* The provided callback (if any) is called to report the result of poll
* requests, which are issued automatically when no other request is in the
@@ -59,4 +64,8 @@ void SPI_SetPollRate(uint32_t value);
*/
void SPI_Init(SPI_Callback callback);
+#ifdef __cplusplus
+}
+#endif
+
#endif