Skip to content

Commit 7a4bbaf

Browse files
Merge branch 'arduino-libraries:main' into main
2 parents b1f871e + ad20b5c commit 7a4bbaf

File tree

12 files changed

+62
-23
lines changed

12 files changed

+62
-23
lines changed

.github/workflows/check-arduino.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020

2121
- name: Arduino Lint
2222
uses: arduino/arduino-lint-action@v2

.github/workflows/compile-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: Checkout repository
37-
uses: actions/checkout@v4
37+
uses: actions/checkout@v5
3838

3939
- name: Compile example sketches
4040
uses: arduino/compile-sketches@v1

.github/workflows/spell-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020

2121
- name: Spell check
2222
uses: codespell-project/actions-codespell@master

.github/workflows/sync-labels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
3131

3232
- name: Download JSON schema for labels configuration file
3333
id: download-schema
@@ -105,10 +105,10 @@ jobs:
105105
echo "::set-output name=flag::--dry-run"
106106
107107
- name: Checkout repository
108-
uses: actions/checkout@v4
108+
uses: actions/checkout@v5
109109

110110
- name: Download configuration files artifact
111-
uses: actions/download-artifact@v4
111+
uses: actions/download-artifact@v5
112112
with:
113113
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
114114
path: ${{ env.CONFIGURATIONS_FOLDER }}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Arduino_PortentaMachineControl
2-
version=1.0.2
2+
version=1.0.3
33
author=Arduino
44
maintainer=Arduino <info@arduino.cc>
55
sentence=Arduino Library for Portenta Machine Control (PMC)

src/EncoderClass.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,14 @@ int EncoderClass::getRevolutions(int channel) {
6363
}
6464
}
6565

66+
void EncoderClass::setEncoding(int channel, QEI::Encoding encoding) {
67+
switch (channel) {
68+
case 0:
69+
return _enc0.setEncoding(encoding);
70+
case 1:
71+
return _enc1.setEncoding(encoding);
72+
}
73+
}
74+
6675
EncoderClass MachineControl_Encoders;
6776
/**** END OF FILE ****/

src/EncoderClass.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ class EncoderClass {
9494
*/
9595
int getRevolutions(int channel);
9696

97+
/**
98+
* @brief Set the encoding type for the specified encoder channel.
99+
*
100+
* This method changes the encoding type from the default X2_ENCODING.
101+
*
102+
* @param channel The encoder channel (0 or 1) to be changed.
103+
* @param encoding The encoding type.
104+
*/
105+
void setEncoding(int channel, QEI::Encoding encoding);
106+
97107
private:
98108
QEI _enc0; // QEI object for encoder 0
99109
QEI _enc1; // QEI object for encoder 1

src/TCTempProbeClass.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ uint8_t* boardInfo();
1818
TCTempProbeClass::TCTempProbeClass(PinName tc_cs_pin,
1919
PinName ch_sel0_pin,
2020
PinName ch_sel1_pin,
21-
PinName ch_sel2_pin)
22-
: MAX31855Class(tc_cs_pin), _tc_cs{tc_cs_pin}, _ch_sel0{ch_sel0_pin}, _ch_sel1{ch_sel1_pin}, _ch_sel2{ch_sel2_pin}
21+
PinName ch_sel2_pin,
22+
PinName tc_th_pin)
23+
: MAX31855Class(tc_cs_pin), _tc_cs{tc_cs_pin}, _ch_sel0{ch_sel0_pin}, _ch_sel1{ch_sel1_pin}, _ch_sel2{ch_sel2_pin}, _tc_th{tc_th_pin}
2324
{ }
2425

2526
TCTempProbeClass::~TCTempProbeClass()
@@ -31,6 +32,7 @@ bool TCTempProbeClass::begin() {
3132
pinMode(_ch_sel0, OUTPUT);
3233
pinMode(_ch_sel1, OUTPUT);
3334
pinMode(_ch_sel2, OUTPUT);
35+
pinMode(_tc_th, OUTPUT);
3436

3537
pinMode(_tc_cs, OUTPUT);
3638

@@ -92,10 +94,12 @@ void TCTempProbeClass::end() {
9294

9395
void TCTempProbeClass::_enable() {
9496
digitalWrite(_tc_cs, LOW);
97+
digitalWrite(_tc_th, LOW);
9598
}
9699

97100
void TCTempProbeClass::_disable() {
98101
digitalWrite(_tc_cs, HIGH);
102+
digitalWrite(_tc_th, HIGH);
99103
}
100104

101105
TCTempProbeClass MachineControl_TCTempProbe;

src/TCTempProbeClass.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class TCTempProbeClass: public MAX31855Class {
4141
TCTempProbeClass(PinName tc_cs_pin = MC_TC_CS_PIN,
4242
PinName ch_sel0_pin = MC_TC_SEL0_PIN,
4343
PinName ch_sel1_pin = MC_TC_SEL1_PIN,
44-
PinName ch_sel2_pin = MC_TC_SEL2_PIN);
44+
PinName ch_sel2_pin = MC_TC_SEL2_PIN,
45+
PinName tc_th_pin = MC_TC_TH_PIN);
4546

4647
/**
4748
* @brief Destruct the TCTempProbeClass object.
@@ -74,6 +75,7 @@ class TCTempProbeClass: public MAX31855Class {
7475
PinName _ch_sel0; // Pin for the first channel selection bit
7576
PinName _ch_sel1; // Pin for the second channel selection bit
7677
PinName _ch_sel2; // Pin for the third channel selection bit
78+
PinName _tc_th; // Pin for the TC/RTD connection
7779

7880
/**
7981
* @brief Enable the chip select (CS) of the MAX31855 digital converter.

src/pins_mc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
#define MC_TC_SEL0_PIN MC_RTD_SEL0_PIN
8585
#define MC_TC_SEL1_PIN MC_RTD_SEL1_PIN
8686
#define MC_TC_SEL2_PIN MC_RTD_SEL2_PIN
87+
#define MC_TC_TH_PIN MC_RTD_TH_PIN
8788

8889
/* USB */
8990
#define MC_USB_PWR_PIN PB_14

0 commit comments

Comments
 (0)