Skip to content

Commit f450bfa

Browse files
committed
src: Allow setting enable pin in constructor.
1 parent 55dc093 commit f450bfa

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/tle94112-ino.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,28 @@ Tle94112Ino::Tle94112Ino(void):Tle94112()
2525
}
2626

2727
/**
28-
* @brief constructor with individual pin assignment
28+
* @brief constructor with individual pin assignment for CS pin
2929
*
30-
* @param csPin pin number of the CS pin
30+
* @param csPin pin number of the CS (chip select) pin
3131
*/
3232
Tle94112Ino::Tle94112Ino(uint8_t csPin):Tle94112()
3333
{
3434
Tle94112::en = new GPIOIno( TLE94112_PIN_EN, OUTPUT, GPIOIno::POSITIVE );
3535
Tle94112::cs = new GPIOIno( csPin, OUTPUT, GPIOIno::POSITIVE );
3636
Tle94112::timer = new TimerIno();
3737
Tle94112::sBus = new SPICIno();
38+
}
39+
40+
/**
41+
* @brief constructor with individual pin assignment for CS and EN pin.
42+
*
43+
* @param csPin pin number of the CS (chip select) pin
44+
* @param enPin pin number of the EN (enable) pin
45+
*/
46+
Tle94112Ino::Tle94112Ino(uint8_t csPin, uint8_t enPin):Tle94112()
47+
{
48+
Tle94112::en = new GPIOIno( enPin, OUTPUT, GPIOIno::POSITIVE );
49+
Tle94112::cs = new GPIOIno( csPin, OUTPUT, GPIOIno::POSITIVE );
50+
Tle94112::timer = new TimerIno();
51+
Tle94112::sBus = new SPICIno();
3852
}

src/tle94112-ino.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Tle94112Ino: virtual public Tle94112
2626
public:
2727
Tle94112Ino(void);
2828
Tle94112Ino(uint8_t csPin);
29+
Tle94112Ino(uint8_t csPin, uint8_t enPin);
2930
};
3031
/** @} */
3132

0 commit comments

Comments
 (0)