home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 81 / IOPROG_81.ISO / soft / Codice / SymmeticEncryption.ZIP / SpuntoHardwareKeyProgrammerUnit.~h < prev    next >
Encoding:
Text File  |  2004-03-09  |  3.8 KB  |  98 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. //---------------------------------------------------------------------------
  21. class TSpuntoHardwareKeyProgrammerForm : public TForm
  22. {
  23. __published:    // IDE-managed Components
  24.         TSpuntoHardwarePortIO *SpuntoHardwarePort;
  25.         TGroupBox *COMGroupBox;
  26.         TRadioButton *COM1RadioButton;
  27.         TRadioButton *COM2RadioButton;
  28.         TGroupBox *WaveformGroupBox;
  29.         TLabel *Label1;
  30.         TLabel *Label3;
  31.         TTrackBar *PeriodTrackBar;
  32.         TLabel *Label5;
  33.         TLabel *Label6;
  34.         TLabel *Label7;
  35.         TGroupBox *EEPROM;
  36.         TCSpinEdit *CSpinEditAddress;
  37.         TCSpinEdit *CSpinEditData;
  38.         TLabel *Label19;
  39.         TLabel *Label20;
  40.         TBitBtn *WriteEEPROM;
  41.         TComboBox *ComboBoxEEPROMType;
  42.         TLabel *Label21;
  43.         TButton *SDA_LOW_Button;
  44.         TButton *SDA_HIGH_Button;
  45.         TButton *SCL_LOW_Button;
  46.         TButton *SCL_HIGH_Button;
  47.         TBitBtn *HardwareKeyONButton;
  48.         TBitBtn *ReadEEPROMButton;
  49.         TLabel *AckLabel;
  50.         TLabel *Label2;
  51.         TLabel *EEPROMTitleLabel;
  52.         TLabel *EEPROMStatusLabel;
  53.         TGroupBox *KeyGroupBox;
  54.         TCSpinEdit *KeyAddressSpinEdit;
  55.         TLabel *Label4;
  56.         TLabel *Label8;
  57.         TCSpinEdit *KeyDataSpinEdit;
  58.         TBitBtn *CheckEEPROMButton;
  59.         TLabel *KeyOKLabel;
  60.         TImage *Image1;
  61.         void __fastcall PeriodTrackBarChange(TObject *Sender);
  62.         void __fastcall FormCreate(TObject *Sender);
  63.         void __fastcall PowerONSpeedButtonClick(TObject *Sender);
  64.         void __fastcall COM1RadioButtonClick(TObject *Sender);
  65.         void __fastcall COM2RadioButtonClick(TObject *Sender);
  66.         void __fastcall WriteEEPROMClick(TObject *Sender);
  67.         void __fastcall SCL_LOW_ButtonClick(TObject *Sender);
  68.         void __fastcall SDA_LOW_ButtonClick(TObject *Sender);
  69.         void __fastcall SCL_HIGH_ButtonClick(TObject *Sender);
  70.         void __fastcall SDA_HIGH_ButtonClick(TObject *Sender);
  71.         void __fastcall HardwareKeyONButtonClick(TObject *Sender);
  72.         void __fastcall ReadEEPROMButtonClick(TObject *Sender);
  73.         void __fastcall CheckEEPROMButtonClick(TObject *Sender);
  74.         void __fastcall CSpinEditAddressChange(TObject *Sender);
  75. private:    // User declarations
  76.         void HardwareDeviceSerialON(unsigned short HardwareDeviceComPort);
  77.         byte EEPROMCheck(void);
  78.         void TheDelay(int DelayUnit);
  79.         void Low_SDA(void);
  80.         void High_SDA(void);
  81.         void Low_SCL(void);
  82.         void High_SCL(void);
  83.         void Start(void);
  84.         void Stop(void);
  85.         void Output_byte(byte Out_byte);
  86.         byte Input_byte(void);
  87.         byte Acknowledge(void);
  88.         void Write_data(int Address, byte Data);
  89.         byte Read_data(int Address);
  90.  
  91. public:        // User declarations
  92.         __fastcall TSpuntoHardwareKeyProgrammerForm(TComponent* Owner);
  93. };
  94. //---------------------------------------------------------------------------
  95. extern PACKAGE TSpuntoHardwareKeyProgrammerForm *SpuntoHardwareKeyProgrammerForm;
  96. //---------------------------------------------------------------------------
  97. #endif
  98.