Question: what is cpol and cpha in spi?
Answer: SPI interface allows to transmit and receive data simultaneously on two lines (MOSI and MISO). Clock polarity (CPOL) and clock phase (CPHA) are the main parameters that define a clock format to be used by the SPI bus. ... CPHA parameter is used to shift the sampling phase.