Class TCustomPortSPI
Unit
PXL.Boards.Types
Declaration
type TCustomPortSPI = class abstract(TCustomDataPort)
Description
Abstract SPI (Serial Peripheral Interface) communication manager.
Hierarchy
Overview
Fields
Methods
 |
constructor Create(const AChipSelectMode: TChipSelectMode = TChipSelectMode.ActiveLow); |
 |
function Read(const Buffer: Pointer; const BufferSize: Cardinal): Cardinal; override; |
 |
function Transfer(const Buffer: Pointer; const BufferSize: Cardinal): Cardinal; overload; inline; |
 |
function Transfer(const ReadBuffer, WriteBuffer: Pointer; const BufferSize: Cardinal): Cardinal; overload; virtual; abstract; |
 |
function Write(const Buffer: Pointer; const BufferSize: Cardinal): Cardinal; override; |
 |
function GetBitsPerWord: TBitsPerWord; virtual; abstract; |
 |
function GetFrequency: Cardinal; virtual; abstract; |
 |
function GetMode: TSPIMode; virtual; abstract; |
 |
procedure SetBitsPerWord(const Value: TBitsPerWord); virtual; abstract; |
 |
procedure SetFrequency(const Value: Cardinal); virtual; abstract; |
 |
procedure SetMode(const Value: TSPIMode); virtual; abstract; |
Properties
Description
Fields
Methods
 |
constructor Create(const AChipSelectMode: TChipSelectMode = TChipSelectMode.ActiveLow); |
|
Creates instance of SPI port with the specified Chip Select (CS) mode.
|
 |
function Read(const Buffer: Pointer; const BufferSize: Cardinal): Cardinal; override; |
|
Reads specified number of bytes to buffer and returns actual number of bytes read.
|
 |
function Transfer(const Buffer: Pointer; const BufferSize: Cardinal): Cardinal; overload; inline; |
|
Transfers data through SPI port asynchronously - that is, reading and writing at the same time.
Parameters
- Buffer
- Pointer to data buffer where the data will be read from and at the same time written to, overwriting its contents.
- BufferSize
- The size of buffer in bytes.
Returns
Number of bytes that were actually transferred. |
 |
function Transfer(const ReadBuffer, WriteBuffer: Pointer; const BufferSize: Cardinal): Cardinal; overload; virtual; abstract; |
|
Transfers data through SPI port asynchronously - that is, reading and writing at the same time.
Parameters
- ReadBuffer
- Pointer to data buffer where the data will be read from. If this parameter is set to
Nil, then no reading will be done.
- WriteBuffer
- Pointer to data buffer where the data will be written to. If this parameter is set to
Nil, then no writing will be done.
- BufferSize
- The size of read and write buffers in bytes.
Returns
Number of bytes that were actually transferred. |
 |
function Write(const Buffer: Pointer; const BufferSize: Cardinal): Cardinal; override; |
|
Writes specified number of bytes from buffer and returns actual number of bytes written.
|
 |
function GetBitsPerWord: TBitsPerWord; virtual; abstract; |
|
Returns current number of bits that each word occupies.
|
 |
function GetFrequency: Cardinal; virtual; abstract; |
|
Returns current operating frequency.
|
 |
function GetMode: TSPIMode; virtual; abstract; |
|
Returns currently active SPI mode.
|
 |
procedure SetBitsPerWord(const Value: TBitsPerWord); virtual; abstract; |
|
Changes current number of bits each word occupies.
|
 |
procedure SetFrequency(const Value: Cardinal); virtual; abstract; |
|
Changes current operating frequency.
|
 |
procedure SetMode(const Value: TSPIMode); virtual; abstract; |
|
Changes current SPI mode to the specified value.
|
Properties
 |
property Mode: TSPIMode read GetMode write SetMode; |
|
Mode of SPI operation, including Clock Polarity (CPOL) and Clock Edge (CPCHA). The actual meaning of this parameter depends on implementation and should be consulted from corresponding documentation.
|
Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.
|