home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 81 / IOPROG_81.ISO / soft / Codice / SymmeticEncryption.ZIP / SymmetricEncriptionUnit.~h < prev    next >
Encoding:
Text File  |  2004-04-12  |  4.1 KB  |  106 lines

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