X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-lib.git/blobdiff_plain/0e38262df2b506d9168643ac5a2b76c9cc6d5825..0e8d41c1cb0461e2bd9f4c1c895d0d600930faae:/rpp/src/drv/_tms570_hydctr/port_def.c diff --git a/rpp/src/drv/_tms570_hydctr/port_def.c b/rpp/src/drv/_tms570_hydctr/port_def.c index a5e8012..b268683 100644 --- a/rpp/src/drv/_tms570_hydctr/port_def.c +++ b/rpp/src/drv/_tms570_hydctr/port_def.c @@ -14,28 +14,30 @@ #include "drv/port.h" #include "drv/gio_names.h" #include "drv/gio_tab.h" +#include "drv/spi.h" +#include "drv/spi_tms570.h" #include "drv/adc.h" // Lists of pins assigned to the ports static enum pin_name pins_gioa[] = { - PIN_GIOA0, PIN_GIOA1, PIN_GIOA2, PIN_GIOA3, - PIN_GIOA4, PIN_GIOA5, PIN_GIOA6, PIN_GIOA7 + PIN_GIOA0, PIN_GIOA1, PIN_GIOA2, PIN_GIOA3, + PIN_GIOA4 }; static enum pin_name pins_giob[] = { - PIN_GIOB0, PIN_GIOB1, PIN_GIOB2, PIN_GIOB3, - PIN_GIOB4, PIN_GIOB5, PIN_GIOB6, PIN_GIOB7 + PIN_GIOB0, PIN_GIOB1, PIN_GIOB2, PIN_GIOB3, + PIN_GIOB4, PIN_GIOB5, PIN_GIOB6 }; static enum pin_name pins_nhet1[] = { - PIN_NHET10, PIN_NHET11, PIN_NHET12, - PIN_NHET13, PIN_NHET14, PIN_NHET15, - PIN_NHET17, PIN_NHET18, PIN_NHET19, - PIN_NHET110, PIN_NHET111, PIN_NHET112, - PIN_NHET114, PIN_NHET115, PIN_NHET116, - PIN_NHET117, PIN_NHET118, PIN_NHET119, - PIN_NHET120, PIN_NHET121, PIN_NHET122, - PIN_NHET123, PIN_NHET124, PIN_NHET125, - PIN_NHET126, PIN_NHET127, PIN_NHET128, - PIN_NHET129, PIN_NHET130, PIN_NHET131 + PIN_NHET11, + PIN_NHET13, + PIN_NHET18, + PIN_NHET112, + PIN_NHET114, PIN_NHET116, + PIN_NHET117, PIN_NHET119, + PIN_NHET122, + PIN_NHET123, PIN_NHET124, PIN_NHET125, + PIN_NHET126, PIN_NHET127, PIN_NHET128, + PIN_NHET129, PIN_NHET130, PIN_NHET131 }; // Port descriptors @@ -66,10 +68,58 @@ const struct port_desc port_desc[] = { }, [PORT_ID_ADC] = { .name = "ADC", - .cfg = { .adc = { .reg = adcREG1, .group = adcGROUP1, .sem = 1 } }, - .numchn = 16, + .cfg = { .adc = { .reg = adcREG1, .group = adcGROUP1 } }, + .numchn = PORT_ADC_CHANNELS, .bpch = 16, .get = port_adc_get, .set = NULL, }, + [PORT_ID_THERMISTOR1] = { + .name = "THERM1", + .numchn = 1, + .bpch = 16, + .get = NULL, + .set = port_spi_set, + .cfg = { .spi = { .dev = SPIDEV_MCP6S93_TH1, .chip = "MCP6S93" }, }, + }, + [PORT_ID_THERMISTOR2] = { + .name = "THERM2", + .numchn = 1, + .bpch = 16, + .get = NULL, + .set = port_spi_set, + .cfg = { .spi = { .dev = SPIDEV_MCP6S93_TH2, .chip = "MCP6S93" }, }, + }, + [PORT_ID_ADC_COND] = { + .name = "ADCCND", + .numchn = 6, + .bpch = 16, /* 6 ICs in daisy chain */ + .get = NULL, + .set = port_spi_set, + .cfg = { .spi = { .dev = SPIDEV_MCP6S93_6ADC, .chip = "MCP6S93" }, }, + }, + [PORT_ID_POWER_SUPPLY] = { + .name = "PWR", + .numchn = 1, + .bpch = 16, + .get = NULL, + .set = port_spi_set, + .cfg = { .spi = { .dev = SPIDEV_TPS65381_PWR, .chip = "TPS65381" }, }, + }, + [PORT_ID_SENSOR_SUPPLY] = { + .name = "SENSUP", + .numchn = 1, + .bpch = 16, + .get = NULL, + .set = port_spi_set, + .cfg = { .spi = { .dev = SPIDEV_MCP6S93_SENSUP, .chip = "MCP6S93" }, }, + }, + [PORT_ID_DAC_ADC_LOOPBACK] = { + .name = "DACLBK", + .numchn = 1, + .bpch = 16, + .get = NULL, + .set = port_spi_set, + .cfg = { .spi = { .dev = SPIDEV_MCP6S93_DAC, .chip = "MCP6S93" }, }, + }, };