SGDK
A free and open development kit for the Sega Mega Drive
Loading...
Searching...
No Matches
comm.h
1/************************************************************************
2 * \brief COMM driver Interface.
3 *
4 * \author Juan Antonio Ruiz (PaCHoN)
5 * \date 2024-2025
6 * \defgroup COMM COMM
7 * \brief
8 * Interface for COMM communication over Everdrive and EverdrivePro.
9*************************************** */
10#ifndef _COMM_H_
11#define _COMM_H_
12
13#include "types.h"
14/**************************************** */
15
16typedef struct CommDriver {
17 void (*init)(void);
18 bool (*is_present)(void);
19 u8 (*read_ready)(void);
20 u8 (*read)(void);
21 u8 (*write_ready)(void);
22 void (*write)(u8 data);
23
24 u16 buff_length;
25 u16 fifo_length;
26 char* mode;
28
33u16 comm_get_buffer_length(void);
34
39u16 comm_get_tx_fifo_length(void);
40
46void comm_init(void);
47
52void comm_write(u8 data);
53
58bool comm_read_ready(void);
59
64bool comm_write_ready(void);
65
71u8 comm_read(void);
72
77const CommDriver* comm_get_driver(void);
78
83size_t comm_get_drivers(const CommDriver** drivers);
84
89void comm_set_driver(const CommDriver* driver);
90
91
92#endif /*_COMM_H_*/
93
Definition comm.h:16
Types definition.
u8 bool
Definition types.h:121
unsigned short u16
Definition types.h:100
unsigned char u8
Definition types.h:95