6 Replies Latest reply on Jun 18, 2012 8:38 PM by satoshi.ehara

    UART register/DMA mode for debug. (Input of different length).

    content.librarian

      I would like the "CyU3PDebugPrint" to be supported, and I would like to receive ASCII commands by the UART. My ASCII commands have different length.

         

      I can see that "CyU3PDebugPrint" output to UART only support DMA mode.

         

      When I select DMA mode my smallest buffer is 16 byte, and i can't find a way to get a "callback"/event before the buffer is full.

         
         

              // Now create the DMA channel required for read.

         
         

              CyU3PMemSet ((uint8_t *)&dmaConfig, 0, sizeof(dmaConfig));

         
         

              dmaConfig.size           = sizeof(RS232_rx_OutBuf);

         
         

              dmaConfig.count          = sizeof(RS232_rx_OutBuf);

         
         

              dmaConfig.prodAvailCount = 0;

         
         

              dmaConfig.dmaMode        = CY_U3P_DMA_MODE_BYTE; // CY_U3P_DMA_MODE_BUFFER;

         
         

              dmaConfig.prodHeader     = 0;

         
         

              dmaConfig.prodFooter     = 0;

         
         

              dmaConfig.consHeader     = 0;

         
         

              dmaConfig.notification   = CY_U3P_DMA_CB_XFER_CPLT |

         
         

                  CY_U3P_DMA_CB_SEND_CPLT |

         
         

                  CY_U3P_DMA_CB_RECV_CPLT |

         
         

                  CY_U3P_DMA_CB_PROD_EVENT |

         
         

                  CY_U3P_DMA_CB_CONS_EVENT |

         
         

                  CY_U3P_DMA_CB_ABORTED |

         
         

                  CY_U3P_DMA_CB_ERROR |

         
         

                  CY_U3P_DMA_CB_PROD_SUSP |

         
         

                  CY_U3P_DMA_CB_CONS_SUSP;

         
         
         

              dmaConfig.cb             = CyFxUartLpDmaCallback;

         
         

              dmaConfig.prodSckId = CY_U3P_LPP_SOCKET_UART_PROD;

         
         

              dmaConfig.consSckId = CY_U3P_CPU_SOCKET_CONS;

         
         

              apiRetStatus = CyU3PDmaChannelCreate (&glUartLpChHandle, CY_U3P_DMA_TYPE_MANUAL_IN, &dmaConfig);

         
         
         

       

         

      Poul-Erik.