From a21c24fa2486e4d4a3b25d0dcbf873ae62fdbcec Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Tue, 23 Sep 2014 10:35:11 -0500 Subject: mts-io: clean up accessory card support use custom kernel config option MTS_NUM_ACCESSORY_PORTS to find out how many slots exist (mostly) dynamically handle any number of accessory cards streamline code to make it easier to add accessory cards in the future --- io-module/mts_io.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'io-module/mts_io.h') diff --git a/io-module/mts_io.h b/io-module/mts_io.h index b91423e..ac39463 100644 --- a/io-module/mts_io.h +++ b/io-module/mts_io.h @@ -102,5 +102,25 @@ enum { LED_FLASHING, }; +enum ap { + port_1 = 1, + port_2, +}; + +enum spi_devices { + din = 0, + dout = 1, + adc = 2, +}; + +// info for accessory port +// contains function pointers for setup and teardown and useful info +// each type of accessory card should have one of these +struct ap_info { + uint8_t product_id; + bool (*setup)(enum ap port); + bool (*teardown)(enum ap port); +}; + #endif /* ~__MTS_IO_H */ -- cgit v1.2.3