S i 4 0 1 0 - D K
16
Rev. 0.1
ret
; -- End of assembly
END
;
;---------------------------------------------------------------------------
;
The function is able to determine whether the device is connected to the IDE chain.
If it is not connected, then the function turns the C2 interface off. Once that is
done it is not possible to turn the C2 interface back on unless the power to the
device, or at least to the digital portion of the device, is cycled. See the
discussion below about advantages and disadvantages.
The following is an example of how to use the vLedOn() function:
/* Clear the GPIO_LED off after reset .. reset will set this bit! */
GPIO_LED = 0;
/* Set LED intensity .. acceptable values are 0 (off) or 1, 2, and 3 */
vSys_LedIntensity( 3 );
…
/* Turn the LED on at currently set intensity */
vLedOn();
…
/* Turn the LED off, keep the intensity setting */
GPIO_LED = 0;
Following are the advantages and disadvantages of this solution:
Advantages:
1. Uniform code, no need for conditional compilation, the GPIO4 and LED will function as expected under all
scenarios.
2. The user can use the
GPIO_LED=1
in the code, which will block the GPIO4. But subsequent call to
vLedOn()
will clear the blocking of the GPIO4 and it will start functioning normally again.
Disadvantages:
1. Once the LED is physically blinked then it is not possible for the IDE to connect to the part until the power is
cycled or the
vSys_Shutdown()
is called from within the application. It is up to the user to make sure that the
power is cycled.
2. If the part is programmed as the User part with the option to execute the user code after the boot automatically
without stopping, then the user application must not use the
vLedOn()
function just to blink LED without a user
input. If the application blinks the LED on its own, then the IDE will not be able to connect to the part, since the
C2 interface is disabled at the time when the LED is turned on. If the user does not use the option to execute
user code without stopping after the boot, there is not a problem since the device will load User code after the
reset and wait for further instructions, essentially waiting for the IDE to connect to it without executing the User
code.
Downloaded from
Elcodis.com
electronic components distributor