# Vault 7: Projects

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

### Protego

# MLA -- Drivers

20 December, 2013

- 1
- 2
…
- 27
- 28
- 29
- 30
- 31
…
- 82
- 83

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_RX_FULL)
{
numBytes += DRV_UART2_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 UART2
numbytes Total number of bytes that need to be read from the UART2
(must be equal to or less than the size of the buffer)
Function
unsigned int DRV_UART2_Read(uint8_t *buffer, const unsigned int numbytes )
1.2.3.1.8 DRV_UART2_ReadByte Function
Reads a byte of data from the UART2
File
drv_uart2.h
Syntax
uint8_t DRV_UART2_ReadByte();
Returns
A data byte received by the driver.
Description
This routine reads a byte of data from the UART2.
Preconditions
DRV_UART2_InitializerDefault function should have been called before calling this function. The transfer status should be
checked to see if the receiver is not empty before calling this function.
Example
char myBuffer[MY_BUFFER_SIZE];
1.2 UART Driver MLA - Drivers Help Driver Interface
29

- 1
- 2
…
- 27
- 28
- 29
- 30
- 31
…
- 82
- 83