You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
I used a GPIO as CS pin. val pinCS = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_29, "CS")
I am using the MCP23S17GpioProvider class but this class always needs an SpiChannel. I am setting it to SpiChannel.CS0 just to avoid any exceptions. val provider = MCP23S17GpioProvider(MCP23S17GpioProvider.ADDRESS_0, SpiChannel.CS0)
I successfully done it by setting to low the CS pin before the job and after the job is done to set it to high. // select the device pinCS.low()
do the job you have to do
// deselect the device pinCS.high()
This is not the right way to do it, because I use (for Exception reasons) the CS0 to the MCP23S17GpioProvider contructor. Is there any better way to do it?
Would be a good idea to add another value (SpiChannel.CS) with -1 value just to let the user do whatever he wants?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am trying to have more than 2 devices in SPI0.
I used a GPIO as CS pin.
val pinCS = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_29, "CS")
I am using the MCP23S17GpioProvider class but this class always needs an SpiChannel. I am setting it to SpiChannel.CS0 just to avoid any exceptions.
val provider = MCP23S17GpioProvider(MCP23S17GpioProvider.ADDRESS_0, SpiChannel.CS0)
I successfully done it by setting to low the CS pin before the job and after the job is done to set it to high.
// select the device
pinCS.low()
do the job you have to do
// deselect the device
pinCS.high()
This is not the right way to do it, because I use (for Exception reasons) the CS0 to the MCP23S17GpioProvider contructor. Is there any better way to do it?
Would be a good idea to add another value (SpiChannel.CS) with -1 value just to let the user do whatever he wants?
The text was updated successfully, but these errors were encountered: