Enumerated Types

Enumerated Types

  • Similar to enumerated types in C

/* type definition */

typedef enum {IDLE, READY, BUSY} controller_state;

This declares that the type “controller_state” is

an enumerated type

/* type declaration for a register variable */

controller_state reg state;

This says that state is a register variable of type

“controller_state”

Previous slide Next slide Back to the first slide View Graphic Version

Contact 
©2002-2018 U.C. Regents