Refactor parallel comms a bit

This commit is contained in:
2025-10-01 23:24:59 +02:00
parent 3df5b28e4e
commit 2ba1546dec
8 changed files with 116 additions and 87 deletions

View File

@@ -2,18 +2,24 @@
#include <stdint.h>
typedef void (*miso_cb_t)(const uint8_t* buff, uint8_t size);
/** Must call first **/
void paracomm_init(miso_cb_t miso_cb);
void paracomm_init();
/** Sends a single byte.
* Returns: 0 if no error, non-0 otherwise.
*/
int paracomm_send(uint8_t b);
/** Receive some bytes.
* Returns: number of bytes copied
*/
uint8_t paracomm_recv(uint8_t* buf, uint8_t size);
/** Call after reading a nibble from the port */
void paracomm_feed(uint8_t n);
/** Yields the next byte to send out the port */
uint8_t paracomm_nextbyte();
/** Returns non-zero if busy */
uint8_t paracomm_busy();