Home    Prev Next    
Contents
Programming For PCI Device
Overview
Programmers Guide
Scenario
Access to PCI devices information
How to work with PCI header
Accessing PCI registers
Accessing BAR0-BAR5 areas
I/O Ports control
Single read/write operations
Data array read/write operations
Accessing Physical Memory Addresses
Memory Mapping
Additional Functions
Hardware interrupts handling at user level
Common Issues
Extended options of hardware interrupt handling
PCI Support Routines And Structures
Common Procedures
OpenRapidPci
IsRapidPciOpened
CloseRapidPci
GetHardwareConfiguration
GetPciLocation
PCI specific functions
PCI Header
GetPciHeader
SetPciHeader
ReadFromPci
WriteToPci
PCI BAR Areas
GetNumOfPciBars
GetPciBarLength
GetPciBarPhysicalAddress
GetPciBarLinearAddress
ReadPciBarByte
ReadPciBarWord
ReadPciBarLong
WritePciBarByte
WritePciBarWord
WritePciBarLong
PCI Registers
ReadPciCommandReg
WritePciCommandReg
ControlPciCommandRegBits
ReadPciStatusReg
Memory Access
MapPhysToLinear
UnmapMemory
GetMem
GetMemW
GetMemL
SetMem
SetMemW
SetMemL
Direct Port I/O
GetPortByte
GetPortWord
GetPortLong
SetPortByte
SetPortWord
SetPortLong
ReadPortBuffer
WritePortBuffer
Hardware Interrupts
UnmaskPciIrq
MaskPciIrq
GetInterruptCounter
SetMemW
Go to RapidDriver Main Page

Write two bytes (word) to the memory region. Mainly is intended for using in the Visual Basic applications where the direct manipulations with the pointers is difficult.


Language

Description

C/C++
void SetMemW ( HANDLE hPci, ULONG MappedAddress, ULONG MemOffset , USHORT wValue);
Delphi
procedure SetMemW ( hPci: THandle; MappedAddress: Longword; MemOffset: Longword; wValue: Word ); stdcall;
VB
Sub SetMemW ( ByVal hPci As Long, ByVal MappedAddress As Long, ByVal MemOffset As Long, wValue As Integer)


Parameters:
hPci - the handle returned by a successful call to OpenRapidPci ;
MappedAddress - the linear address returned by MapPhysToLinear
MemOffset - the offset value, should begin from the "0" value.
wValue - value to write

Return Value : None

Comments:
1. In general, "MappedAddress" can be any valid linear pointer to the memory. But if this pointer was received from the MapPhysToLinear function then you can access physical memory also.
2. If you want access the BAR0-BAR5 PCI areas then use a special functions set instead.

See also: MapPhysToLinear UnmapMemory GetMemGetMemWGetMemLSetMemSetMemL