Struct and Enum Question
Posted: Wed Dec 19, 2007 7:38 am
Hi guys, I am creating structures to hold the Floppy Disk Controller information from the HW Ports.
I am wondering; s it possible to crete an enumeration of values (2Bits) within a structure.
Example:
I am wondering; s it possible to crete an enumeration of values (2Bits) within a structure.
Example:
Code: Select all
typedef struct {
unsigned selected_unit:2;
unsigned selected head:1;
unsigned rw_not_ready:1;
unsigned equipment_check:1;
unsigned seek_complete:1;
enum {
command_successfull=0;
terminated_abnormally=1;
invalid_command=2;
terminated_ready_change=3;
} last_command_status:2;
} PACKED Command_Status_Register; // 0x3f5 (Read Only)