bios: add command returning card-detect pin status

This commit is contained in:
Gabriel Somlo 2020-10-05 14:32:06 -04:00
parent 6916674ff6
commit 026d40ffab
1 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,22 @@
#include "../command.h"
#include "../helpers.h"
/**
* Command "sdcard_detect"
*
* Detect SDcard
*
*/
#ifdef CSR_SDPHY_BASE
static void sdcard_detect_handler(int nb_params, char **params)
{
uint8_t cd = sdphy_card_detect_read();
printf("SDCard %sinserted.\n", cd ? "not " : "");
}
define_command(sdcard_detect, sdcard_detect_handler, "Detect SDCard", LITESDCARD_CMDS);
#endif
/**
* Command "sdcard_init"
*