SPI_class module

class SPI_class.SPI(H)[source]

Methods to interact with the SPI port. An instance of Packet_Handler must be passed to the init function

set_parameters(primary_prescaler=0, secondary_prescaler=2, CKE=1, CKP=0, SMP=1)[source]

sets SPI parameters.

Arguments  
primary_pres Primary Prescaler(0,1,2,3) for 64MHz clock->(64:1,16:1,4:1,1:1)
secondary_pres Secondary prescaler(0,1,..7)->(8:1,7:1,..1:1)
CKE CKE 0 or 1.
CKP CKP 0 or 1.
start(channel)[source]

selects SPI channel to enable. Basically lowers the relevant chip select pin .

Arguments  
channel 1-7 ->[PGA1 connected to CH1,PGA2,PGA3,PGA4,PGA5,external chip select 1,external chip select 2] 8 -> sine1 9 -> sine2
stop(channel)[source]

selects SPI channel to disable. Sets the relevant chip select pin to HIGH.

Arguments  
channel 1-7 ->[PGA1 connected to CH1,PGA2,PGA3,PGA4,PGA5,external chip select 1,external chip select 2]
send8(value)[source]

SENDS 8-bit data over SPI

Arguments  
value value to transmit
Returns:value returned by slave device
send16(value)[source]

SENDS 16-bit data over SPI

Arguments  
value value to transmit
Returns:value returned by slave device
Return type:int
send8_burst(value)[source]

SENDS 8-bit data over SPI No acknowledge/return value

Arguments  
value value to transmit
Returns:Nothing
send16_burst(value)[source]

SENDS 16-bit data over SPI no acknowledge/return value

Arguments  
value value to transmit
Returns:nothing

Previous topic

Python module for accessing the device

Next topic

I2C_class module

This Page