public BP_RESPONSE ModeSPI(BP_SPI_SPEED speed, BP_SPI_CLOCK_POLARITY polarity, BP_SPI_CLOCK_EDGE edge, BP_SPI_INPUT_PHASE phase, BP_CS_POLARITY cs, BP_OUTPUT output) { m_mode = BP_MODE.SPI; BP_RESPONSE response = BP_RESPONSE.Disconnect; if (IsConnected && (response = SendWait("m5")) == BP_RESPONSE.OK && (response = SendWait((int)speed)) == BP_RESPONSE.OK && (response = SendWait((int)polarity)) == BP_RESPONSE.OK && (response = SendWait((int)edge)) == BP_RESPONSE.OK && (response = SendWait((int)phase)) == BP_RESPONSE.OK && (response = SendWait((int)cs)) == BP_RESPONSE.OK ) response = SendWait((int)output); return response; }