
PK2300
86
s
Software Reference
PWM Advanced Programming Functions
void dmapwmSetBuf
(
char *pBufStart,
char bufLength256,
unsigned step
,
char outChar
)
Formats part of the waveform pattern buffer for DMA-driven PWM.
PARAMETERS:
pBufStart
points to the first byte to be formatted.
Note that
pBufStart
does not always have to point to a 256-byte
aligned address.
bufLength256
is the length of the buffer, including the overflow area.
step
is the number of bytes to skip between outputting
outChar
.
outChar
is the actual bytes to send to the I/O address.
The following sample programs in the Dynamic C
SAMPLES\PK23XX
subdirectory provide more detailed
examples.
DMAPWM1.C
DMAPWM2.C
DMAPWM3.C
$
void dmapwmSwBuf( unsigned newBuf256
)
In order to facilitate all-or-none duty-cycle transitions, you should use
two buffers. While one buffer is being used by the DMA mechanism to
generate the PWM output, modify the other buffer for the new PWM
pattern. When the new buffer is ready, this function should be called to
switch to use the buffer at the address pointed to by
newBuf256
in
256-byte units.
char *dmapwmBufBeg( char *bufPtr )
The buffer used by the PWM mechanism starts at 256-byte boundaries.
Normal data definition declarations such as
char buffer[0x2000]
start at byte boundaries.
RETURN VALUE: a character pointer that points to the first 256-byte
aligned root address larger than or equal to the parameter
bufPtr
.
Summary of Contents for PK2300
Page 1: ...User s Manual Revision E PK2300 C Programmable Controller ...
Page 10: ...PK2300 x s About This Manual Blank ...
Page 24: ...PK2300 24 s Getting Started Blank ...
Page 88: ...PK2300 88 s Software Reference Blank ...
Page 106: ...106 s Serial Interface Board 2 PK2300 Blank ...
Page 114: ...PK2300 114 s Power Management Blank ...
Page 128: ...PK2300 128 s I O Map and Interrupt Vectors Blank ...
Page 132: ...PK2300 132 s Battery Blank ...
Page 138: ...PK2500 138 s Index Blank ...