Mine
public text v1 · immutable//
// Simpad card voltage detect
// Return: 50 -> 5V; 33-> 3,3V
//
static int
detect_cardvoltage()
{
int vs_state = *SA1110_LATCH_CONTROL; // Read out latch
vs_state&=(SA1110_INLATCH_PCMCIA_VS1|SA1110_INLATCH_PCMCIA_VS2);
if(vs_state==(SA1110_INLATCH_PCMCIA_VS1|SA1110_INLATCH_PCMCIA_VS2)) {
return 50; // 5V card
} else {
return 33; // 3,3V card
}
}