C Microkernel Realtime eXecutive
Realtime Operating System for Cortex-M based microcontrollers
Loading...
Searching...
No Matches
emulator.h
1
#pragma once
2
3
#include <stdint.h>
4
30
void
generate_interrupt(
unsigned
irq_no);
31
32
typedef
struct
{
33
void (*emu_write_cb)(
volatile
void
* addr);
34
void (*emu_read_cb)(
const
volatile
void
* addr);
35
}
CMRX_Peripheral_Emulator_t
;
36
63
#define CMRX_PERIPHERAL_EMULATOR(peripheral_type, name, read_cb, write_cb) \
64
_Static_assert(sizeof(Full_ ## peripheral_type) == sizeof(peripheral_type), "Type describing peripheral and type that gives full access to it must both have the same size!");\
65
typedef struct __attribute__((packed)) {\
66
CMRX_Peripheral_Emulator_t emu;\
67
union {\
68
peripheral_type device;\
69
Full_ ## peripheral_type device_full;\
70
};\
71
} Emu_ ## peripheral_type;\
72
\
73
Emu_ ## peripheral_type name = {\
74
.emu = { .emu_write_cb = write_cb, .emu_read_cb = read_cb }\
75
}
CMRX_Peripheral_Emulator_t
Definition
emulator.h:32
include
extra
emulator.h
Generated by
1.9.8