1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-09-25 16:55:10 +00:00
rk65c02/src/device.h

25 lines
414 B
C
Raw Normal View History

#ifndef _DEVICE_H_
#define _DEVICE_H_
2017-02-20 11:31:26 +00:00
typedef struct device_t {
const char *name;
uint16_t size;
2017-02-20 11:31:26 +00:00
uint8_t (*read_1)(void *, uint16_t doff);
void (*write_1)(void *, uint16_t, uint8_t val);
2017-02-20 11:31:26 +00:00
void *config;
void *aux; /* any dev space-specific data */
} device_t;
2017-02-20 11:31:26 +00:00
typedef struct device_mapping_t {
device_t *dev;
uint16_t addr;
2017-02-20 11:31:26 +00:00
struct device_mapping_t *next;
} device_mapping_t;
#endif /* _DEVICE_H_ */