If I had to do it again, I would decompose the whole thing into a string of binary bits before dealing with it, as I didn’t realize beforehand just how many of the fields are not nibble aligned making working in hex on the original string moot! I won’t guarantee it, of course, so use at your own risk, although seeing as it’s the second Javascript attempt, I’m happy that I at least got something to work! Everything is ugly and hand-coded, as is my nature. I’m not proud of the code, but it seems to work. Interestingly, I pored over datasheets for hour s and drew out bit definitions for the data in order to develop a Javascript based decoder for the CSD data one can get from cat /sys/block/mmcblk1/device/csd on a Chromebook.Īs I started coding before I had finished parsing the whole datasheets – I came up with a very messy and sub-optimal solution. As a followup to yesterday’s post of collecting and decoding the Card Identification Register data from various SD cards, I couldn’t resist the challenge to try and decipher the Card Specific Data Register (CSD).
0 Comments
Leave a Reply. |