Methods to interact with the SPI port. An instance of Packet_Handler must be passed to the init function
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. |
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 |
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] |
SENDS 8-bit data over SPI
| Arguments | |
|---|---|
| value | value to transmit |
| Returns: | value returned by slave device |
|---|
SENDS 16-bit data over SPI
| Arguments | |
|---|---|
| value | value to transmit |
| Returns: | value returned by slave device |
|---|---|
| Return type: | int |