# 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
…
- 33
- 34
- 35
- 36
- 37
…
- 82
- 83

Description
This routine writes a byte of data to the UART3.
Preconditions
DRV_UART3_InitializerDefault function should have been called before calling this function. The transfer status should be
checked to see if transmitter is not full before calling this function.
Example
char myBuffer[MY_BUFFER_SIZE];
unsigned int numBytes;
// Pre-initialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
numBytes = 0;
while( numBytes < MY_BUFFER_SIZE);
{
if( !(DRV_UART3_TRANSFER_STATUS_TX_FULL & DRV_UART3_TransferStatus()) )
{
DRV_UART3_WriteByte(handle, myBuffer[numBytes++]);
}
// Do something else...
}
Parameters
Parameters Description
byte Data byte to write to the UART3
Function
void DRV_UART3_WriteByte( const uint8_t byte)
1.2.3.1.16 DRV_UART4_Peek Function
Returns the character in the read sequence at the offset provided, without extracting it
File
drv_uart4.h
Syntax
uint8_t DRV_UART4_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_UART4_InitializerDefault();
while(numBytes < readbufferLen)
{
DRV_UART4_TasksRX ( );
//Check for data at a particular place in the buffer
data = DRV_UART4_Peek(3);
if(data == 5)
{
//discard all other data if byte that is wanted is received.
//continue other operation
numBytes += DRV_UART4_Read ( readBuffer + numBytes , readbufferLen ) ;
}
else
{
1.2 UART Driver MLA - Drivers Help Driver Interface
35

- 1
- 2
…
- 33
- 34
- 35
- 36
- 37
…
- 82
- 83