Skip to content

Commit

Permalink
new: Move Curiosity, Curiosity HPC and Xpress boards from experimenta…
Browse files Browse the repository at this point in the history
…l to stable version.
  • Loading branch information
lcgamboa committed Jul 28, 2023
1 parent dc54919 commit e11f31f
Show file tree
Hide file tree
Showing 21 changed files with 7,730 additions and 140 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ PACKAGE=picsimlab
MAINVER=0
MINORVER=9
VERSION=0.9.0
DATE=230715
DATE=230728
VERSION_STABLE=0.8.12
31 changes: 16 additions & 15 deletions share/boards/Curiosity HPC/board.map
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<img src="[Curiosity_HPC] (imported)" width="910" height="502" border="0" usemap="#map" />
<img src="[Curiosity_HPC] (imported)" width="1210" height="591" border="0" usemap="#map" />

<map name="map">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:medelk -->
<area shape="rect" coords="83,81,210,104" href="I_PG_ICSP" />
<area shape="rect" coords="167,151,206,191" href="B_PB_RST" />
<area shape="rect" coords="66,136,129,158" href="B_JP_1" />
<area shape="rect" coords="3,231,43,294" href="I_SW_PWR" />
<area shape="rect" coords="339,423,383,475" href="B_PB_S1" />
<area shape="rect" coords="462,424,503,473" href="B_PB_S2" />
<area shape="rect" coords="247,340,324,410" href="B_PO_1" />
<area shape="rect" coords="373,321,385,351" href="O_LD_D5" />
<area shape="rect" coords="474,320,486,350" href="O_LD_D2" />
<area shape="rect" coords="97,458,129,470" href="O_LD_D6" />
<area shape="rect" coords="406,321,418,351" href="O_LD_D4" />
<area shape="rect" coords="440,320,452,350" href="O_LD_D3" />
<area shape="rect" coords="188,460,220,470" href="O_LD_D7" />
<!-- #$AUTHOR:medelk -->
<area shape="rect" coords="153,10,320,36" href="I_PG_ICSP" />
<area shape="rect" coords="251,64,302,115" href="B_PB_RST" />
<area shape="rect" coords="138,69,199,85" href="B_JP_1" />
<area shape="rect" coords="8,268,79,333" href="I_SW_PWR" />
<area shape="rect" coords="545,513,596,564" href="B_PB_S1" />
<area shape="rect" coords="711,512,762,563" href="B_PB_S2" />
<area shape="rect" coords="358,483,439,564" href="B_PO_1" />
<area shape="rect" coords="501,474,514,492" href="O_LD_D5" />
<area shape="rect" coords="633,474,647,491" href="O_LD_D2" />
<area shape="rect" coords="135,556,153,570" href="O_LD_D6" />
<area shape="rect" coords="544,475,557,491" href="O_LD_D4" />
<area shape="rect" coords="586,474,600,492" href="O_LD_D3" />
<area shape="rect" coords="199,556,217,570" href="O_LD_D7" />
<area shape="rect" coords="372,158,773,260" href="O_IC_CPU" />
</map>
Binary file removed share/boards/Curiosity HPC/board.png
Binary file not shown.
3,476 changes: 3,476 additions & 0 deletions share/boards/Curiosity HPC/board.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added share/boards/Curiosity HPC/demo.pzw
Binary file not shown.
29 changes: 15 additions & 14 deletions share/boards/Curiosity/board.map
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<img src="picsimlab5.xcf" width="575" height="326" border="0" usemap="#map" />
<img src="picsimlab5.xcf" width="1164" height="591" border="0" usemap="#map" />

