# 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
…
- 26
- 27
- 28
- 29
- 30
…
- 82
- 83

Function
void DRV_UART1_WriteByte( const uint8_t byte)
1.2.3.1.6 DRV_UART2_Peek Function
Returns the character in the read sequence at the offset provided, without extracting it
File
drv_uart2.h
Syntax
uint8_t DRV_UART2_Peek(uint16_t offset);
Description
This routine returns the character in the read sequence at the offset provided, without extracting it
Example
const uint8_t readBuffer[5];
unsigned int data, numBytes = 0;
unsigned int readbufferLen = sizeof(readBuffer);
DRV_UART2_InitializerDefault();
while(numBytes < readbufferLen)
{
DRV_UART2_TasksRX ( );
//Check for data at a particular place in the buffer
data = DRV_UART2_Peek(3);
if(data == 5)
{
//discard all other data if byte that is wanted is received.
//continue other operation
numBytes += DRV_UART2_Read ( readBuffer + numBytes , readbufferLen ) ;
}
else
{
break;
}
}
Function
uint8_t DRV_UART2_Peek(uint16_t offset)
1.2.3.1.7 DRV_UART2_Read Function
Returns the number of bytes read by the UART2 peripheral
File
drv_uart2.h
Syntax
unsigned int DRV_UART2_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_UART2_InitializerDefault function should have been called before calling this function
1.2 UART Driver MLA - Drivers Help Driver Interface
28

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