Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
File
drv_uart1.h
Syntax
unsigned int DRV_UART1_Read(uint8_t * buffer, const unsigned int numbytes);
Returns
Number of bytes actually copied into the caller's buffer or -1 if there is an error.
Description
This routine returns the number of bytes read by the Peripheral and fills the application read buffer with the read data.
Preconditions
DRV_UART1_InitializerDefault function should have been called before calling this function
Example
char myBuffer[MY_BUFFER_SIZE];
unsigned int numBytes;
DRV_UART1_TRANSFER_STATUS status ;
// Pre-initialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
numBytes = 0;
while( numBytes < MY_BUFFER_SIZE);
{
status = DRV_UART1_TransferStatus ( ) ;
if (status & DRV_UART1_TRANSFER_STATUS_RX_FULL)
{
numBytes += DRV_UART1_Read( myBuffer + numBytes, MY_BUFFER_SIZE - numBytes ) ;
if(numBytes < readbufferLen)
{
continue;
}
else
{
break;
}
}
else
{
continue;
}
// Do something else...
}
Parameters
Parameters Description
buffer Buffer into which the data read from the UART1
numbytes Total number of bytes that need to be read from the UART1
(must be equal to or less than the size of the buffer)
Function
unsigned int DRV_UART1_Read(uint8_t *buffer, const unsigned int numbytes )
1.2.3.1.3 DRV_UART1_ReadByte Function
Reads a byte of data from the UART1
File
drv_uart1.h
1.2 UART Driver MLA - Drivers Help Driver Interface
25
Protego_Release_01_05-Related-OEM-Documentation-MLA_v2013_12_20-help_mla_driver.pdf