<map name="map">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:Luis Claudio Gamboa Lopes -->
<area shape="rect" coords="52,129,82,149" href="B_PB_RST" />
<area shape="rect" coords="66,294,95,315" href="B_PB_S1" />
<area shape="rect" coords="145,141,183,152" href="B_JP_1" />
<area shape="rect" coords="39,51,83,116" href="I_SW_PWR" />
<area shape="rect" coords="11,219,24,289" href="I_PG_ICSP" />
<area shape="rect" coords="389,259,439,307" href="B_PO_1" />
<area shape="rect" coords="23,296,38,302" href="O_LD_D1" />
<area shape="rect" coords="154,208,169,214" href="O_LD_D2" />
<area shape="rect" coords="375,295,381,310" href="O_LD_D4" />
<area shape="rect" coords="353,295,359,310" href="O_LD_D6" />
<area shape="rect" coords="364,295,370,310" href="O_LD_D5" />
<area shape="rect" coords="341,295,347,310" href="O_LD_D7" />
<!-- #$AUTHOR:Luis Claudio Gamboa Lopes -->
<area shape="rect" coords="369,257,420,308" href="B_PB_RST" />
<area shape="rect" coords="260,516,311,567" href="B_PB_S1" />
<area shape="rect" coords="370,207,431,225" href="B_JP_1" />
<area shape="rect" coords="134,5,220,117" href="I_SW_PWR" />
<area shape="rect" coords="560,17,725,42" href="I_PG_ICSP" />
<area shape="rect" coords="849,444,932,527" href="B_PO_1" />
<area shape="rect" coords="138,556,153,569" href="O_LD_D1" />
<area shape="rect" coords="203,556,219,569" href="O_LD_D2" />
<area shape="rect" coords="824,518,837,533" href="O_LD_D4" />
<area shape="rect" coords="776,518,790,533" href="O_LD_D6" />
<area shape="rect" coords="800,518,813,533" href="O_LD_D5" />
<area shape="rect" coords="753,518,766,533" href="O_LD_D7" />
<area shape="rect" coords="500,265,702,307" href="O_IC_CPU" />
</map>
Binary file removed share/boards/Curiosity/board.png
Binary file not shown.
2,979 changes: 2,979 additions & 0 deletions share/boards/Curiosity/board.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added share/boards/Curiosity/demo.pzw
Binary file not shown.
26 changes: 14 additions & 12 deletions share/boards/Xpress/board.map
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<img src="picsimlab5.xcf" width="441" height="326" border="0" usemap="#map" />
<img src="picsimlab5.xcf" width="452" height="272" border="0" usemap="#map" />

<map name="map">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:Luis Claudio Gamboa Lopes -->
<area shape="rect" coords="89,192,119,223" href="B_PB_RST" />
<area shape="rect" coords="151,192,181,223" href="B_PB_S1" />
<area shape="rect" coords="0,145,31,184" href="I_SW_PWR" />
<area shape="rect" coords="72,118,105,151" href="I_PG_ICSP" />
<area shape="rect" coords="152,107,202,157" href="B_PO_1" />
<area shape="rect" coords="100,85,110,95" href="O_LD_D1" />
<area shape="rect" coords="206,140,221,146" href="O_LD_D2" />
<area shape="rect" coords="206,155,221,161" href="O_LD_D3" />
<area shape="rect" coords="206,169,221,175" href="O_LD_D4" />
<area shape="rect" coords="206,183,221,189" href="O_LD_D5" />
<!-- #$AUTHOR:Luis Claudio Gamboa Lopes -->
<area shape="rect" coords="105,171,140,206" href="B_PB_RST" />
<area shape="rect" coords="176,172,211,207" href="B_PB_S1" />
<area shape="rect" coords="1,115,56,162" href="I_SW_PWR" />
<area shape="rect" coords="253,8,336,21" href="I_PG_ICSP" />
<area shape="rect" coords="180,68,239,127" href="B_PO_1" />
<area shape="rect" coords="127,41,136,52" href="O_LD_D1" />
<area shape="rect" coords="254,99,265,109" href="O_LD_D2" />
<area shape="rect" coords="254,118,265,127" href="O_LD_D3" />
<area shape="rect" coords="254,136,265,145" href="O_LD_D4" />
<area shape="rect" coords="254,155,265,165" href="O_LD_D5" />
<area shape="rect" coords="112,41,121,52" href="O_LD_D1R" />
<area shape="rect" coords="325,127,347,137" href="O_IC_CPU" />
</map>
Binary file removed share/boards/Xpress/board.png
Binary file not shown.
1,022 changes: 1,022 additions & 0 deletions share/boards/Xpress/board.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added share/boards/Xpress/demo.pzw
Binary file not shown.
5 changes: 4 additions & 1 deletion src/boards/board_C3_DevKitC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ enum {
O_LON, // Power LED
O_RST, // Reset button
O_BOOT, // Boot button
O_LED // User LED
O_LED, // User LED
O_LRGB // User RGB LED
};
// return the input ids numbers of names used in input map

