-
Notifications
You must be signed in to change notification settings - Fork 0
Desmakers 4585 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…Mode setting ( you can not set that different, otherwise SPI on MHB is not working)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies SPI interface constructors, streamlines TLE94112 register access patterns, and replaces hard-coded values with descriptive constants for clarity and maintainability.
- SPICIno constructors: removed unused parameters (
lsb
,mode
) and hard-coded settings ininit
- Tle94112 methods: collapsed repeated
writeReg
/readStatusReg
calls and replaced literal addresses with namedREG_*
constants - Platform definitions: updated
TLE94112_PIN_CS1
to useSS
macro
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/spic-arduino.hpp | Removed unused lsb and mode members and adjusted constructor signatures |
src/spic-arduino.cpp | Updated constructors and init() to drop lsb /mode usage, hard-coded SPI settings, and fixed doc comments |
src/tle94112.cpp | Added SPI/CS timing macros, refactored writeReg /readStatusReg calls, replaced register literals with REG_* constants, and switched delay units |
src/tle94112-platf-ino.hpp | Changed TLE94112_PIN_CS1 from 10 to SS constant |
Comments suppressed due to low confidence (3)
src/spic-arduino.cpp:28
- The
mode
parameter was removed from the constructor signature—please update or remove this outdated doc comment.
* @param mode SPI mode
src/tle94112.cpp:17
- Remove the trailing semicolon in this macro definition—
#define
should not include;
at the end.
#define TLE94112_CMD_WRITE 0x80;
src/tle94112.cpp:18
- Remove the trailing semicolon here as well. Also verify that
TLE94112_CMD_CLEAR
has the correct opcode (it currently duplicates the write command).
#define TLE94112_CMD_CLEAR 0x80;
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I deinitialize only one SPI channel not multiple
Not a lot I can judge :D But it seems to compile with all libraries 👯 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks @OlafFilies!
By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---
CONTRIBUTING.md also tells you what to expect in the PR process.
Description
This pull request introduces significant changes to the
SPICIno
andTle94112
classes, simplifying their constructors, improving code readability, and enhancing maintainability. The key updates include removing unused parameters inSPICIno
constructors, refactoring repeated code patterns inTle94112
, and replacing hard coded register addresses with named constants for clarity.Simplification of
SPICIno
constructors:lsb
andmode
parameters from all constructors inSPICIno
, as they were no longer needed. (src/spic-arduino.cpp
,src/spic-arduino.hpp
) [1] [2] [3] [4] [5]Refactoring in
Tle94112
class:writeReg
andreadStatusReg
calls by directly passing structure members, reducing redundancy and improving readability. (src/tle94112.cpp
) [1] [2] [3] [4]REG_ACT_1
,REG_ERR1
) for better maintainability and readability in initialization logic. (src/tle94112.cpp
)Minor updates:
TLE94112_PIN_CS1
macro to use theSS
constant instead of a hard coded value for better compatibility and flexibility. (src/tle94112-platf-ino.hpp
)