Hi,
I would like to use the SDA pin for i2c to be pin 7 for nRF52. I did the following change to my code, but it is still not working. Note that CTS pin is by default mapped to pin 7, so I remapped it to pin 10.
Any idea ? Thanks !!!
//=======================================
//Use pins 7 for SDA and 30 for SCL in main.c
const nrf_drv_twi_config_t twi_GPS_config = {
.scl = 30,
.sda = 7,
.frequency = NRF_TWI_FREQ_100K,
.interrupt_priority = APP_IRQ_PRIORITY_HIGH
};
//In pca10040.h, remap CTS to pin 10 and use in for UART in main.cpp
###\#define RX_PIN_NUMBER 8
###\#define TX_PIN_NUMBER 6
###\#define CTS_PIN_NUMBER 10
###\#define RTS_PIN_NUMBER 5
const app_uart_comm_params_t comm_params =
{
RX_PIN_NUMBER,
TX_PIN_NUMBER,
RTS_PIN_NUMBER,
CTS_PIN_NUMBER,
APP_UART_FLOW_CONTROL_DISABLED,
false,
UART_BAUDRATE_BAUDRATE_Baud115200
};
I also changes the sda, scl pin defintiion in nrf_drv_config.h (not sure if this is needed)
###\#define TWI0_CONFIG_SCL 0x1d
###\#define TWI0_CONFIG_SDA 0x07