SPIMOVE

Top  Previous  Next

Action

Sends and receives a value or a variable to the SPI-bus.

 

 

Syntax

var = SPIMOVE( byte [,count] )

 

 

Syntax SPI1

var = SPI1MOVE( byte [,count] )

 

 

Remarks

Var

The variable that is assigned with the received byte(s) from the SPI-bus.

Byte

The variable or constant whose content must be send to the SPI-bus.

Count

Optional byte value which specifies how many bytes need to be moved.

 

 

See also

SPIIN , SPIINIT , CONFIG SPI , SPI1

 

 

Example

Config Spi = Soft , Din = Pinb.0 , Dout = Portb.1 , Ss = Portb.2 , Clock = Portb.3

 

Spiinit

 

Dim a(10) as Byte , X As Byte

 

Spiout A(1) , 5                                             'send 5 bytes

Spiout X , 1                                               'send 1 byte

A(1) = Spimove(5)                                         ' move 5 to SPI and store result in a(1)

A(1) = Spimove(a(2),4)                                     ' move 4 bytes from a(2) to a(1)

End