-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Espressif SPI support #368
base: master
Are you sure you want to change the base?
Conversation
static int _is_initialized_spi = FALSE; | ||
|
||
int esp_spi_master_init() { | ||
// SPI bus & device configuration |
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.
C style comments /* */
. Please refactor all
|
||
int esp_spi_master_init() { | ||
// SPI bus & device configuration | ||
spi_bus_config_t bus_cfg = { |
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.
Please add const
if possible
|
||
// FSPI (HOST_SPI2) on esp32-s3-wroom | ||
#define PIN_NUM_MISO 13 |
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.
Consider #ifndef PIN_NUM_MISO
to allow build-time override. Same for below.
} | ||
|
||
/* Aquire SPI bus and keep pulling CS */ | ||
int tpm_spi_acquire() |
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.
static int tpm_spi_acquire(void)
|
||
static int _is_initialized_spi = FALSE; | ||
|
||
int esp_spi_master_init() { |
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.
static int esp_spi_master_init()
{
int64_t timeout_expiry; | ||
} *tpm_data; | ||
|
||
static int _is_initialized_spi = FALSE; |
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.
Do not use FALSE. Use 0
This PR is credit [David Safford] that kindly sent me a patch along with a brief description:
I've not had time to test this. I wanted to at least express my thanks to David and open this draft PR to let people know that it is in the works.