SPI_master_read_byte

Description

Read a byte from the SPI bus as the bus master.

NOTE: the SPI bus must have been previously aquired by this processor and the processor must be the bus master for this operation to succead.

Definition

uint SPI_master_read_byte(ubyte send_ack)

Library

LIB/spi_bb_lib.bas

Usage

On entry:
send_ack indicates if the SPI ACK bit should be sent or not during the ACK stage of the byte read

The SPI ACK bit is usually sent during multi byte reads and not sent for single byte reads or if reading the last byte in a multibyte read

On exit:
return the byte read from the SPI bus or an error code. If the value returned is less 256 then the value is valid data otherwise it is an error code.