mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:13:34 +08:00
Improve SPI bus implementation
Make possible to define chip-select pin for internal SPI. By defining chip-select pin, it's possible to start specific SPI device only. This allows to have several same type of sensors on the same bus with different orientation.
This commit is contained in:
committed by
Beat Küng
parent
35d4986ea7
commit
02336acd61
@@ -187,7 +187,7 @@ int BusCLIArguments::getOpt(int argc, char *argv[], const char *options)
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
chipselect_index = atoi(_optarg);
|
||||
chipselect = atoi(_optarg);
|
||||
break;
|
||||
#endif // CONFIG_SPI
|
||||
|
||||
@@ -286,7 +286,7 @@ BusInstanceIterator::BusInstanceIterator(const char *module_name,
|
||||
#endif // CONFIG_I2C
|
||||
#if defined(CONFIG_SPI)
|
||||
_spi_bus_iterator(spiFilter(cli_arguments.bus_option),
|
||||
cli_arguments.bus_option == I2CSPIBusOption::SPIExternal ? cli_arguments.chipselect_index : devid_driver_index,
|
||||
devid_driver_index, cli_arguments.chipselect,
|
||||
cli_arguments.requested_bus),
|
||||
#endif // CONFIG_SPI
|
||||
#if defined(CONFIG_I2C)
|
||||
|
||||
Reference in New Issue
Block a user