Expand Down Expand Up @@ -155,6 +156,8 @@ unsigned short cboard_C3_DevKitC::GetOutputId(char* name) {
return O_BOOT;
if (strcmp(name, "LD_USER") == 0)
return O_LED;
if (strcmp(name, "LD_RGB") == 0)
return O_LRGB;

printf("Error output '%s' don't have a valid id! \n", name);
return 1;
Expand Down
69 changes: 45 additions & 24 deletions src/boards/exp_board_Curiosity.cc → src/boards/board_Curiosity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
######################################################################## */

// include files
#include "exp_board_Curiosity.h"
#include "board_Curiosity.h"
#include "../lib/oscilloscope.h"
#include "../lib/picsimlab.h"
#include "../lib/spareparts.h"
Expand All @@ -50,7 +50,8 @@ enum {
O_D6, // LED D6
O_D7, // LED D7
O_RST, // Reset button
O_S1 // S1 push button
O_S1, // S1 push button
O_MP // uController name
};
// return the input ids numbers of names used in input map

Expand Down Expand Up @@ -95,14 +96,16 @@ unsigned short cboard_Curiosity::GetOutputId(char* name) {
return O_POT1;
if (strcmp(name, "PB_RST") == 0)
return O_RST;
if (strcmp(name, "IC_CPU") == 0)
return O_MP;

printf("Erro output '%s' don't have a valid id! \n", name);
return 1;
}

// Constructor called once on board creation

cboard_Curiosity::cboard_Curiosity(void) {
cboard_Curiosity::cboard_Curiosity(void) : font(12, lxFONTFAMILY_TELETYPE, lxFONTSTYLE_NORMAL, lxFONTWEIGHT_BOLD) {
Proc = "PIC16F1619"; // default microcontroller if none defined in preferences
ReadMaps(); // Read input and output board maps
jmp[0] = 0;
Expand Down Expand Up @@ -498,16 +501,16 @@ void cboard_Curiosity::Draw(CDraw* draw) {
draw->Canvas.SetColor(0, 200 * PICSimLab.GetMcuPwr() + 55, 0);
break;
case O_D4: // Red using pin 2 mean value (RA5)
draw->Canvas.SetColor(pic.pins[1].oavalue, 0, 0);
draw->Canvas.SetColor(0, pic.pins[1].oavalue, 0);
break;
case O_D5: // Red using pin 18 mean value (RA1)
draw->Canvas.SetColor(pic.pins[17].oavalue, 0, 0);
draw->Canvas.SetColor(0, pic.pins[17].oavalue, 0);
break;
case O_D6: // Red using pin 17 mean value (RA2)
draw->Canvas.SetColor(pic.pins[16].oavalue, 0, 0);
draw->Canvas.SetColor(0, pic.pins[16].oavalue, 0);
break;
case O_D7: // Red using pin 5 mean value (RC5)
draw->Canvas.SetColor(pic.pins[4].oavalue, 0, 0);
draw->Canvas.SetColor(0, pic.pins[4].oavalue, 0);
break;
case O_JMP:
draw->Canvas.SetColor(150, 150, 150);
Expand All @@ -516,40 +519,55 @@ void cboard_Curiosity::Draw(CDraw* draw) {
case O_RST:
draw->Canvas.SetColor(100, 100, 100);
break;
case O_POT1:
draw->Canvas.SetColor(100, 100, 100);
case O_MP:
draw->Canvas.SetColor(26, 26, 26);
break;
}

// draw a rectangle
draw->Canvas.Rectangle(1, output[i].x1, output[i].y1, output[i].x2 - output[i].x1,
output[i].y2 - output[i].y1);

if (output[i].id == O_S1) {
if (output[i].id == O_MP) {
lxRect rec;
draw->Canvas.SetFont(font);
draw->Canvas.Rectangle(1, output[i].x1, output[i].y1, output[i].x2 - output[i].x1,
output[i].y2 - output[i].y1);
draw->Canvas.SetFgColor(230, 230, 230);
rec.x = output[i].x1;
rec.y = output[i].y1;
rec.width = output[i].x2 - output[i].x1;
rec.height = output[i].y2 - output[i].y1;
draw->Canvas.TextOnRect(Proc, rec, lxALIGN_CENTER | lxALIGN_CENTER_VERTICAL);
} else if (output[i].id == O_S1) {
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 16);
if (p_BT1) {
draw->Canvas.SetColor(15, 15, 15);
} else {
draw->Canvas.SetColor(55, 55, 55);
}
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 9);
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 14);
} else if (output[i].id == O_RST) {
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 16);
if (p_RST) {
draw->Canvas.SetColor(15, 15, 15);
} else {
draw->Canvas.SetColor(55, 55, 55);
}
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 9);
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 14);
} else if (output[i].id == O_POT1) {
draw->Canvas.SetColor(10, 10, 10);
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 20);
draw->Canvas.SetBgColor(66, 109, 246);
draw->Canvas.Rectangle(1, output[i].x1, output[i].y1, output[i].x2 - output[i].x1,
output[i].y2 - output[i].y1);

