Adding Futaba GP1212A01A read requests.
authorsl
Thu, 22 May 2014 11:29:23 +0200
changeset 190d9d062609eb
parent 18 14662967f913
child 20 23cacc1d17a3
Adding Futaba GP1212A01A read requests.
inc/FutabaVfd.h
src/FutabaVfd.cpp
src/test.cpp
     1.1 --- a/inc/FutabaVfd.h	Thu May 22 09:31:23 2014 +0200
     1.2 +++ b/inc/FutabaVfd.h	Thu May 22 11:29:23 2014 +0200
     1.3 @@ -109,9 +109,13 @@
     1.4  	//From FutabaVfd
     1.5  	virtual void SetBrightness(int aBrightness);
     1.6  	virtual void Clear();
     1.7 -	//
     1.8 +
     1.9 +	//Specific to GP1212A01A
    1.10  	void SetPixelBlock(int aX, int aY, int aHeight, int aSize, unsigned char aValue);
    1.11 -
    1.12 +    //
    1.13 +    void RequestId();
    1.14 +    void RequestFirmwareRevision();
    1.15 +    void RequestPowerSupplyStatus();
    1.16  private:
    1.17  	///
    1.18  	//FutabaVfdReport iReport;
     2.1 --- a/src/FutabaVfd.cpp	Thu May 22 09:31:23 2014 +0200
     2.2 +++ b/src/FutabaVfd.cpp	Thu May 22 11:29:23 2014 +0200
     2.3 @@ -170,15 +170,68 @@
     2.4  
     2.5  
     2.6  /**
     2.7 +Clear our display's screen.
     2.8  */
     2.9  void GP1212A01A::Clear()
    2.10  	{
    2.11 +    //Send Clear display command
    2.12  	FutabaVfdReport report;
    2.13  	report[0]=0x00; //Report ID
    2.14  	report[1]=0x04; //Report length
    2.15 -	report[2]=0x1B; //
    2.16 -	report[3]=0x5B; //
    2.17 -	report[4]=0x32; //
    2.18 -	report[5]=0x4A; //
    2.19 +	report[2]=0x1B; //Command ID
    2.20 +	report[3]=0x5B; //Command ID
    2.21 +	report[4]=0x32; //Command ID
    2.22 +	report[5]=0x4A; //Command ID
    2.23  	Write(report);
    2.24 -	}
    2.25 \ No newline at end of file
    2.26 +	}
    2.27 +
    2.28 +/**
    2.29 +*/
    2.30 +void GP1212A01A::RequestId()
    2.31 +    {
    2.32 +    //1BH,5BH,63H,49H,44H
    2.33 +    //Send Read ID command
    2.34 +    FutabaVfdReport report;
    2.35 +    report[0]=0x00; //Report ID
    2.36 +    report[1]=0x05; //Report length
    2.37 +    report[2]=0x1B; //Command ID
    2.38 +    report[3]=0x5B; //Command ID
    2.39 +    report[4]=0x63; //Command ID
    2.40 +    report[5]=0x49; //Command ID
    2.41 +    report[6]=0x44; //Command ID
    2.42 +    Write(report);
    2.43 +    }
    2.44 +
    2.45 +/**
    2.46 +*/
    2.47 +void GP1212A01A::RequestFirmwareRevision()
    2.48 +    {
    2.49 +    //1BH,5BH,63H,46H,52H
    2.50 +    //Send Software Revision Read Command
    2.51 +    FutabaVfdReport report;
    2.52 +    report[0]=0x00; //Report ID
    2.53 +    report[1]=0x05; //Report length
    2.54 +    report[2]=0x1B; //Command ID
    2.55 +    report[3]=0x5B; //Command ID
    2.56 +    report[4]=0x63; //Command ID
    2.57 +    report[5]=0x46; //Command ID
    2.58 +    report[6]=0x52; //Command ID
    2.59 +    Write(report);
    2.60 +    }
    2.61 +
    2.62 +/**
    2.63 +*/
    2.64 +void GP1212A01A::RequestPowerSupplyStatus()
    2.65 +    {
    2.66 +    //1BH,5BH,63H,50H,4DH
    2.67 +    //Send Power Suppply Monitor Command
    2.68 +    FutabaVfdReport report;
    2.69 +    report[0]=0x00; //Report ID
    2.70 +    report[1]=0x05; //Report length
    2.71 +    report[2]=0x1B; //Command ID
    2.72 +    report[3]=0x5B; //Command ID
    2.73 +    report[4]=0x63; //Command ID
    2.74 +    report[5]=0x50; //Command ID
    2.75 +    report[6]=0x4D; //Command ID
    2.76 +    Write(report);
    2.77 +    }
    2.78 \ No newline at end of file
     3.1 --- a/src/test.cpp	Thu May 22 09:31:23 2014 +0200
     3.2 +++ b/src/test.cpp	Thu May 22 11:29:23 2014 +0200
     3.3 @@ -725,6 +725,7 @@
     3.4  MainWindow::onFutabaReadId(FXObject *sender, FXSelector sel, void *ptr)
     3.5  {
     3.6  	//1BH,5BH,63H,49H,44H
     3.7 +    /*
     3.8  	memset(iOutputReportBuffer, 0x0, KFutabaMaxHidReportSize);
     3.9  	iOutputReportBuffer[0]=0x00; //Report ID
    3.10  	iOutputReportBuffer[1]=0x05; //Report length
    3.11 @@ -734,6 +735,9 @@
    3.12  	iOutputReportBuffer[5]=0x49; //
    3.13  	iOutputReportBuffer[6]=0x44; //
    3.14  	int res = hid_write(connected_device, iOutputReportBuffer, KFutabaMaxHidReportSize);
    3.15 +    */
    3.16 +
    3.17 +    iVfd01.RequestId();
    3.18  
    3.19  	return 1;
    3.20  }
    3.21 @@ -742,6 +746,7 @@
    3.22  MainWindow::onFutabaReadFirmwareRevision(FXObject *sender, FXSelector sel, void *ptr)
    3.23  {
    3.24  	//1BH,5BH,63H,46H,52H
    3.25 +    /*
    3.26  	memset(iOutputReportBuffer, 0x0, KFutabaMaxHidReportSize);
    3.27  	iOutputReportBuffer[0]=0x00; //Report ID
    3.28  	iOutputReportBuffer[1]=0x05; //Report length
    3.29 @@ -751,6 +756,8 @@
    3.30  	iOutputReportBuffer[5]=0x46; //
    3.31  	iOutputReportBuffer[6]=0x52; //
    3.32  	int res = hid_write(connected_device, iOutputReportBuffer, KFutabaMaxHidReportSize);
    3.33 +    */
    3.34 +    iVfd01.RequestFirmwareRevision();
    3.35  
    3.36  	return 1;
    3.37  }
    3.38 @@ -759,6 +766,7 @@
    3.39  MainWindow::onFutabaPowerSupplyMonitor(FXObject *sender, FXSelector sel, void *ptr)
    3.40  {
    3.41  	//1BH,5BH,63H,50H,4DH
    3.42 +    /*
    3.43  	memset(iOutputReportBuffer, 0x0, KFutabaMaxHidReportSize);
    3.44  	iOutputReportBuffer[0]=0x00; //Report ID
    3.45  	iOutputReportBuffer[1]=0x05; //Report length
    3.46 @@ -768,6 +776,9 @@
    3.47  	iOutputReportBuffer[5]=0x50; //
    3.48  	iOutputReportBuffer[6]=0x4D; //
    3.49  	int res = hid_write(connected_device, iOutputReportBuffer, KFutabaMaxHidReportSize);
    3.50 +    */
    3.51 +
    3.52 +    iVfd01.RequestPowerSupplyStatus();
    3.53  
    3.54  	return 1;
    3.55  }