I am using raspberry pi to communicate with nrf52840
My rpi is used as msater, nrf52840 is used as slave
My nrf52840 is implemented as SPI slave under zephyr OS
At present, I found that when rpi uses spi to transfer data to nrf52840, there will be a problem that the transfer is not successful
I wonder if the frequency of my nrf52840 SPI and rpi SPI is not the same
I want to ask what is the SPI default frequency of nrf52840?
I can't find how much it is.
I only see the initialization function, but there is no place to set the frequency
Fullscreen
1
nrfx_spis_init(&spis_t,&spis_config_t,spis_event_handler_t,NULL);
So I want to change the frequency of my RPi SPI
The current settings of my rpi are as follows
Fullscreen
1
2
3
spi=spidev.SpiDev()
spi.open()
spi.max_speed_hz=976000
Or how can I set the SPI slave frequency of my nrf52840 to 976000?
My nrf52840 SPI slave on Zephyr OS is set as follows
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <zephyr.h>
#include <sys/printk.h>
#include "nrfx_spis.h"
#define PIN_SCK 29
#define PIN_MOSI 31
#define PIN_MISO 30
#define PIN_CSN 28
#define SPIS_NR 0
#include <devicetree.h>
#include <drivers/gpio.h>
#define LED0_NODE DT_ALIAS(led2)
#define LED0 DT_GPIO_LABEL(LED0_NODE, gpios)
#define PIN 3
#define FLAGS DT_GPIO_FLAGS(LED0_NODE, gpios)
const struct device *led;
nrfx_spis_t spis_t = NRFX_SPIS_INSTANCE(SPIS_NR);
nrfx_spis_config_t spis_config_t = NRFX_SPIS_DEFAULT_CONFIG(PIN_SCK,PIN_MOSI,PIN_MISO,PIN_CSN);
Thank,
Po-I