#include <nitro/spi.h>
u32 PM_GetLEDPattern( PMLEDPattern* patternBuf );
u32 PM_GetLEDPatternAsync( PMLEDStatus* patternBuf, PMCallback callback, void* arg );
patternBuf |
The buffer that stores the value of the LED pattern to be obtained. |
callback |
The callback that is called when the command finishes. |
arg |
The argument that is used when calling the callback. |
The PM_RESULT_SUCCESS
return value indicates that that the execution of the command has succeeded (for synchronous 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.
This function gets the LED state of the console.
patternBuf is a buffer that stores the PMLEDPattern
list type values. It takes a value that indicates the state of the LED when it is not NULL. It will take one of the following values:
PM_LED_PATTERN_ON |
The LED is illuminated. |
PM_LED_PATTERN_BLINK_LOW |
The LED is blinking at a high speed. |
PM_LED_PATTERN_BLINK_HIGH |
The LED is blinking at a low speed. |
PM_LED_PATTERN_BLINK1 |
The LED is repeating a lit/unlit pattern every 1 frame. |
PM_LED_PATTERN_BLINK2 |
The LED is repeating a lit/unlit pattern every 2 frames. |
PM_LED_PATTERN_BLINK3 |
The LED is repeating a lit/unlit pattern every 3 frames. |
PM_LED_PATTERN_BLINK4 |
The LED is repeating a lit/unlit pattern every 4 frames. |
PM_LED_PATTERN_BLINK5 |
The LED is repeating a lit/unlit pattern every 5 frames. |
PM_LED_PATTERN_BLINK6 |
The LED is repeating a lit/unlit pattern every 8 frames. |
PM_LED_PATTERN_BLINK8 |
The LED is repeating a lit/unlit pattern every 8 frames. |
PM_LED_PATTERN_BLINK10 |
The LED is repeating a lit/unlit pattern every 10 frames. |
PM_LED_PATTERN_PATTERN1 |
The LED is blinking in a predetermined pattern. |
PM_LED_PATTERN_PATTERN2 |
The LED is blinking in a predetermined pattern. |
PM_LED_PATTERN_PATTERN3 |
The LED is blinking in a predetermined pattern. |
The "high speed blink" and "low speed blink" are blink features that are implemented on the hardware. Although the term "high speed" is used, the blinking speed is actually slower than the blinking speed that is caused by the software that repeats the lit/unlit pattern in a fixed number of frames.)
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 processing on the ARM7 side finishes. The callback type PMCallback
is defined by:
typedef void ( *PMCallback )( u32 result, void* arg )
;
This callback is called from within the PXI interrupt handler.
The 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. Also, when you call OS_Init()
, there is no need to call PM_Init()
separately since it is called from within OS_Init()
.)
Note: If PM_RESULT_ERROR
was returned as the return value, it is usually an unrecoverable error. It might be returned when ARM7 is not ready or the variable region was destroyed. If this is returned there may be a problem in the program.
07/07/2005 Referred to the return value, PM_RESULT_ERROR
.
06/02/2005 Specified the call origin of the callback.
08/26/2004 Initial version.