@@ -854,6 +854,62 @@ typedef uint8_t sk_key_t;
854
854
*/
855
855
sk_key_t os_GetCSC (void );
856
856
857
+ /**
858
+ * Perform an MSD GetMaxLUN request, either through the USB port or with an ARM coprocessor.
859
+ * @param value On input the wValue to use in the request (should be zero for usb?), on output the max logical unit number.
860
+ */
861
+ void os_MSDGetMaxLUN (uint8_t * value );
862
+
863
+ /**
864
+ * Perform an MSD mass storage reset request, either through the USB port or with an ARM coprocessor.
865
+ * @param value Affects the wValue of the request, 1 for 0x55AA, 2 for 0xAA55, otherwise 0x0000 (for usb).
866
+ */
867
+ void os_MSDReset (uint8_t value );
868
+
869
+ /**
870
+ * Performs an MSD inquiry, either through the USB port or with an ARM coprocessor.
871
+ * @param lun Logical unit number.
872
+ * @param status Returns the status of the command.
873
+ */
874
+ void os_MSDInquiry (uint8_t lun , uint8_t * status );
875
+
876
+ /**
877
+ * Performs an MSD test unit ready command, either through the USB port or with an ARM coprocessor.
878
+ * @param lun Logical unit number.
879
+ * @param status Returns the status of the command.
880
+ */
881
+ void os_MSDTestUnitReady (uint8_t lun , uint8_t * status );
882
+
883
+ /**
884
+ * Performs an MSD read capacity command, either through the USB port or with an ARM coprocessor.
885
+ * @param lun Logical unit number.
886
+ * @param data Returns the returned logical block address and block byte length.
887
+ * @return Error code, 0 for success, 5 for failed command, -5 for failed transfer.
888
+ */
889
+ int8_t os_MSDReadCapacity (uint8_t lun , uint32_t data [2 ]);
890
+
891
+ /**
892
+ * Performs an MSD read command, either through the USB port or with an ARM coprocessor.
893
+ * @param lun Logical unit number.
894
+ * @param blockCount Number of blocks to read.
895
+ * @param lba Logical block address to start reading from.
896
+ * @param blockSize Block size, obtained from os_MSDReadCapacity().
897
+ * @param buffer Buffer to read data into, should be blockCount * blockSize bytes.
898
+ * @return Error code, 0 for success, 5 for failed command, -5 for failed transfer.
899
+ */
900
+ int8_t os_MSDRead (uint8_t lun , uint8_t blockCount , uint32_t lba , uint24_t blockSize , void * buffer );
901
+
902
+ /**
903
+ * Performs an MSD write command, either through the USB port or with an ARM coprocessor.
904
+ * @param lun Logical unit number.
905
+ * @param blockCount Number of blocks to write.
906
+ * @param lba Logical block address to start writing to.
907
+ * @param blockSize Block size, obtained from os_MSDReadCapacity().
908
+ * @param buffer Buffer of data to write, should be blockCount * blockSize bytes.
909
+ * @return Error code, 0 for success, 5 for failed command, -5 for failed transfer.
910
+ */
911
+ int8_t os_MSDWrite (uint8_t lun , uint8_t blockCount , uint32_t lba , uint24_t blockSize , void * buffer );
912
+
857
913
/**
858
914
* Runs the calulator at 6 MHz
859
915
*/
0 commit comments