Skip to content

Commit

Permalink
Refactor GPIO pin references for sleep and wake indicators in Wi-Fi h…
Browse files Browse the repository at this point in the history
…ost interface
  • Loading branch information
rosahay-silabs committed Dec 7, 2024
1 parent 1dfd4bd commit cfafeab
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/platform/silabs/wifi/rs911x/platform/efx32_ncp_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
#include "sl_constants.h"
#include "sl_rsi_utility.h"
#include "sl_si91x_host_interface.h"
#include "sl_si91x_status.h"
#include "sl_si91x_ncp_utility.h"
#include "sl_si91x_status.h"
#include "sl_spidrv_exp_config.h"
#include "sl_spidrv_instances.h"
#include "sl_status.h"
#include "sl_wifi_constants.h"
#include "spidrv.h"
#include <platform/silabs/wifi/wf200/platform/spi_multiplex.h>
#include <stdbool.h>
#include <string.h>
#include "sl_spidrv_exp_config.h"
#include "sl_spidrv_instances.h"
#include "spidrv.h"

#if defined(SL_CATLOG_POWER_MANAGER_PRESENT)
#include "sl_power_manager.h"
Expand All @@ -45,15 +45,14 @@
#include "sl_board_control.h"
#endif // SL_BOARD_NAME


#define LDMA_MAX_TRANSFER_LENGTH 4096
#define LDMA_DESCRIPTOR_ARRAY_LENGTH (LDMA_MAX_TRANSFER_LENGTH / 2048)
#define SPI_HANDLE sl_spidrv_exp_handle
#define MAX_DATA_PACKET_SIZE 1800

// use SPI handle for EXP header (configured in project settings)
extern SPIDRV_Handle_t sl_spidrv_exp_handle;
static uint8_t dummy_buffer[MAX_DATA_PACKET_SIZE] = { 0 };
static uint8_t dummy_buffer[MAX_DATA_PACKET_SIZE] = { 0 };
static sl_si91x_host_init_configuration init_config = { 0 };

uint32_t rx_ldma_channel;
Expand Down Expand Up @@ -148,12 +147,12 @@ Ecode_t si91x_SPIDRV_MTransfer(SPIDRV_Handle_t handle, const void * txBuffer, vo

void sl_si91x_host_set_sleep_indicator(void)
{
GPIO_PinOutSet(SLEEP_CONFIRM_PIN.port, SLEEP_CONFIRM_PIN.pin);
GPIO_PinOutSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin);
}

void sl_si91x_host_clear_sleep_indicator(void)
{
GPIO_PinOutClear(SLEEP_CONFIRM_PIN.port, SLEEP_CONFIRM_PIN.pin);
GPIO_PinOutClear(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin);
}

uint32_t sl_si91x_host_get_wake_indicator(void)
Expand Down Expand Up @@ -198,7 +197,7 @@ sl_status_t sl_si91x_host_init(const sl_si91x_host_init_configuration * config)
GPIO_PinModeSet(RESET_PIN.port, RESET_PIN.pin, gpioModePushPull, 0);

// Configure interrupt, sleep and wake confirmation pins
GPIO_PinModeSet(SLEEP_CONFIRM_PIN.port, SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1);
GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1);
GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeWiredOrPullDown, 0);

return SL_STATUS_OK;
Expand Down

0 comments on commit cfafeab

Please sign in to comment.