Click here to Skip to main content
15,887,027 members
Articles / Desktop Programming / MFC

A PIC C Code Wizard

Rate me:
Please Sign up or sign in to vote.
4.94/5 (27 votes)
5 May 2003CPOL5 min read 156.1K   7.9K   46  
Creates C code templates for PIC microcontrollers. The default templates are for use with the Hi-Tech (tm) PICC compiler.
#if !defined(AFX_GENERAL_H__61E26F2E_6694_447F_A9F3_4B60CABDCA9A__INCLUDED_)
#define AFX_GENERAL_H__61E26F2E_6694_447F_A9F3_4B60CABDCA9A__INCLUDED_

#include "grid\gridctrl.h"
#include "piccpc.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// General.h : header file
//

enum PIC_FEATURES {
	PRODUCT,
	PROG_MEM_WORDS,
	PROG_MEM_ROM_WORDS,
	EEPROM_DATA_MEM_BYTES,
	RAM_BYTES,
	IO_PINS,
	PACKAGES,
	ANALOG_CHANNELS,
	ANALOG_COMPARATORS,
	DIGITAL_PWM,
	DIGITAL_TIMERS,
	DIGITAL_SERIAL_IO,
	MAX_SPEED_MHZ,
	CCP_ECCP
};

/////////////////////////////////////////////////////////////////////////////
// CGeneral dialog

class CGeneral : public CPropertyPage
{
	DECLARE_DYNCREATE(CGeneral)

// Construction
public:
	CGeneral();
	~CGeneral();

// Dialog Data
	//{{AFX_DATA(CGeneral)
	enum { IDD = IDD_GENERAL };
	BOOL	m_bBrownOut;
	int		m_iCodeProtect;
	BOOL	m_bDataProtect;
	int		m_iFlashMemWrite;
	BOOL	m_bICD;
	BOOL	m_bLVP;
	CString	m_sProjectName;
	BOOL	m_bPowerUp;
	BOOL	m_bWDT;
	CGridCtrl m_PICGrid;
	double	m_dFrequency;
	//}}AFX_DATA

protected:
	CToolTipCtrl m_cTT;
	int m_iLastRow;
	void FillPICInfo( LPPICINFO p, int r );
	BOOL ProcessPICInfo();

// Overrides
	// ClassWizard generate virtual function overrides
	//{{AFX_VIRTUAL(CGeneral)
	public:
	virtual BOOL OnKillActive();
	virtual void OnOK();
	virtual BOOL OnSetActive();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	// Generated message map functions
	//{{AFX_MSG(CGeneral)
	afx_msg void OnChangeProjectname();
	afx_msg void OnGridSelChange(NMHDR* pNotifyStruct, LRESULT* pResult);
	virtual BOOL OnInitDialog();
	afx_msg void OnChangeFrequency();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GENERAL_H__61E26F2E_6694_447F_A9F3_4B60CABDCA9A__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Delphi
United States United States
Carlos Buelna works in the automotive industry.

Comments and Discussions