#include <nitro/spi.h>
u32 PMi_SetLED( PMLEDStatus status );
u32 PMi_SetLEDAsync( PMLEDStatus status, PMCallback callback, void* arg );
Sets the state of the unit's LED.
Caution: The LED status is determined by the guidelines. Do not use settings that are outside of the guidelines. In general, avoid changing the LED settings with this function. The PM library is automatically set by the necessary parts.
The status argument is a PMLEDStatus enumerator type value that can contain either one of the following values:
PM_LED_ON |
The LED is ON. |
PM_LED_BLINK_HIGH |
Rapid blink. |
PM_LED_BLINK_LOW |
Slow blink. |
This function uses PXI to send the command that performs the corresponding operation in the ARM7 processor. The ARM7 side that receives that command is executed by operating the PMIC. Therefore, this function may not operate promptly after you call it.
A synchronous function that waits for the operation to finish, as well as an asynchronous function that only sends command to ARM7, are provided. Use either of the functions depending on your operational requirements. (The asynchronous function has "Async" attached to the function name.)
When an asynchronous function is called, the specified callback is called when the processing is completed on the ARM7 side. The callback type PMCallback is defined as:
typedef void ( *PMCallback )( u32 result, void* arg );
result argument is the first argument in the callback. The result argument shows the results of the command as either PM_RESULT_SUCCESS or PM_RESULT_ERROR. The second argument in the callback returns the value arg.
Before you use this function, initialize the PM library by using the PM_Init() function. The PM_Init() function has to be called only once.
The OS_Init() function is called from within the PM_Init() function. If you need to call the OS_Init() function, you have to call the PM_Init() function only once. There is no need for the OS_Init() function to be called separately.
Operates the PMIC_CTL of the PMIC register.
status |
the status of the set LED |
callback |
the callback called when the command finishes |
arg |
the argument when calling the callback |
The PM_RESULT_SUCCESS return value indicates that the execution of the command has succeeded (for asynchronous functions) or that the command was successfully sent to the ARM7 processor (for asynchronous functions).
The PM_INVALID_COMMAND return value indicates that the argument that was passed is invalid.
The PM_RESULT_ERROR return value indicates that an error has occurred with the ARM7 processor.
07/31/2004 Initial version