Escritura de valor de datos de 32 bits SPI NXP K66

0

¿Cómo enviaría valores de datos de 32 bits utilizando SPI de K66? Aquí está mi intento. El problema es que solo algunas partes de los 32 bits se muestran en el alcance

status_t ADF4158_GenericWriteReg(pll_register_t reg, pll_params_t *params)
{
    dspi_command_data_config_t command;
    uint32_t value;

    if(reg >= kPLL_MAX)
        return kStatus_Fail;

    /* obtain formatted register value */
    value = ADF4158_GetFormattedRegValue(reg, params);

    PRINTF("Writing Register R%d with value 0x%08X\r\n", reg, value);

    /* Define Chip Select  */
    command.whichCtar = spiCtar;
    command.whichPcs = spiPcs;
    command.isPcsContinuous = true;
    command.isEndOfQueue = false;
    command.clearTransferCount = false;

    /* upper 16 bit */
    DSPI_MasterWriteDataBlocking(spiBase, &command, (uint16_t)(value >> 16U));

    /* lower 16 bit */
    command.isPcsContinuous = false;
    DSPI_MasterWriteDataBlocking(spiBase, &command, (uint16_t)(value & 0x0000FFFFU));
    ADF4158_DelayFunc();

    return kStatus_Success;
}
    
pregunta Ahmed Saleh

0 respuestas

Lea otras preguntas en las etiquetas