Access to propeller-load's config variables
DavidZemon
Posts: 2,973
Someone mentioned in another thread that I can get access to propeller-load's UART settings with three special variables: _cfg_rxpin, _cfg_txpin, and _cfg_baudrate. These have been working great for me and I'm now hoping to use that same method for connecting to my SD card, but I can't figure out what to name the variables 
I tried these, but they didn't work.
_cfg_sdspi_do
_cfg_sdspi_di
_cfg_sdspi_clk
_cfg_sdspi_cs
I tried these, but they didn't work.
_cfg_sdspi_do
_cfg_sdspi_di
_cfg_sdspi_clk
_cfg_sdspi_cs

Comments
Worthy guess, but that didn't work either.
I'm finding references to _cfg_sdspi_config1 and _cfg_sdspi_config2 though. Looks like config1 is an encoded version of three of the variables and config2 is the fourth. Knowing that it's split 3/1, I would guess CS is in config2. Now, to figure out how to return them.
extern int _cfg_sdspi_config1; extern int _cfg_sdspi_config2; void unpack_sd_pins (uint32_t pins[]) { __asm__ volatile ( " brw #skipVars \n\t" " .compress off \n" "__cfg_sdspi_config1 \n\t" " nop \n" "__cfg_sdspi_config2 \n\t" " nop \n\t" " .compress default \n" "skipVars: \n\t" ); pins[0] = (uint32_t) (1 << ((_cfg_sdspi_config1 & BYTE_2) >> 16)); pins[1] = (uint32_t) (1 << ((_cfg_sdspi_config1 & BYTE_3) >> 24)); pins[2] = (uint32_t) (1 << ((_cfg_sdspi_config1 & BYTE_1) >> 8)); pins[3] = (uint32_t) (1 << ((_cfg_sdspi_config2 & BYTE_3) >> 24)); }Now I have a no-arg constructor in my SD class