draw->Canvas.SetColor(150, 150, 150);
int x = -16 * sin((5.585 * (pot1 / 200.0)) + 0.349);
int y = 16 * cos((5.585 * (pot1 / 200.0)) + 0.349);
draw->Canvas.Circle(1, output[i].cx + x, output[i].cy + y, 3);
draw->Canvas.SetBgColor(250, 250, 250);
draw->Canvas.Circle(1, output[i].cx, output[i].cy, 30);

draw->Canvas.SetBgColor(150, 150, 150);
int x = -22 * sin((5.585 * (pot1 / 200.0)) + 0.349);
int y = 22 * cos((5.585 * (pot1 / 200.0)) + 0.349);
draw->Canvas.Circle(1, output[i].cx + x, output[i].cy + y, 5);
} else if (output[i].id == O_JMP) {
if (!jmp[0]) {
// draw a rectangle
draw->Canvas.Rectangle(1, output[i].x1, output[i].y1, output[i].x2 - output[i].x1,
output[i].y2 - output[i].y1);
if (jmp[0]) {
draw->Canvas.SetColor(70, 70, 70);
draw->Canvas.Rectangle(1, output[i].x1, output[i].y1, (int)((output[i].x2 - output[i].x1) * 0.65),
output[i].y2 - output[i].y1);
Expand All @@ -565,8 +583,11 @@ void cboard_Curiosity::Draw(CDraw* draw) {
draw->Canvas.Circle(1, output[i].x1 + (int)((output[i].x2 - output[i].x1) * 0.20),
output[i].y1 + ((output[i].y2 - output[i].y1) / 2), 3);
}
} else {
// draw a rectangle
draw->Canvas.Rectangle(1, output[i].x1, output[i].y1, output[i].x2 - output[i].x1,
output[i].y2 - output[i].y1);
}

} else // if output shape is a circle
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class cboard_Curiosity : public bsim_picsim {
CLabel* label5; // label of gauge RC5

void RegisterRemoteControl(void) override;
lxFont font;

public:
// Return the board name
Expand All @@ -67,8 +68,6 @@ class cboard_Curiosity : public bsim_picsim {
void Run_CPU(void) override;
// Return a list of board supported microcontrollers
lxString GetSupportedDevices(void) override { return lxT("PIC16F1619,"); };
// Return the filename of board picture
lxString GetPictureFileName(void) override { return lxT("Curiosity/board.png"); };
// Reset board status
void Reset(void) override;
// Event on the board
Expand Down
Loading

0 comments on commit e11f31f

Please sign in to comment.