43 #include "dev/ctsrts-sensor.h"
45 #include "dev/hwconf.h"
48 const struct sensors_sensor ctsrts_sensor;
50 HWCONF_PIN(RS232RTS, 1, 7);
52 #define RS232CTS_IRQ() 6
53 HWCONF_PIN(RS232CTS, 1, RS232CTS_IRQ());
54 HWCONF_IRQ(RS232CTS, 1, RS232CTS_IRQ());
62 RS232CTS_IRQ_EDGE_SELECTD();
64 RS232CTS_IRQ_EDGE_SELECTU();
66 sensors_changed(&ctsrts_sensor);
80 return RS232CTS_READ() ? 0 : 1;
84 configure(
int type,
int value)
89 RS232RTS_MAKE_OUTPUT();
92 RS232CTS_MAKE_INPUT();
96 if(!RS232CTS_IRQ_ENABLED()) {
102 if(RS232CTS_READ()) {
103 RS232CTS_IRQ_EDGE_SELECTD();
105 RS232CTS_IRQ_EDGE_SELECTU();
108 irq_port1_activate(RS232CTS_IRQ(), irq);
109 RS232CTS_ENABLE_IRQ();
112 RS232CTS_DISABLE_IRQ();
113 irq_port1_deactivate(RS232CTS_IRQ());
126 return RS232CTS_IRQ_ENABLED();
135 void ctsrts_rts_clear(
void) {
142 void ctsrts_rts_set(
void) {
146 SENSORS_SENSOR(ctsrts_sensor, CTSRTS_SENSOR,
147 value, configure, status);