PICSimLab - Programmable IC Simulator Laboratory 0.9.2
PICSimLab - API
Loading...
Searching...
No Matches
board_PICGenios.h
1/* ########################################################################
2
3 PICSimLab - Programmable IC Simulator Laboratory
4
5 ########################################################################
6
7 Copyright (c) : 2010-2024 Luis Claudio GambĂ´a Lopes <lcgamboa@yahoo.com>
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23 For e-mail suggestions : lcgamboa@yahoo.com
24 ######################################################################## */
25
26#ifndef BOARD_PICGenios_H
27#define BOARD_PICGenios_H
28
29#include "../devices/lcd_hd44780.h"
30#include "../devices/mi2c_24CXXX.h"
31#include "../devices/rtc_ds1307.h"
32#include "../devices/swbounce.h"
33#include "bsim_picsim.h"
34
35#define BOARD_PICGenios_Name "PICGenios"
36
38private:
39 unsigned char p_BT[7];
40
41 unsigned char p_KEY[12];
42
43 unsigned char pot[2];
44 unsigned char active[2];
45
46 int vtc;
47 int vt;
48
49 lcd_t lcd;
50
51 mi2c_t mi2c;
52 rtc_ds1307_t rtc2;
53
54 int lcde;
55
56 int sound_on;
57
58 float vp1in;
59 float vp2in;
60 float vp2[2];
61 float temp[2];
62 float ref;
63
64 int rpmstp;
65 int rpmc;
66
67 unsigned char d;
68 unsigned char sda, sck;
69
70 int jmp[1];
71 int dip[20];
72
73 unsigned int lm1[40]; // 7s display mean value
74 unsigned int lm2[40];
75 unsigned int lm3[40];
76 unsigned int lm4[40];
77
78 int vent[2];
79 int lcdbmp[2];
80
81 int buzzerId;
82
83 char mi2c_tmp_name[200];
84
85 void RegisterRemoteControl(void) override;
86 SWBounce_t bounce;
87
88 int heater_pwr;
89 int cooler_pwr;
90
91 int TimerID;
92
93public:
94 // Return the board name
95 std::string GetName(void) override { return BOARD_PICGenios_Name; };
96 std::string GetAboutInfo(void) override { return "L.C. Gamboa \n <lcgamboa@yahoo.com>"; };
97 cboard_PICGenios(void);
99 void Draw(void) override;
100 void Run_CPU(void) override;
101 std::string GetSupportedDevices(void) override {
102 return "PIC16F1789,PIC16F1939,PIC16F777,PIC16F877A,PIC16F887,PIC18F452,PIC18F4520,PIC18F4550,PIC18F45K50,"
103 "PIC18F4580,PIC18F4620,PIC18F47K40,";
104 };
105 int MInit(const char* processor, const char* fname, float freq) override;
106 void Reset(void) override;
107 int MDumpMemory(const char* mfname) override;
108 void EvMouseMove(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override;
109 void EvMouseButtonPress(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override;
110 void EvMouseButtonRelease(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override;
111 void EvKeyPress(unsigned int key, unsigned int mask) override;
112 void EvKeyRelease(unsigned int key, unsigned int mask) override;
113 void EvOnShow(void) override;
114 void RefreshStatus(void) override;
115 void WritePreferences(void) override;
116 void ReadPreferences(char* name, char* value) override;
117 unsigned short GetInputId(char* name) override;
118 unsigned short GetOutputId(char* name) override;
119 void board_Event(const char* controlname) override;
120 void SetScale(double scale) override;
121 void OnTime(void);
122};
123
124#endif /* BOARD_4_H */
Definition bsim_picsim.h:34
Definition board_PICGenios.h:37
std::string GetAboutInfo(void) override
Return the about information of part.
Definition board_PICGenios.h:96
void EvKeyRelease(unsigned int key, unsigned int mask) override
Event on the board.
Definition board_PICGenios.cc:1978
void Run_CPU(void) override
Paralle thread called ever 100ms to run cpu code.
Definition board_PICGenios.cc:926
void Draw(void) override
Called ever 100ms to draw board.
Definition board_PICGenios.cc:407
unsigned short GetOutputId(char *name) override
return the output ids numbers of names used in output map
Definition board_PICGenios.cc:2178
void EvMouseMove(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override
Event on the board.
Definition board_PICGenios.cc:1469
int MInit(const char *processor, const char *fname, float freq) override
board microcontroller init
Definition board_PICGenios.cc:347
void WritePreferences(void) override
Called to save board preferences in configuration file.
Definition board_PICGenios.cc:2432
void ReadPreferences(char *name, char *value) override
Called whe configuration file load preferences.
Definition board_PICGenios.cc:2470
unsigned short GetInputId(char *name) override
return the input ids numbers of names used in input map
Definition board_PICGenios.cc:2066
void EvMouseButtonRelease(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override
Event on the board.
Definition board_PICGenios.cc:1785
void Reset(void) override
Reset board status.
Definition board_PICGenios.cc:1299
void RefreshStatus(void) override
Called ever 1s to refresh status.
Definition board_PICGenios.cc:2411
void board_Event(const char *controlname) override
Called when window side controls are activated.
Definition board_PICGenios.cc:2540
void SetScale(double scale) override
Set board draw scale.
Definition board_PICGenios.cc:364
void EvKeyPress(unsigned int key, unsigned int mask) override
Event on the board.
Definition board_PICGenios.cc:1895
void RegisterRemoteControl(void) override
Register remote control variables.
Definition board_PICGenios.cc:1374
std::string GetName(void) override
Get board name registered in PICSimLab.
Definition board_PICGenios.h:95
std::string GetSupportedDevices(void) override
Return a list of supported microcontrollers.
Definition board_PICGenios.h:101
void EvMouseButtonPress(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override
Event on the board.
Definition board_PICGenios.cc:1489
int MDumpMemory(const char *mfname) override
board microcontroller save non volatile memory to hex file
Definition board_PICGenios.cc:389
void EvOnShow(void) override
Event on the board.
Definition board_PICGenios.cc:2061
Definition swbounce.h:29
Definition lcd_hd44780.h:67
Definition mi2c_24CXXX.h:28
Definition rtc_ds1307.h:29