![background image](http://html1.mh-extra.com/html/rabbit/rabbitcore-rcm3309/rabbitcore-rcm3309_user-manual_3119427045.webp)
Distributor of Digi International: Excellent Integrated System Limited
Datasheet of 20-101-1194 - MODULE RABBITCORE RCM3309 ROHS
Contact us: [email protected] Website: www.integrated-circuit.com
38
RabbitCore RCM3309/RCM3319
5.2
Dynamic C Functions
5.2.1 Digital I/O
The RCM3309/RCM3319 was designed to interface with other systems, and so there are
no drivers written specifically for the I/O. The general Dynamic C read and write functions
allow you to customize the parallel I/O to meet your specific needs. For example, use
WrPortI(PEDDR, &PEDDRShadow, 0x00);
to set all the Port E bits as inputs, or use
WrPortI(PEDDR, &PEDDRShadow, 0xFF);
to set all the Port E bits as outputs.
When using the auxiliary I/O bus on the Rabbit 3000 chip, add the line
#define PORTA_AUX_IO
// required to enable auxiliary I/O bus
to the beginning of any programs using the auxiliary I/O bus.
The sample programs in the Dynamic C
SAMPLES/RCM3300
folder provide further
examples.
5.2.2 SRAM Use
The RCM3309/RCM3319 have a battery-backed data SRAM and a program-execution
SRAM. Dynamic C provides the
protected
keyword to identify variables that are to be
placed into the battery-backed SRAM. The compiler generates code that creates a backup
copy of a protected variable before the variable is modified. If the system resets while the
protected variable is being modified, the variable's value can be restored when the system
restarts.
The sample code below shows how a protected variable is defined and how its value can
be restored.
protected nf_device nandFlash;
int main() {
...
_sysIsSoftReset(); // restore any protected variables
The
bbram
keyword may also be used instead if there is a need to store a variable in bat-
tery-backed SRAM without affecting the performance of the application program. Data
integrity is
not
assured when a reset or power failure occurs during the update process.
Additional information on
bbram
and
protected
variables is available in the
Dynamic C
User’s Manual
.
45 / 191
45 / 191