Odd Line of Code in SPI Overlap Example

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Odd Line of Code in SPI Overlap Example

Postby dkinzer » Fri Sep 18, 2015 12:06 am

In the hspi_overlap_init() function of spi_overlap.c there is this code:

Code: Select all

   //set higher priority for spi than hspi
   SET_PERI_REG_MASK(SPI_EXT3(SPI),0x1);
   SET_PERI_REG_MASK(SPI_EXT3(HSPI),0x3);
   SET_PERI_REG_MASK(SPI_USER(HSPI), BIT(5));

What I find odd is the setting of bit 5 of the SPI_USER register because, according to spi_register.h, bit 5 is SPI_CS_SETUP. As far as I can tell the SPI_CS_SETUP bit has nothing to do with overlap mode specifically. Is that line misplaced (being better located with code setting/clearing of other bits in the SPI_USER register) or should it be setting a different bit or be operating on a different register?
Don Kinzer
Beaverton, OR, USA

Who is online

Users browsing this forum: No registered users and 84 guests