home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 81 / IOPROG_81.ISO / soft / Codice / SymmeticEncryption / SpuntoHardwareKeyProgrammerUnit.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-04-28  |  3.8 KB  |  99 lines

  1. //---------------------------------------------------------------------------
  2. //  C++ EEPROM Programmer 1.0
  3. //  Copyright 2004 spuntosoft@tiscali.it
  4. //---------------------------------------------------------------------------
  5. #ifndef SpuntoHardwareKeyProgrammerUnitH
  6. #define SpuntoHardwareKeyProgrammerUnitH
  7. //---------------------------------------------------------------------------
  8. #include <Classes.hpp>
  9. #include <Controls.hpp>
  10. #include <StdCtrls.hpp>
  11. #include <Forms.hpp>
  12. #include <SysUtils.hpp>
  13. #include "SpuntoLedComponent.hpp"
  14. #include "TSpuntoHardwarePortIO_unit.hpp"
  15. #include <ExtCtrls.hpp>
  16. #include <ComCtrls.hpp>
  17. #include <Buttons.hpp>
  18. #include "CSPIN.h"
  19. #include <Graphics.hpp>
  20. #include <Math.hpp>
  21. //---------------------------------------------------------------------------
  22. class TSpuntoHardwareKeyProgrammerForm : public TForm
  23. {
  24. __published:    // IDE-managed Components
  25.         TSpuntoHardwarePortIO *SpuntoHardwarePort;
  26.         TGroupBox *COMGroupBox;
  27.         TRadioButton *COM1RadioButton;
  28.         TRadioButton *COM2RadioButton;
  29.         TGroupBox *WaveformGroupBox;
  30.         TLabel *Label1;
  31.         TLabel *Label3;
  32.         TTrackBar *PeriodTrackBar;
  33.         TLabel *Label5;
  34.         TLabel *Label6;
  35.         TLabel *Label7;
  36.         TGroupBox *EEPROM;
  37.         TCSpinEdit *CSpinEditAddress;
  38.         TCSpinEdit *CSpinEditData;
  39.         TLabel *Label19;
  40.         TLabel *Label20;
  41.         TBitBtn *WriteEEPROM;
  42.         TComboBox *ComboBoxEEPROMType;
  43.         TLabel *Label21;
  44.         TButton *SDA_LOW_Button;
  45.         TButton *SDA_HIGH_Button;
  46.         TButton *SCL_LOW_Button;
  47.         TButton *SCL_HIGH_Button;
  48.         TBitBtn *HardwareKeyONButton;
  49.         TBitBtn *ReadEEPROMButton;
  50.         TLabel *AckLabel;
  51.         TLabel *Label2;
  52.         TLabel *EEPROMTitleLabel;
  53.         TLabel *EEPROMStatusLabel;
  54.         TGroupBox *KeyGroupBox;
  55.         TCSpinEdit *KeyAddressSpinEdit;
  56.         TLabel *Label4;
  57.         TLabel *Label8;
  58.         TCSpinEdit *KeyDataSpinEdit;
  59.         TBitBtn *CheckEEPROMButton;
  60.         TLabel *KeyOKLabel;
  61.         TImage *Image1;
  62.         void __fastcall PeriodTrackBarChange(TObject *Sender);
  63.         void __fastcall FormCreate(TObject *Sender);
  64.         void __fastcall PowerONSpeedButtonClick(TObject *Sender);
  65.         void __fastcall COM1RadioButtonClick(TObject *Sender);
  66.         void __fastcall COM2RadioButtonClick(TObject *Sender);
  67.         void __fastcall WriteEEPROMClick(TObject *Sender);
  68.         void __fastcall SCL_LOW_ButtonClick(TObject *Sender);
  69.         void __fastcall SDA_LOW_ButtonClick(TObject *Sender);
  70.         void __fastcall SCL_HIGH_ButtonClick(TObject *Sender);
  71.         void __fastcall SDA_HIGH_ButtonClick(TObject *Sender);
  72.         void __fastcall HardwareKeyONButtonClick(TObject *Sender);
  73.         void __fastcall ReadEEPROMButtonClick(TObject *Sender);
  74.         void __fastcall CheckEEPROMButtonClick(TObject *Sender);
  75.         void __fastcall CSpinEditAddressChange(TObject *Sender);
  76. private:    // User declarations
  77.         void HardwareDeviceSerialON(unsigned short HardwareDeviceComPort);
  78.         byte EEPROMCheck(void);
  79.         void TheDelay(int DelayUnit);
  80.         void Low_SDA(void);
  81.         void High_SDA(void);
  82.         void Low_SCL(void);
  83.         void High_SCL(void);
  84.         void Start(void);
  85.         void Stop(void);
  86.         void Output_byte(byte Out_byte);
  87.         byte Input_byte(void);
  88.         byte Acknowledge(void);
  89.         void Write_data(int Address, byte Data);
  90.         byte Read_data(int Address);
  91.  
  92. public:        // User declarations
  93.         __fastcall TSpuntoHardwareKeyProgrammerForm(TComponent* Owner);
  94. };
  95. //---------------------------------------------------------------------------
  96. extern PACKAGE TSpuntoHardwareKeyProgrammerForm *SpuntoHardwareKeyProgrammerForm;
  97. //---------------------------------------------------------------------------
  98. #endif
  99.