public static async Task StartDevice() { //TODO: do we need to throw an error if the processor has already been initialized? _device = await Tsc2046.GetDefaultAsync(); _processor = new TouchProcessor(_device); _processor.Initialize(); }
public static async Task <Tsc2046> GetDefaultAsync() { if (_defaultInstance == null) { _defaultInstance = new Tsc2046(); await _defaultInstance.InitTSC2046SPI().ConfigureAwait(false); } return(_defaultInstance); }
public TouchProcessor(Tsc2046 device) { this.device = device ?? throw new ArgumentNullException(nameof(device)); }