aboutsummaryrefslogtreecommitdiff
path: root/examples/io/pads/spi.h
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2022-03-25 09:22:20 +0800
committerGitHub <noreply@github.com>2022-03-25 09:22:20 +0800
commit975e614b3c840e2f717adac1d1cb9cee4e5e561b (patch)
tree6584ce5b0dbe27a466c95c81fac61b0d90f627bd /examples/io/pads/spi.h
parent05d44488bd5587786f4bd0286fc0f555c79aa46a (diff)
parent45168ae43e29aa5930ee5a206475ae836078915f (diff)
downloadpsn00bsdk-975e614b3c840e2f717adac1d1cb9cee4e5e561b.tar.gz
Merge pull request #46 from spicyjpeg/psxmdec
Critical ldscript fixes, initial MDEC support and CI updates
Diffstat (limited to 'examples/io/pads/spi.h')
-rw-r--r--examples/io/pads/spi.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/io/pads/spi.h b/examples/io/pads/spi.h
index c50e065..8c17df3 100644
--- a/examples/io/pads/spi.h
+++ b/examples/io/pads/spi.h
@@ -7,10 +7,12 @@
#define __SPI_H
#include <stdint.h>
+#include <stddef.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 +32,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 +55,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 +65,8 @@ void SPI_SetPollRate(uint32_t value);
*/
void SPI_Init(SPI_Callback callback);
+#ifdef __cplusplus
+}
+#endif
+
#endif