SimAVR
AVR Simulator
|
Data Structures | |
struct | avr_ioport_getirq_t |
this ioctl takes a avr_regbit_t, compares the register address to PORT/PIN/DDR and return the corresponding IRQ(s) if it matches More... | |
struct | avr_ioport_state_t |
ioctl used to get a port state. More... | |
struct | avr_ioport_external_t |
ioctl used to set default port state when set as input. More... | |
struct | avr_iopin_t |
pin structure More... | |
struct | avr_ioport_t |
Definition for an IO port. More... | |
Macros | |
#define | AVR_IOPORT_OUTPUT 0x100 |
#define | AVR_IOCTL_IOPORT_GETIRQ(_name) AVR_IOCTL_DEF('i','o','g',(_name)) |
add port name (uppercase) to get the real IRQ More... | |
#define | AVR_IOCTL_IOPORT_GETIRQ_REGBIT AVR_IOCTL_DEF('i','o','g','r') |
#define | AVR_IOCTL_IOPORT_GETSTATE(_name) AVR_IOCTL_DEF('i','o','s',(_name)) |
add port name (uppercase) to get the port state More... | |
#define | AVR_IOCTL_IOPORT_SET_EXTERNAL(_name) AVR_IOCTL_DEF('i','o','p',(_name)) |
add port name (uppercase) to set default input pin IRQ values More... | |
#define | AVR_IOPIN(_port, _pin) { .port = _port, .pin = _pin } |
#define | AVR_IOPORT_DECLARE(_lname, _cname, _uname) |
Typedefs | |
typedef struct avr_ioport_getirq_t | avr_ioport_getirq_t |
this ioctl takes a avr_regbit_t, compares the register address to PORT/PIN/DDR and return the corresponding IRQ(s) if it matches More... | |
typedef struct avr_ioport_state_t | avr_ioport_state_t |
ioctl used to get a port state. More... | |
typedef struct avr_ioport_external_t | avr_ioport_external_t |
ioctl used to set default port state when set as input. More... | |
typedef struct avr_iopin_t | avr_iopin_t |
pin structure More... | |
typedef struct avr_ioport_t | avr_ioport_t |
Definition for an IO port. More... | |
Functions | |
void | avr_ioport_init (avr_t *avr, avr_ioport_t *port) |
#define AVR_IOCTL_IOPORT_GETIRQ | ( | _name | ) | AVR_IOCTL_DEF('i','o','g',(_name)) |
add port name (uppercase) to get the real IRQ
#define AVR_IOCTL_IOPORT_GETIRQ_REGBIT AVR_IOCTL_DEF('i','o','g','r') |
#define AVR_IOCTL_IOPORT_GETSTATE | ( | _name | ) | AVR_IOCTL_DEF('i','o','s',(_name)) |
add port name (uppercase) to get the port state
#define AVR_IOCTL_IOPORT_SET_EXTERNAL | ( | _name | ) | AVR_IOCTL_DEF('i','o','p',(_name)) |
add port name (uppercase) to set default input pin IRQ values
#define AVR_IOPIN | ( | _port, | |
_pin | |||
) | { .port = _port, .pin = _pin } |
#define AVR_IOPORT_DECLARE | ( | _lname, | |
_cname, | |||
_uname | |||
) |
#define AVR_IOPORT_OUTPUT 0x100 |
typedef struct avr_iopin_t avr_iopin_t |
pin structure
typedef struct avr_ioport_external_t avr_ioport_external_t |
ioctl used to set default port state when set as input.
typedef struct avr_ioport_getirq_t avr_ioport_getirq_t |
this ioctl takes a avr_regbit_t, compares the register address to PORT/PIN/DDR and return the corresponding IRQ(s) if it matches
typedef struct avr_ioport_state_t avr_ioport_state_t |
ioctl used to get a port state.
for (int i = 'A'; i <= 'F'; i++) { avr_ioport_state_t state; if (avr_ioctl(AVR_IOCTL_IOPORT_GETSTATE(i), &state) == 0) printf("PORT%c %02x DDR %02x PIN %02x\n", state.name, state.port, state.ddr, state.pin); }
typedef struct avr_ioport_t avr_ioport_t |
Definition for an IO port.
anonymous enum |
void avr_ioport_init | ( | avr_t * | avr, |
avr_ioport_t * | port | ||
) |