Lines Matching refs:handle

72 void SDSPI_close(SD_Handle handle);
73 int_fast16_t SDSPI_control(SD_Handle handle, uint_fast16_t cmd,
75 uint_fast32_t SDSPI_getNumSectors(SD_Handle handle);
76 uint_fast32_t SDSPI_getSectorSize(SD_Handle handle);
77 int_fast16_t SDSPI_initialize(SD_Handle handle);
78 void SDSPI_init(SD_Handle handle);
79 SD_Handle SDSPI_open(SD_Handle handle, SD_Params *params);
80 int_fast16_t SDSPI_read(SD_Handle handle, void *buf,
82 int_fast16_t SDSPI_write(SD_Handle handle, const void *buf,
87 static bool recvDataBlock(SPI_Handle handle, void *buf, uint32_t count);
88 static uint8_t sendCmd(SPI_Handle handle, uint8_t cmd, uint32_t arg);
89 static int_fast16_t spiTransfer(SPI_Handle handle, void *rxBuf,
91 static bool waitUntilReady(SPI_Handle handle);
92 static bool transmitDataBlock(SPI_Handle handle, void *buf, uint32_t count,
111 void SDSPI_close(SD_Handle handle) in SDSPI_close() argument
113 SDSPI_Object *object = handle->object; in SDSPI_close()
132 int_fast16_t SDSPI_control(SD_Handle handle, uint_fast16_t cmd, void *arg) in SDSPI_control() argument
140 uint_fast32_t SDSPI_getNumSectors(SD_Handle handle) in SDSPI_getNumSectors() argument
146 SDSPI_Object *object = handle->object; in SDSPI_getNumSectors()
147 SDSPI_HWAttrs const *hwAttrs = handle->hwAttrs; in SDSPI_getNumSectors()
182 uint_fast32_t SDSPI_getSectorSize(SD_Handle handle) in SDSPI_getSectorSize() argument
190 void SDSPI_init(SD_Handle handle) in SDSPI_init() argument
199 int_fast16_t SDSPI_initialize(SD_Handle handle) in SDSPI_initialize() argument
211 SDSPI_Object *object = handle->object; in SDSPI_initialize()
212 SDSPI_HWAttrs const *hwAttrs = handle->hwAttrs; in SDSPI_initialize()
378 SD_Handle SDSPI_open(SD_Handle handle, SD_Params *params) in SDSPI_open() argument
383 SDSPI_Object *object = handle->object; in SDSPI_open()
384 SDSPI_HWAttrs const *hwAttrs = handle->hwAttrs; in SDSPI_open()
423 SDSPI_close(handle); in SDSPI_open()
431 return (handle); in SDSPI_open()
437 int_fast16_t SDSPI_read(SD_Handle handle, void *buf, int_fast32_t sector, in SDSPI_read() argument
442 SDSPI_Object *object = handle->object; in SDSPI_read()
443 SDSPI_HWAttrs const *hwAttrs = handle->hwAttrs; in SDSPI_read()
502 int_fast16_t SDSPI_write(SD_Handle handle, const void *buf, in SDSPI_write() argument
506 SDSPI_Object *object = handle->object; in SDSPI_write()
507 SDSPI_HWAttrs const *hwAttrs = handle->hwAttrs; in SDSPI_write()
600 static bool recvDataBlock(SPI_Handle handle, void *buf, uint32_t count) in recvDataBlock() argument
616 status = spiTransfer(handle, &rxBuf, &txBuf, 1); in recvDataBlock()
627 if (spiTransfer(handle, buf, NULL, count) != SD_STATUS_SUCCESS) { in recvDataBlock()
632 if (spiTransfer(handle, &rxBuf, &txBuf, 2) != SD_STATUS_SUCCESS) { in recvDataBlock()
645 static uint8_t sendCmd(SPI_Handle handle, uint8_t cmd, uint32_t arg) in sendCmd() argument
652 if ((cmd != CMD0) && !waitUntilReady(handle)) { in sendCmd()
676 if (spiTransfer(handle, NULL, &txBuf, 6) != SD_STATUS_SUCCESS) { in sendCmd()
688 (spiTransfer(handle, &rxBuf, &txBuf, 1) != SD_STATUS_SUCCESS)) { in sendCmd()
695 status = spiTransfer(handle, &rxBuf, &txBuf, 1); in sendCmd()
707 static int_fast16_t spiTransfer(SPI_Handle handle, void *rxBuf, in spiTransfer() argument
716 status = (SPI_transfer(handle, &transaction)) ? in spiTransfer()
731 static bool transmitDataBlock(SPI_Handle handle, void *buf, uint32_t count, in transmitDataBlock() argument
737 if (!waitUntilReady(handle)) { in transmitDataBlock()
743 if (spiTransfer(handle, NULL, &txBuf, 1) != SD_STATUS_SUCCESS) { in transmitDataBlock()
750 if (spiTransfer(handle, NULL, buf, count) != SD_STATUS_SUCCESS) { in transmitDataBlock()
756 if (spiTransfer(handle, NULL, &txBuf, 2) != SD_STATUS_SUCCESS) { in transmitDataBlock()
761 if (spiTransfer(handle, &rxBuf, &txBuf, 1) != SD_STATUS_SUCCESS) { in transmitDataBlock()
781 static bool waitUntilReady(SPI_Handle handle) in waitUntilReady() argument
794 status = spiTransfer(handle, &rxDummy, &txDummy, 1); in waitUntilReady()