blfwk::SimPeripheral Class Reference

Peripheral that operates in the simulation space. More...

`#include <SimPeripheral.h>`

Inheritance diagram for blfwk::SimPeripheral:
[legend]
Collaboration diagram for blfwk::SimPeripheral:
[legend]

## Public Member Functions

| SimPeripheral (uchar_deque_t *inStream, uchar_deque_t *outStream)
| Default Constructor.
virtual status_t | read (uint8_t *buffer, uint32_t requestedBytes, uint32_t *actualBytes, uint32_t timeoutMs)
| Read bytes. More...
virtual status_t | write (const uint8_t *buffer, uint32_t byteCount)
| Write bytes. More...

## Protected Attributes

uchar_deque_t * | m_inStream
| Writes go to this stream.
uchar_deque_t * | m_outStream
| Reads come from this stream.

## Additional Inherited Members

Public Types inherited from blfwk::Peripheral
enum | _host_peripheral_types { kHostPeripheralType_None, kHostPeripheralType_UART, kHostPeripheralType_BUSPAL_UART, kHostPeripheralType_USB_HID, kHostPeripheralType_SIM }

## Detailed Description

Peripheral that operates in the simulation space.

Simulation peripherals are connected together using the streams provided to the init() method. For example, to connect a "host" peripheral to a "device" peripheral, specify the host's output stream as the device's input stream.

## Member Function Documentation

status_t SimPeripheral::read | ( | uint8_t * | buffer,
|  | uint32_t | requestedBytes,
|  | uint32_t * | actualBytes,
|  | uint32_t | timeoutMs
| ) |  |

virtual

Read bytes.

Parameters

  buffer | Pointer to buffer.
  requestedBytes | Number of bytes to read.
  actualBytes | Number of bytes actually read.
  timeoutMs | Time in milliseconds to wait for read to complete.

Implements blfwk::Peripheral.

status_t SimPeripheral::write | ( | const uint8_t * | buffer,
|  | uint32_t | byteCount
| ) |  |

virtual

Write bytes.

Parameters

  buffer | Pointer to buffer to write
  byteCount | Number of bytes to write

Implements blfwk::Peripheral.

The documentation for this class was generated from the following files:

- SimPeripheral.h
- SimPeripheral.cpp