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.

[参考译文] MSPM0L2228:幻数 0xA5 的含义是什么???

Guru**** 2805425 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1625789/mspm0l2228-what-is-the-meaning-of-the-magic-number-0xa5

器件型号: MSPM0L2228

您好、  

 

我查看了您的源代码“BankSWAP_G3519_GPIO_INPUT_CAPTURE_v2_SW_Version33_CRC32",“,并、并注意到它会检查0xA5如下所示的值。

 

您能否解释一下值 0xA5 代表的含义?

 

void UART_0_INST_IRQHandler(void)
{
    static uint32_t Payload_CNT, Rx_CNT;
    static uint8_t CRC_CNT;

    switch (DL_UART_Main_getPendingInterrupt(UART_0_INST)) {
    case DL_UART_MAIN_IIDX_RX:
        ch = DL_UART_Main_receiveData(UART_0_INST);

        switch (gUART_Stage) {
            case RX_WAIT_START:
                if (ch == 0xA5) {
                    if (++gMarkerCnt == 10) {
                        gMarkerCnt = 0; 
                        gUART_Stage = RX_WAIT_LEN0; 
                        }
                } else {

 

此致、  

Susumu

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Susumu:

    您能告诉我您从哪里获得示例代码吗?

    它看起来像 0xA5 是定义的通信协议的一部分、是一个用于指示通信帧开始的起始字节、并且该字节定义应与向 MSPM0 发送数据的控制器对齐。