RB4xx serial port control

How difficult would it be to use the serial port on an RB4xx series board to detect the state of a switch(open or closed)?