Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import eu.vranckaert.driver.touch.TouchScreenDriverApplication;
import eu.vranckaert.driver.touch.profile.DriverProfile;
import eu.vranckaert.driver.touch.profile.KumanDriverProfile;
import eu.vranckaert.driver.touch.profile.WaveshareProfile;

/**
Expand All @@ -11,6 +12,6 @@
public class ThingsApplication extends TouchScreenDriverApplication {
@Override
public DriverProfile getDriverProfile() {
return WaveshareProfile.getInstance(WaveshareProfile.DIMENSION_800_480);
return KumanDriverProfile.getInstance(KumanDriverProfile.DIMENSION_1920_1080);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package eu.vranckaert.driver.touch.driver;

import eu.vranckaert.driver.touch.profile.SPIDriverProfile;

public class KumanDriver extends XPT2046Driver {

public KumanDriver(SPIDriverProfile driverProfile) {
super(driverProfile, true, true, true, true, true);
}

@Override
public boolean isPressing(byte[] buffer) {
return buffer[1] != 0;
}

@Override
public int getSpiChannel() {
return 1;
}

@Override
public int getVersion() {
return 1;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package eu.vranckaert.driver.touch.profile;

import eu.vranckaert.driver.touch.driver.Driver;
import eu.vranckaert.driver.touch.driver.KumanDriver;

public class KumanDriverProfile extends SPIDriverProfile {

public static final ScreenDimension DIMENSION_1920_1080 = new ScreenDimension(1920, 1080, ScreenDimension.Ratio.R_16_10);

private static KumanDriverProfile INSTANCE;

private KumanDriverProfile(ScreenDimension screenDimension) {
super(Vendor.KUMAN, screenDimension);
}

public static KumanDriverProfile getInstance(ScreenDimension screenDimension) {
if(INSTANCE == null) {
INSTANCE = new KumanDriverProfile(screenDimension);
}
return INSTANCE;
}

@Override
public Driver getDriver() {
return new KumanDriver(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
public enum Vendor {
KEDEI,
WAVESHARE,
UNKNOWN;
KUMAN,
UNKNOWN
}