kopia lustrzana https://github.com/felHR85/UsbSerial
Added SPI interface
rodzic
5c16f67c6d
commit
7cd6434ad1
|
@ -0,0 +1,31 @@
|
||||||
|
package com.felhr.usbserial;
|
||||||
|
|
||||||
|
|
||||||
|
public interface UsbSpiInterface
|
||||||
|
{
|
||||||
|
// Clock dividers;
|
||||||
|
int DIVIDER_2 = 2;
|
||||||
|
int DIVIDER_4 = 4;
|
||||||
|
int DIVIDER_8 = 8;
|
||||||
|
int DIVIDER_16 = 16;
|
||||||
|
int DIVIDER_32 = 32;
|
||||||
|
int DIVIDER_64 = 64;
|
||||||
|
int DIVIDER_128 = 128;
|
||||||
|
|
||||||
|
// Common SPI operations
|
||||||
|
void connectSPI();
|
||||||
|
void writeMOSI(byte[] buffer);
|
||||||
|
void readMISO(int lengthBuffer);
|
||||||
|
void setClock(int clockDivider);
|
||||||
|
void selectSlave(int nSlave);
|
||||||
|
void setMISOCallback(UsbMISOCallback misoCallback);
|
||||||
|
|
||||||
|
// Status information
|
||||||
|
int getClockDivider();
|
||||||
|
int getSelectedSlave();
|
||||||
|
|
||||||
|
interface UsbMISOCallback
|
||||||
|
{
|
||||||
|
int onReceivedData(byte[] data);
|
||||||
|
}
|
||||||
|
}
|
Ładowanie…
Reference in New Issue