Skip to content

spi_slave_api.c: Allow to use GPIO 32 and 33 for interface signals. #248

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ static const char TAG[] = "SPI_DRIVER";
#define GPIO_DR CONFIG_ESP_SPI_GPIO_DATA_READY


#define GPIO_MASK_DATA_READY (1 << GPIO_DR)
#define GPIO_MASK_HANDSHAKE (1 << GPIO_HS)
#define GPIO_MASK_DATA_READY (1ull << GPIO_DR)
#define GPIO_MASK_HANDSHAKE (1ull << GPIO_HS)


/* SPI internal configs */
Expand Down Expand Up @@ -227,22 +227,22 @@ static inline void spi_trans_free(spi_slave_transaction_t *trans)

static inline void set_handshake_gpio(void)
{
WRITE_PERI_REG(GPIO_OUT_W1TS_REG, GPIO_MASK_HANDSHAKE);
gpio_set_level(CONFIG_ESP_SPI_GPIO_HANDSHAKE, 1);
}

static inline void reset_handshake_gpio(void)
{
WRITE_PERI_REG(GPIO_OUT_W1TC_REG, GPIO_MASK_HANDSHAKE);
gpio_set_level(CONFIG_ESP_SPI_GPIO_HANDSHAKE, 0);
}

static inline void set_dataready_gpio(void)
{
WRITE_PERI_REG(GPIO_OUT_W1TS_REG, GPIO_MASK_DATA_READY);
gpio_set_level(CONFIG_ESP_SPI_GPIO_DATA_READY, 1);
}

static inline void reset_dataready_gpio(void)
{
WRITE_PERI_REG(GPIO_OUT_W1TC_REG, GPIO_MASK_DATA_READY);
gpio_set_level(CONFIG_ESP_SPI_GPIO_DATA_READY, 0);
}

interface_context_t *interface_insert_driver(int (*event_handler)(uint8_t val))
Expand Down