Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8bb4ff1

Browse files
committedMay 7, 2025·
Insert micro seconds risetime for direct register writing
1 parent 8d22e20 commit 8bb4ff1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed
 

‎src/tle94112.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,19 @@
1313

1414
using namespace tle94112;
1515

16+
/*! \brief SPI address commands */
17+
#define TLE94112_CMD_WRITE 0x80;
18+
#define TLE94112_CMD_CLEAR 0x80;
19+
1620
#define TLE94112_STATUS_INV_MASK (Tle94112::TLE_POWER_ON_RESET)
1721

22+
/*! \brief time in milliseconds to wait for chipselect signal raised */
23+
#define TLE94112_CS_RISETIME 2
24+
25+
/*! \brief micro rise time to wait for chipselect signal raised */
26+
#define TLE94112_CS_MICRO_RISETIME 250
27+
28+
1829
Tle94112::Tle94112(void)
1930
{
2031
sBus = NULL;
@@ -268,14 +279,6 @@ void Tle94112::init(void)
268279

269280
}
270281

271-
/*! \brief SPI address commands */
272-
#define TLE94112_CMD_WRITE 0x80;
273-
#define TLE94112_CMD_CLEAR 0x80;
274-
275-
#define TLE94112_STATUS_INV_MASK (Tle94112::TLE_POWER_ON_RESET)
276-
277-
/*! \brief time in milliseconds to wait for chipselect signal raised */
278-
#define TLE94112_CS_RISETIME 2
279282

280283
void Tle94112::directWriteReg(uint8_t reg, uint8_t data)
281284
{
@@ -289,7 +292,7 @@ void Tle94112::directWriteReg(uint8_t reg, uint8_t data)
289292
sBus->transfer(address, byte0);
290293
sBus->transfer(data, byte1);
291294
cs->enable();
292-
timer->delayMilli(TLE94112_CS_RISETIME);
295+
timer->delayMicro(TLE94112_CS_MICRO_RISETIME);
293296
}
294297

295298
void Tle94112::writeReg(uint8_t reg, uint8_t mask, uint8_t shift, uint8_t data)

0 commit comments

Comments
 (0)
Please sign in to comment.