4 Replies Latest reply on Aug 16, 2015 4:40 AM by Sriranjan

    Inside SPI.cpp no effect on setting Pin HIGH

    Sriranjan

      Hello,

       

      I want to change a pin state from within the SPI.cpp file but there is no effect. Even the default SSpin state which is defined the library does not change state. Some one try this and let me know.I added the following 3 lines of code to SPI.cpp

       

      void SPIClass::begin()

      {

          /* Set the pin mux, for the SCK, MOSI and MISO pins ONLY

           *

           * Leave the SS pin in GPIO mode (the application will control it)

           * but set it's direction to output and initially high

           */

          system("echo on > /sys/devices/pci0000:00/0000:00:07.1/power/control"); //disables SPI power management

         

         //my 3 lines or code

          system("echo 42 > /sys/class/gpio/export");

          pinMode(12,OUTPUT);

          digitalWrite(12,HIGH);

       

          pinMode(SPI_SS_GPIO_PIN, OUTPUT);

          digitalWrite(SPI_SS_GPIO_PIN, HIGH);

          muxSelectSpi(1);

         

          if(fd <= 0)