CMSIS-Driver  
Peripheral Interface for Middleware and Application Code
 
Loading...
Searching...
No Matches
MCI UHS-I Signal Voltage Switch

Host-controller phases of the SD UHS-I signal-voltage switch. More...

Macros

#define ARM_MCI_VOLTAGE_SWITCH_PREPARE   (0x00UL)
 Prepare the host before voltage switch command.
 
#define ARM_MCI_VOLTAGE_SWITCH_APPLY   (0x01UL)
 Apply 1.8 V signaling after the voltage switch command.
 
#define ARM_MCI_VOLTAGE_SWITCH_CLOCK_ON   (0x02UL)
 Start or confirm SD card bus clock.
 
#define ARM_MCI_VOLTAGE_SWITCH_VERIFY   (0x03UL)
 Verify completion of the voltage switch.
 
#define ARM_MCI_VOLTAGE_SWITCH_ABORT   (0x04UL)
 Abort a prepared or incomplete voltage switch.
 
#define ARM_MCI_VOLTAGE_SWITCH_RESET   (0x05UL)
 Restore the host signaling path for card power-up.
 

Description

Host-controller phases of the SD UHS-I signal-voltage switch.

Call ARM_MCI_Control with control = ARM_MCI_UHS_VOLTAGE_SWITCH. Set arg to one of the phase codes below.

To perform a voltage switch, MCI controlling software must use this order:

  1. PREPARE.
  2. Send voltage switch command using ARM_MCI_SendCommand and wait for its completion.
  3. APPLY.
  4. Wait at least 5 ms.
  5. CLOCK_ON.
  6. Wait at least 1 ms.
  7. VERIFY.

Example:

volatile uint32_t MCI_Events;
void MCI_SignalEvent_Callback (uint32_t event) {
// Save current event
MCI_Events |= event;
}
// Switch Signaling Voltage
void mci_switch_signaling_voltage(void) {
int32_t status;
uint32_t r1 = 0U;
// Prepare host controller for signaling voltage switch
return;
}
// Clear previous events
MCI_Events = 0;
// Send voltage switch command
status = MCIdrv->SendCommand(11, 0U, ARM_MCI_RESPONSE_SHORT|ARM_MCI_RESPONSE_CRC, &r1);
if (status == ARM_DRIVER_OK) {
// Wait for event
while ((MCI_Events & ARM_MCI_EVENT_COMMAND_COMPLETE) == 0U);
// Change the signaling voltage selection from 3.3V to 1.8V
if (status == ARM_DRIVER_OK) {
// Wait for the signaling voltage to stabilize
delay_ms(5);
// Turn on the SD clock after the voltage switch
if (status == ARM_DRIVER_OK) {
// Wait for the card to release the data lines
delay_ms(1);
// Verify the voltage switch after memory card releases data lines
if (status == ARM_DRIVER_OK) {
// Voltage switch successful
return;
}
}
}
}
// Failed to switch signaling voltage, abort procedure
}
#define ARM_DRIVER_OK
Operation succeeded.
#define ARM_MCI_EVENT_COMMAND_COMPLETE
Command completed.
#define ARM_MCI_UHS_VOLTAGE_SWITCH
UHS-I signal voltage switch; arg: ARM_MCI_VOLTAGE_SWITCH_*.
#define ARM_MCI_RESPONSE_CRC
Check CRC in response.
#define ARM_MCI_RESPONSE_SHORT
Short response (48-bit)
#define ARM_MCI_VOLTAGE_SWITCH_VERIFY
Verify completion of the voltage switch.
#define ARM_MCI_VOLTAGE_SWITCH_APPLY
Apply 1.8 V signaling after the voltage switch command.
#define ARM_MCI_VOLTAGE_SWITCH_ABORT
Abort a prepared or incomplete voltage switch.
#define ARM_MCI_VOLTAGE_SWITCH_PREPARE
Prepare the host before voltage switch command.
#define ARM_MCI_VOLTAGE_SWITCH_CLOCK_ON
Start or confirm SD card bus clock.

Macro Definition Documentation

◆ ARM_MCI_VOLTAGE_SWITCH_PREPARE

#define ARM_MCI_VOLTAGE_SWITCH_PREPARE   (0x00UL)

Prepare the host before voltage switch command.

◆ ARM_MCI_VOLTAGE_SWITCH_APPLY

#define ARM_MCI_VOLTAGE_SWITCH_APPLY   (0x01UL)

Apply 1.8 V signaling after the voltage switch command.

◆ ARM_MCI_VOLTAGE_SWITCH_CLOCK_ON

#define ARM_MCI_VOLTAGE_SWITCH_CLOCK_ON   (0x02UL)

Start or confirm SD card bus clock.

◆ ARM_MCI_VOLTAGE_SWITCH_VERIFY

#define ARM_MCI_VOLTAGE_SWITCH_VERIFY   (0x03UL)

Verify completion of the voltage switch.

◆ ARM_MCI_VOLTAGE_SWITCH_ABORT

#define ARM_MCI_VOLTAGE_SWITCH_ABORT   (0x04UL)

Abort a prepared or incomplete voltage switch.

Stop the switch logic and leave the host interface electrically safe. Allow this operation after PREPARE, including after a failed phase.

◆ ARM_MCI_VOLTAGE_SWITCH_RESET

#define ARM_MCI_VOLTAGE_SWITCH_RESET   (0x05UL)

Restore the host signaling path for card power-up.

Restore the host pads, voltage selection, and switch state for 3.3 V signaling. Call while card power is removed.