PICSimLab - Programmable IC Simulator Laboratory 0.9.2
PICSimLab - API
Loading...
Searching...
No Matches
bsim_gpsim.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_GPSIM_H
27#define BOARD_GPSIM_H
28
29#include "../lib/board.h"
30#include "../lib/serial_port.h"
31
32class bsim_gpsim : virtual public board {
33public:
34 bsim_gpsim(void);
35 int DebugInit(int dtyppe) override;
36 std::string GetDebugName(void) override { return "none"; };
37 void DebugLoop(void) override;
38 int CpuInitialized(void) override;
39 void MSetSerial(const char* port) override;
40 int MInit(const char* processor, const char* fname, float freq) override;
41 void MEnd(void) override;
42 int MGetArchitecture(void) override;
43 int MDumpMemory(const char* fname) override;
44 void MEraseFlash(void) override;
45 void MSetFreq(float freq) override;
46 float MGetFreq(void) override;
47 void MSetVCC(float vcc) override;
48 float MGetVCC(void) override;
49 float MGetInstClockFreq(void) override;
50 int MGetPinCount(void) override;
51 std::string MGetPinName(int pin) override;
52 void MSetPin(int pin, unsigned char value) override;
53 void MSetPinDOV(int pin, unsigned char ovalue) override;
54 void MSetAPin(int pin, float value) override;
55 unsigned char MGetPin(int pin) override;
56 const picpin* MGetPinsValues(void) override;
57 void MStep(void) override;
58 void MStepResume(void) override;
59 void MReset(int flags) override;
60 int GetDefaultClock(void) override { return 8; };
61
62protected:
63 void pins_reset(void);
64 picpin pins[256];
65 unsigned int serialbaud;
66 float serialexbaud;
67 float freq;
68#ifdef _WIN_
69 HANDLE serialfd;
70#else
71 int serialfd;
72#endif
73 std::string supported_devices;
74};
75
76#endif /* BOARD_GPSIM_H */
Board class.
Definition board.h:111
Definition bsim_gpsim.h:32
void MSetSerial(const char *port) override
Set serial port name to use.
Definition bsim_gpsim.cc:40
void MSetVCC(float vcc) override
board microcontroller set vcc
Definition bsim_gpsim.cc:93
int MGetArchitecture(void) override
Return board microcontroller architecture.
Definition bsim_gpsim.cc:75
void MSetPin(int pin, unsigned char value) override
board microcontroller set digital pin
Definition bsim_gpsim.cc:175
int CpuInitialized(void) override
return true if microcontroller is initialized
Definition bsim_gpsim.cc:105
float MGetVCC(void) override
board microcontroller get vcc
Definition bsim_gpsim.cc:97
int MInit(const char *processor, const char *fname, float freq) override
board microcontroller init
Definition bsim_gpsim.cc:46
int MGetPinCount(void) override
board microcontroller pin count
Definition bsim_gpsim.cc:137
void MReset(int flags) override
board microcontroller reset
Definition bsim_gpsim.cc:195
int MDumpMemory(const char *fname) override
board microcontroller save non volatile memory to hex file
Definition bsim_gpsim.cc:128
const picpin * MGetPinsValues(void) override
board microcontroller get all pins list struct
Definition bsim_gpsim.cc:199
float MGetFreq(void) override
board microcontroller get frequency
Definition bsim_gpsim.cc:89
void MStep(void) override
board microcontroller run one step
Definition bsim_gpsim.cc:203
int GetDefaultClock(void) override
Get board default clock in MHz.
Definition bsim_gpsim.h:60
std::string GetDebugName(void) override
Get debug interface name.
Definition bsim_gpsim.h:36
void MSetPinDOV(int pin, unsigned char ovalue) override
board microcontroller set Default Open Value (external pull)
Definition bsim_gpsim.cc:179
void MEnd(void) override
board microcontroller end
Definition bsim_gpsim.cc:71
int DebugInit(int dtyppe) override
Start debug support.
Definition bsim_gpsim.cc:132
void MSetFreq(float freq) override
board microcontroller set frequency
Definition bsim_gpsim.cc:83
void MSetAPin(int pin, float value) override
board microcontroller set analog pin
Definition bsim_gpsim.cc:183
float MGetInstClockFreq(void) override
board microcontroller get cpu internal clock (in PIC frequency/4)
Definition bsim_gpsim.cc:101
void DebugLoop(void) override
debug step (pooling)
Definition bsim_gpsim.cc:109
void MStepResume(void) override
board microcontroller run one or two steps to resume instruction
Definition bsim_gpsim.cc:212
unsigned char MGetPin(int pin) override
board microcontroller get digital pin value
Definition bsim_gpsim.cc:191
void MEraseFlash(void) override
board microcontroller erase flash memory (program)
Definition bsim_gpsim.cc:79
std::string MGetPinName(int pin) override
board microcontroller pin name
Definition bsim_gpsim.cc:111