Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

unsigned int numBytes;
numBytes = 0;
do
{
if( DRV_UART2_TRANSFER_STATUS_RX_DATA_PRESENT & DRV_UART2_TransferStatus() )
{
myBuffer[numBytes++] = DRV_UART2_ReadByte();
}
// Do something else...
} while( numBytes < MY_BUFFER_SIZE);
Function
uint8_t DRV_UART2_ReadByte( void)
1.2.3.1.9 DRV_UART2_Write Function
Returns the number of bytes written into the internal buffer
File
drv_uart2.h
Syntax
unsigned int DRV_UART2_Write(const uint8_t * buffer, const unsigned int numbytes);
Description
This API transfers the data from application buffer to internal buffer and returns the number of bytes added in that queue
Remarks
None
Preconditions
DRV_UART2_InitializerDefault function should have been called before calling this function
Example
char myBuffer[MY_BUFFER_SIZE];
unsigned int numBytes;
DRV_UART2_TRANSFER_STATUS status ;
// Pre-initialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
numBytes = 0;
while( numBytes < MY_BUFFER_SIZE);
{
status = DRV_UART2_TransferStatus ( ) ;
if (status & DRV_UART2_TRANSFER_STATUS_TX_EMPTY)
{
numBytes += DRV_UART2_Write ( myBuffer + numBytes, MY_BUFFER_SIZE - numBytes ) ;
if(numBytes < writebufferLen)
{
continue;
}
else
{
break;
}
}
else
{
continue;
}
// Do something else...
}
1.2 UART Driver MLA - Drivers Help Driver Interface
30

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh