KinetisFlashToolDlg.h
/*
* Copyright (c) 2013-15, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// KinetisFlashToolDlg.h : header file
//
#pragma once
#include "afxwin.h"
#include "afxcmn.h"
#include <Setupapi.h>
#include "UpdateDlg.h"
#include "FlashDlg.h"
#include "ConfigDlg.h"
#include "../../common/blfwkdll/blfwkdll.h"
// class CKinetisFlashToolDlgAutoProxy;
// CKinetisFlashToolDlg dialog
class CKinetisFlashToolDlg : public CDialogEx
{
DECLARE_DYNAMIC(CKinetisFlashToolDlg);
// friend class CKinetisFlashToolDlgAutoProxy;
// Construction
public:
CKinetisFlashToolDlg(CWnd *pParent = NULL); // standard constructor
virtual ~CKinetisFlashToolDlg();
// Dialog Data
enum
{
IDD = IDD_KINETISFLASHTOOL_DIALOG
};
protected:
virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
// Implementation
protected:
// CKinetisFlashToolDlgAutoProxy* m_pAutoProxy;
HICON m_hIcon;
BOOL CanExit();
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnClose();
virtual void OnOK();
virtual void OnCancel();
DECLARE_MESSAGE_MAP()
void RefreshComPortList();
void RefreshBaudrateList();
void RefreshPidList();
void RefreshVidList();
void AppendLog(CString log);
void Reset();
void Connect();
public:
afx_msg void OnBnClickedRadio();
afx_msg void OnCbnSelchangeComboPortVid();
afx_msg void OnCbnSelchangeComboBaudPid();
afx_msg void OnKillfocusComboPortVid();
afx_msg void OnKillfocusComboBaudPid();
afx_msg void OnClickedButtonCntReset();
afx_msg void OnTcnSelchangeTabFunc(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
afx_msg LRESULT OnUpdateLog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnChangeConnection(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUpdateStatus(WPARAM wParam, LPARAM lParam);
void GetPeripheralConfig(blfwkdll::Updater::PeripheralConfig *config);
void RegisterUsbDeviceInterface();
CComboBox m_comboPortOrVID;
CComboBox m_comboBaudOrPID;
CString m_bootloaderVersion;
CString m_protoclVersion;
CString m_securityState;
CString m_flashSize;
CString m_flashSector;
CString m_ramSize;
CString m_rsvRgnFlashStart;
CString m_rsvRgnFlashEnd;
CString m_rsvRgnRamStart;
CString m_rsvRgnRamEnd;
CTabCtrl m_tabFunc;
CString m_log;
CEdit m_logCtrl;
UpdateDlg m_updateDlg;
FlashDlg m_flashDlg;
ConfigDlg m_bootloaderConfigDLg;
HDEVNOTIFY m_devNotify;
};
CKinetisFlashToolDlg::m_tabFunc
CTabCtrl m_tabFunc
Control variable for tab control.
Definition: KinetisFlashToolDlg.h:146
FlashDlg
FlashDlg class is the UI Dialog class for the Flash utilities tab page.
Definition: FlashDlg.h:39
CKinetisFlashToolDlg::Connect
void Connect()
Connect operation.
Definition: KinetisFlashToolDlg.cpp:490
CKinetisFlashToolDlg::m_logCtrl
CEdit m_logCtrl
Control variable for log textbox.
Definition: KinetisFlashToolDlg.h:148
CKinetisFlashToolDlg::AppendLog
void AppendLog(CString log)
Append a new log string to the log textbox.
Definition: KinetisFlashToolDlg.cpp:431
CKinetisFlashToolDlg::m_securityState
CString m_securityState
Variable for device info.
Definition: KinetisFlashToolDlg.h:138
CKinetisFlashToolDlg::RefreshPidList
void RefreshPidList()
Refresh PID list.
Definition: KinetisFlashToolDlg.cpp:405
CKinetisFlashToolDlg::DECLARE_MESSAGE_MAP
DECLARE_MESSAGE_MAP() void RefreshComPortList()
Scan COM port and update it to UI.
CKinetisFlashToolDlg::m_rsvRgnRamStart
CString m_rsvRgnRamStart
Variable for device info.
Definition: KinetisFlashToolDlg.h:144
CKinetisFlashToolDlg::m_log
CString m_log
Variable for log text box.
Definition: KinetisFlashToolDlg.h:147
CKinetisFlashToolDlg::m_ramSize
CString m_ramSize
Variable for device info.
Definition: KinetisFlashToolDlg.h:141
CKinetisFlashToolDlg::m_flashSector
CString m_flashSector
Variable for device info.
Definition: KinetisFlashToolDlg.h:140
CKinetisFlashToolDlg::m_bootloaderVersion
CString m_bootloaderVersion
Variable for device info.
Definition: KinetisFlashToolDlg.h:136
CKinetisFlashToolDlg::CKinetisFlashToolDlg
CKinetisFlashToolDlg(CWnd *pParent=NULL)
Generated standard constructor.
Definition: KinetisFlashToolDlg.cpp:90
CKinetisFlashToolDlg::RegisterUsbDeviceInterface
void RegisterUsbDeviceInterface()
Register usb device interface.
Definition: KinetisFlashToolDlg.cpp:351
CKinetisFlashToolDlg::RefreshVidList
void RefreshVidList()
Refresh VID list.
Definition: KinetisFlashToolDlg.cpp:418
CKinetisFlashToolDlg::RefreshBaudrateList
void RefreshBaudrateList()
Refresh baud rate list.
Definition: KinetisFlashToolDlg.cpp:392
CKinetisFlashToolDlg::OnInitDialog
virtual BOOL OnInitDialog()
Generated message map functions.
CKinetisFlashToolDlg::m_flashSize
CString m_flashSize
Variable for device info.
Definition: KinetisFlashToolDlg.h:139
CKinetisFlashToolDlg::m_comboBaudOrPID
CComboBox m_comboBaudOrPID
Control variable for Baud rate/PID combox.
Definition: KinetisFlashToolDlg.h:135
CKinetisFlashToolDlg::Reset
void Reset()
Reset operation.
Definition: KinetisFlashToolDlg.cpp:499
CKinetisFlashToolDlg::OnBnClickedRadio
afx_msg void OnBnClickedRadio()
Generated message map functions.
Definition: KinetisFlashToolDlg.cpp:506
CKinetisFlashToolDlg::m_flashDlg
FlashDlg m_flashDlg
Variable for flash utility tab page.
Definition: KinetisFlashToolDlg.h:150
CKinetisFlashToolDlg::m_rsvRgnFlashStart
CString m_rsvRgnFlashStart
Variable for device info.
Definition: KinetisFlashToolDlg.h:142
CKinetisFlashToolDlg::m_protoclVersion
CString m_protoclVersion
Variable for device info.
Definition: KinetisFlashToolDlg.h:137
CKinetisFlashToolDlg::m_updateDlg
UpdateDlg m_updateDlg
Variable for update tab page.
Definition: KinetisFlashToolDlg.h:149
CKinetisFlashToolDlg::m_comboPortOrVID
CComboBox m_comboPortOrVID
Control variable for Com port/VID combox.
Definition: KinetisFlashToolDlg.h:134
CKinetisFlashToolDlg::OnUpdateLog
afx_msg LRESULT OnUpdateLog(WPARAM wParam, LPARAM lParam)
User defined message map functions.
Definition: KinetisFlashToolDlg.cpp:881
CKinetisFlashToolDlg
CKinetisFlashToolDlg class is the UI Dialog class for the main page.
Definition: KinetisFlashToolDlg.h:49
CKinetisFlashToolDlg::m_rsvRgnRamEnd
CString m_rsvRgnRamEnd
Variable for device info.
Definition: KinetisFlashToolDlg.h:145
CKinetisFlashToolDlg::m_rsvRgnFlashEnd
CString m_rsvRgnFlashEnd
Variable for device info.
Definition: KinetisFlashToolDlg.h:143
ConfigDlg
ConfigDlg class is the UI Dialog class for the BCA utilities tab page.
Definition: ConfigDlg.h:39
CKinetisFlashToolDlg::m_bootloaderConfigDLg
ConfigDlg m_bootloaderConfigDLg
Variable for config tab page.
Definition: KinetisFlashToolDlg.h:151
CKinetisFlashToolDlg::m_devNotify
HDEVNOTIFY m_devNotify
Handler for device change notify.
Definition: KinetisFlashToolDlg.h:152
CKinetisFlashToolDlg::~CKinetisFlashToolDlg
virtual ~CKinetisFlashToolDlg()
Generated standard destructor.
Definition: KinetisFlashToolDlg.cpp:109
CKinetisFlashToolDlg::GetPeripheralConfig
void GetPeripheralConfig(blfwkdll::Updater::PeripheralConfig *config)
Get the PeripheralConfig of bootloader.
Definition: KinetisFlashToolDlg.cpp:440
UpdateDlg
UpdateDlg class is the UI Dialog class for the Update tab page.
Definition: UpdateDlg.h:39