def chip_select(chip=CHIP_SELECT_0)
      chip = @chip if @chip
      PiPiper.driver.spi_chip_select(chip) 
      if block_given?
        begin
          yield
        ensure
          PiPiper.driver.spi_chip_select(CHIP_SELECT_NONE)
        end
      end
    end
def chip_select(chip=CHIP_SELECT_0)
      chip = @chip if @chip
      PiPiper.driver.spi_chip_select(chip) 
      if block_given?
        begin
          yield
        ensure
          PiPiper.driver.spi_chip_select(CHIP_SELECT_NONE)
        end
      end
    end
Activate a specific chip so that communication can begin

 When a block is provided, the chip is automatically deactivated after the block completes.
 When a block is not provided, the user is responsible for calling chip_select(CHIP_SELECT_NONE)

 @example With block (preferred)
   spi.chip_select do
     spi.write(0xFF)
   end

 @example Without block
   spi.chip_select(CHIP_SELECT_0)
   spi.write(0xFF)
   spi.write(0x22)
   spi.chip_select(CHIP_SELECT_NONE)

 @yield
 @param [optional, CHIP_SELECT_*] chip the chip select line options