MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / spi_init

Function spi_init

bsp/loongson/ls2kdev/drivers/drv_spi.c:29–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#endif
28
29static void spi_init(uint8_t spre_spr, uint8_t copl, uint8_t cpha)
30{
31 SET_SPI(SPSR, 0xc0);
32 SET_SPI(PARAM, 0x40);
33 SET_SPI(PARAM2, 0x01);
34 SET_SPI(SPER, (spre_spr & 0b00001100) >> 2);
35 SET_SPI(SPCR, 0x50 | copl << 3 | cpha << 2 | (spre_spr & 0b00000011));
36 SET_SPI(SOFTCS, 0xff);
37}
38
39rt_inline void spi_set_csn(uint8_t val)
40{

Callers 12

cmd_spi_initFunction · 0.70
configureFunction · 0.70
drv_lcd_cmdFunction · 0.50
drv_lcd_data_byteFunction · 0.50
drv_lcd_data_half_wordFunction · 0.50
drv_lcd_data_wordFunction · 0.50
drv_lcd_hw_initFunction · 0.50
drv_lcd_clearFunction · 0.50
drv_spi_configureFunction · 0.50
pico_spi_initFunction · 0.50
DEV_Module_InitFunction · 0.50
configureFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected