AnsweredAssumed Answered

Report Doc error for KSDKv2 LPSCI driver

Question asked by Maxime Dolberg on Jun 17, 2016
Latest reply on Jun 22, 2016 by Iva Susnova

Hello community !

 

I just want to report documentations error in KSDKv2 LPSCI drivers.

 

For the method LPSCI_ReadByte() in fsl_lpcsi.h file, the comments section explain :

 

"This function polls the RX register, waits for the RX register to be full, and reads data from the TX register."

 

But it is wrong because it read directly the register as explained below for LPSCI_ReadBlocking() method :

 

"This function reads data from the TX register directly. The upper layer must ensure that the RX register is full before calling this function."

 

So no big deal,  the comments are simply swapped and create confusion to the reader at the first time.

 

Also for LPSCI_ReadBlocking() method, this function is a blocking method and not non-blocking as show in comment documentation.

 

copy, past of fsl_lpcsi.h file :

/*! * -> error here <-  * @brief Reads the RX register using a non-blocking method. * * -> error here <-  * This function reads data from the TX register directly. The upper layer must * ensure that the RX register is full before calling this function. * * @param base LPSCI peripheral base address. * @param data Start address of the buffer to store the received data. * @param length Size of the buffer. * @retval kStatus_LPSCI_RxHardwareOverrun Receiver overrun happened while receiving data. * @retval kStatus_LPSCI_NoiseError Noise error happened while receiving data. * @retval kStatus_LPSCI_FramingError Framing error happened while receiving data. * @retval kStatus_LPSCI_ParityError Parity error happened while receiving data. * @retval kStatus_Success Successfully received all data. */ status_t LPSCI_ReadBlocking(UART0_Type *base, uint8_t *data, size_t length);

 

/*!  * @brief Reads the RX data register.  * * -> error here <-  * This function polls the RX register, waits for the RX register to be full, and  * reads data from the TX register.  *  * @param base LPSCI peripheral base address.  * @return Data read from RX data register.  */ static inline uint8_t LPSCI_ReadByte(UART0_Type *base) {     return base->D; }

 

 

 

Will be interesting to also fix this for the next update.

 

Voilà

 

Cheer,

Max

Outcomes