File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -169,4 +169,7 @@ uint32_t CPU_SPI_ChipSelectLineCount(uint32_t busIndex);
169169HRESULT CPU_SPI_MinClockFrequency (uint32_t busIndex , int32_t * frequency );
170170HRESULT CPU_SPI_MaxClockFrequency (uint32_t busIndex , int32_t * frequency );
171171
172+ // return the SPI hande for the SPI device (platform specific)
173+ uint32_t CPU_SPI_GetSpiHandle (uint32_t deviceHandle );
174+
172175#endif // DRIVERS_SPI_DECL_H
Original file line number Diff line number Diff line change @@ -481,3 +481,19 @@ HRESULT nanoSPI_Write_Read(
481481 readPtr,
482482 readSize);
483483}
484+
485+ //
486+ // Get the SPI handle from the device handle
487+ //
488+ uint32_t CPU_SPI_GetSpiHandle (uint32_t deviceHandle)
489+ {
490+ uint8_t spiBus;
491+ int deviceIndex;
492+
493+ if (!getDevice (deviceHandle, spiBus, deviceIndex))
494+ {
495+ return 0 ;
496+ }
497+
498+ return spiconfig[spiBus].deviceHandles [deviceIndex];
499+ }
You can’t perform that action at this time.
0 commit comments