PICSimLab - Programmable IC Simulator Laboratory 0.9.2
PICSimLab - API
Loading...
Searching...
No Matches
board_K16F.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_K16F_H
27#define BOARD_K16F_H
28
29#include "bsim_picsim.h"
30
31#include "../devices/lcd_hd44780.h"
32#include "../devices/mi2c_24CXXX.h"
33#include "../devices/rtc_pfc8563.h"
34
35#define BOARD_K16F_Name "K16F"
36
37class cboard_K16F : public bsim_picsim {
38private:
39 unsigned char p_KEY[12];
40
41 lcd_t lcd;
42
43 mi2c_t mi2c;
44 rtc_pfc8563_t rtc;
45
46 int lcde;
47
48 unsigned char clko;
49 unsigned char d;
50 unsigned char sda, sck;
51 char mi2c_tmp_name[200];
52
53 void RegisterRemoteControl(void) override;
54
55public:
56 // Return the board name
57 std::string GetName(void) override { return BOARD_K16F_Name; };
58 std::string GetAboutInfo(void) override { return "L.C. Gamboa \n <lcgamboa@yahoo.com>"; };
59 cboard_K16F(void);
60 ~cboard_K16F(void);
61 void Draw(void) override;
62 void Run_CPU(void) override;
63 std::string GetSupportedDevices(void) override { return "PIC16F628A,PIC16F648A,PIC16F84A,"; };
64 int MInit(const char* processor, const char* fname, float freq) override;
65 void Reset(void) override;
66 int MDumpMemory(const char* mfname) override;
67 void EvMouseButtonPress(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override;
68 void EvMouseButtonRelease(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override;
69 void EvKeyPress(unsigned int key, unsigned int mask) override;
70 void EvKeyRelease(unsigned int key, unsigned int mask) override;
71 void EvOnShow(void) override;
72 void RefreshStatus(void) override;
73 void WritePreferences(void) override;
74 void ReadPreferences(char* name, char* value) override;
75 unsigned short GetInputId(char* name) override;
76 unsigned short GetOutputId(char* name) override;
77};
78
79#endif /* BOARD_K16F_H */
Definition bsim_picsim.h:34
Definition board_K16F.h:37
void WritePreferences(void) override
Called to save board preferences in configuration file.
Definition board_K16F.cc:931
void EvKeyPress(unsigned int key, unsigned int mask) override
Event on the board.
Definition board_K16F.cc:728
int MDumpMemory(const char *mfname) override
board microcontroller save non volatile memory to hex file
Definition board_K16F.cc:125
void Draw(void) override
Called ever 100ms to draw board.
Definition board_K16F.cc:143
void EvKeyRelease(unsigned int key, unsigned int mask) override
Event on the board.
Definition board_K16F.cc:780
void ReadPreferences(char *name, char *value) override
Called whe configuration file load preferences.
Definition board_K16F.cc:936
int MInit(const char *processor, const char *fname, float freq) override
board microcontroller init
Definition board_K16F.cc:108
void EvMouseButtonRelease(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override
Event on the board.
Definition board_K16F.cc:656
std::string GetName(void) override
Get board name registered in PICSimLab.
Definition board_K16F.h:57
void RefreshStatus(void) override
Called ever 1s to refresh status.
Definition board_K16F.cc:946
void RegisterRemoteControl(void) override
Register remote control variables.
Definition board_K16F.cc:493
void EvOnShow(void) override
Event on the board.
Definition board_K16F.cc:831
std::string GetSupportedDevices(void) override
Return a list of supported microcontrollers.
Definition board_K16F.h:63
void EvMouseButtonPress(unsigned int button, unsigned int x, unsigned int y, unsigned int state) override
Event on the board.
Definition board_K16F.cc:526
void Reset(void) override
Reset board status.
Definition board_K16F.cc:445
void Run_CPU(void) override
Paralle thread called ever 100ms to run cpu code.
Definition board_K16F.cc:259
std::string GetAboutInfo(void) override
Return the about information of part.
Definition board_K16F.h:58
unsigned short GetInputId(char *name) override
return the input ids numbers of names used in input map
Definition board_K16F.cc:836
unsigned short GetOutputId(char *name) override
return the output ids numbers of names used in output map
Definition board_K16F.cc:879
Definition lcd_hd44780.h:67
Definition mi2c_24CXXX.h:28
Definition rtc_pfc8563.h:29