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.

uart setup

extern uint8 HalUARTOpen ( uint8 port, halUARTCfg_t *config );

this is taken from Zstack sample application... here If i want call this function, how can i send parameter value likeuint8 port, halUARTCfg_t *config etc. many of the coding like above. so explain this.

  • The source code uses to initialized UART0 (P0_2/P0_3) is like in the followings:

    void initUart(halUARTCBack_t pf)
    {
      halUARTCfg_t uartConfig;
      uartConfig.configured           = TRUE;
      uartConfig.baudRate             = HAL_UART_BR_115200;
      uartConfig.flowControl          = FALSE;
      uartConfig.flowControlThreshold = 48;
      uartConfig.rx.maxBufSize        = 128;
      uartConfig.tx.maxBufSize        = 128;
      uartConfig.idleTimeout          = 6;   
      uartConfig.intEnable            = TRUE;              
      uartConfig.callBackFunc         = pf;
      HalUARTOpen (HAL_UART_PORT_0, &uartConfig);
    }