主题:SysConfig 中讨论的其他器件
工具/软件:
大家好、我正在实现 SPI 单从器件、现在我想知道是否在轮询模式下使用了芯片选择(CS)。 据我所知、 当我断开 CS 时、一切都仍然正常(因此我怀疑它未使用)。
我的问题是:
CS 是否用于轮询模式?
回调中断模式是否可以根据 CS 进行轮询?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:
大家好、我正在实现 SPI 单从器件、现在我想知道是否在轮询模式下使用了芯片选择(CS)。 据我所知、 当我断开 CS 时、一切都仍然正常(因此我怀疑它未使用)。
我的问题是:
CS 是否用于轮询模式?
回调中断模式是否可以根据 CS 进行轮询?
您好、
请查看软件代码以及 SysConfig 配置、将 MCSPI 配置为从器件: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1305146/sk-am64b-r5f-spi-dma-in-mcspi_ms_mode_peripheral/5064289#5064289
此致、
Vaibhav
这是生成的代码。 请注意、我没有需要解决的问题。 我只是想知道驱动程序是如何处理芯片选择的、所以我以后不会感到惊讶。
/*
* MCSPI
*/
/* MCSPI Driver handles */
MCSPI_Handle gMcspiHandle[CONFIG_MCSPI_NUM_INSTANCES];
/* MCSPI Driver Open Parameters */
MCSPI_OpenParams gMcspiOpenParams[CONFIG_MCSPI_NUM_INSTANCES] =
{
{
.transferMode = MCSPI_TRANSFER_MODE_BLOCKING,
.transferTimeout = SystemP_WAIT_FOREVER,
.transferCallbackFxn = NULL,
.msMode = MCSPI_MS_MODE_PERIPHERAL,
.mcspiDmaIndex = -1,
},
};
/* MCSPI Driver Channel Configurations */
MCSPI_ChConfig gConfigMcspi0ChCfg[CONFIG_MCSPI0_NUM_CH] =
{
{
.chNum = MCSPI_CHANNEL_0,
.frameFormat = MCSPI_FF_POL0_PHA1,
.bitRate = 50000000,
.csPolarity = MCSPI_CS_POL_LOW,
.trMode = MCSPI_TR_MODE_TX_RX,
.inputSelect = MCSPI_IS_D1,
.dpe0 = MCSPI_DPE_ENABLE,
.dpe1 = MCSPI_DPE_DISABLE,
.slvCsSelect = MCSPI_SLV_CS_SELECT_0,
.startBitEnable = FALSE,
.startBitPolarity = MCSPI_SB_POL_LOW,
.csIdleTime = MCSPI_TCS0_0_CLK,
.turboEnable = FALSE,
.defaultTxData = 0x0U,
.txFifoTrigLvl = 16U,
.rxFifoTrigLvl = 16U,
},
};
MCSPI_ChConfig *gConfigMcspiChCfg[1] =
{
gConfigMcspi0ChCfg,
};
MCSPI_DmaChConfig gMcspiDmaChConfig[1] =
{
NULL,
};
void Drivers_mcspiOpen(void)
{
uint32_t instCnt;
int32_t status = SystemP_SUCCESS;
for(instCnt = 0U; instCnt < CONFIG_MCSPI_NUM_INSTANCES; instCnt++)
{
gMcspiHandle[instCnt] = NULL; /* Init to NULL so that we can exit gracefully */
}
/* Open all instances */
for(instCnt = 0U; instCnt < CONFIG_MCSPI_NUM_INSTANCES; instCnt++)
{
gMcspiHandle[instCnt] = MCSPI_open(instCnt, &gMcspiOpenParams[instCnt]);
if(NULL == gMcspiHandle[instCnt])
{
DebugP_logError("MCSPI open failed for instance %d !!!\r\n", instCnt);
status = SystemP_FAILURE;
break;
}
}
if(SystemP_FAILURE == status)
{
Drivers_mcspiClose(); /* Exit gracefully */
}
return;
}
void Drivers_mcspiClose(void)
{
uint32_t instCnt;
/* Close all instances that are open */
for(instCnt = 0U; instCnt < CONFIG_MCSPI_NUM_INSTANCES; instCnt++)
{
if(gMcspiHandle[instCnt] != NULL)
{
MCSPI_close(gMcspiHandle[instCnt]);
gMcspiHandle[instCnt] = NULL;
}
}
return;
}尊敬的 Tobias:
在研究驱动因素后、我的理解如下。
因此、不同的组合意味着不同的事情:
总之、我认为您应该需要外部控制器的芯片选择线来控制配置为外设的 MCSPI。
请告诉我有关您的控制器的更多信息、并请检查配置的线路以及电源。
期待您的答复。