/* * Copyright (C) 2012 Realtek Semiconductor Corp. * All Rights Reserved. * * This program is the proprietary software of Realtek Semiconductor * Corporation and/or its licensors, and only be used, duplicated, * modified or distributed under the authorized license from Realtek. * * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. * * $Revision: 39101 $ * $Date: 2013-05-03 17:35:27 +0800 (Fri, 03 May 2013) $ * * Purpose : Definition those public LED APIs and its data type in the SDK. * * Feature : The file have include the following module and sub-modules * (1) LED parameter settings */ #ifndef __DAL_APOLLO_LED_H__ #define __DAL_APOLLO_LED_H__ /* * Include Files */ #include /* * Symbol Definition */ /* * Data Declaration */ /* * Function Declaration */ /* Function Name: * dal_apollo_led_init * Description: * Initialize led module. * Input: * None * Output: * None * Return: * RT_ERR_OK * RT_ERR_FAILED * Note: * Must initialize led module before calling any led APIs. */ extern int32 dal_apollo_led_init(void); /* Function Name: * rtk_led_operation_set * Description: * Get Led operation mode * Input: * None * Output: * pMode - LED operation mode. * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * The API can set Led operation mode. * The modes that can be set are as following: * - LED_OP_PARALLEL 17 led * - LED_OP_SERIAL 32 led */ extern int32 dal_apollo_led_operation_get(rtk_led_operation_t *pMode); /* Function Name: * dal_apollo_led_operation_set * Description: * Set Led operation mode * Input: * mode - LED operation mode. * Output: * None * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * The API can set Led operation mode. * The modes that can be set are as following: * - LED_OP_PARALLEL 17 led * - LED_OP_SERIAL 32 led */ extern int32 dal_apollo_led_operation_set(rtk_led_operation_t mode); /* Function Name: * dal_apollo_led_serialMode_set * Description: * Set Led serial mode active congiuration * Input: * None * Output: * pActive - high low active mode. * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * The API can set LED serial mode active congiuration. */ extern int32 dal_apollo_led_serialMode_get(rtk_led_active_t *pActive); /* Function Name: * dal_apollo_led_serialMode_set * Description: * Set Led serial mode active congiuration * Input: * active - high low active mode. * Output: * None * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * The API can set LED serial mode active congiuration. */ extern int32 dal_apollo_led_serialMode_set(rtk_led_active_t active); /* Function Name: * dal_apollo_led_blinkRate_get * Description: * Get LED blinking rate at mode 0 to mode 3 * Input: * group - led blinking group * Output: * pBlinkRate - blinking rate. * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * There are 8 types of LED blinking rates at 32ms, 48ms, 64ms, 96ms, 128ms, 256ms, 512ms, and 1024ms. */ extern int32 dal_apollo_led_blinkRate_get(rtk_led_blinkGroup_t group, rtk_led_blink_rate_t *pBlinkRate); /* Function Name: * dal_apollo_led_blinkRate_set * Description: * Get LED blinking rate * Input: * group - led blinking group * blinkRate - blinking rate. * Output: * None * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * There are 8 types of LED blinking rates at 32ms, 48ms, 64ms, 96ms, 128ms, 256ms, 512ms, and 1024ms. */ extern int32 dal_apollo_led_blinkRate_set(rtk_led_blinkGroup_t group, rtk_led_blink_rate_t blinkRate); /* Function Name: * dal_apollo_led_groupConfig_set * Description: * Set per group Led to congiuration mode * Input: * ledIdx - LED index id. * type - LED type * pConfig - LED configuration * Output: * None * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: */ extern int32 dal_apollo_led_config_set(uint32 ledIdx, rtk_led_type_t type, rtk_led_config_t *pConfig); /* Function Name: * dal_apollo_led_groupConfig_set * Description: * Set per group Led to congiuration mode * Input: * ledIdx - LED index id. * Output: * pType - LED type * pConfig - LED configuration * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: */ extern int32 dal_apollo_led_config_get(uint32 ledIdx, rtk_led_type_t *pType, rtk_led_config_t *pConfig); /* Function Name: * dal_apollo_led_modeForce_get * Description: * Get Led group to congiuration force mode * Input: * ledIdx - LED index id. * Output: * pMode - LED force mode. * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * The API can get forced Led group mode. * The force modes that can be set are as following: * - LED_FORCE_NORMAL, * - LED_FORCE_BLINK, * - LED_FORCE_OFF, * - LED_FORCE_ON. * For LED_OP_SERIAL the max led index is 31 * For LED_OP_PARALLEL the max led index is 16 */ extern int32 dal_apollo_led_modeForce_get(uint32 ledIdx, rtk_led_force_mode_t *pMode); /* Function Name: * dal_apollo_led_modeForce_set * Description: * Set Led group to congiuration force mode * Input: * ledIdx - LED index id. * mode - LED force mode. * Output: * None * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: * The API can get forced Led group mode. * The force modes that can be set are as following: * - LED_FORCE_NORMAL, * - LED_FORCE_BLINK, * - LED_FORCE_OFF, * - LED_FORCE_ON. * For LED_OP_SERIAL the max led index is 31 * For LED_OP_PARALLEL the max led index is 16 */ extern int32 dal_apollo_led_modeForce_set(uint32 ledIdx, rtk_led_force_mode_t mode); /* Function Name: * dal_apollo_led_parallelEnable_get * Description: * Get Led group enable status for parallel mode * Input: * ledIdx - LED index id. * Output: * pState - LED parallel enable status. * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: */ extern int32 dal_apollo_led_parallelEnable_get(uint32 ledIdx, rtk_enable_t *pState); /* Function Name: * dal_apollo_led_parallelEnable_set * Description: * Set Led group enable status for parallel mode * Input: * ledIdx - LED index id. * state - LED parallel enable status. * Output: * None * Return: * RT_ERR_OK - OK * RT_ERR_FAILED - Failed * RT_ERR_INPUT - Invalid input parameters. * Note: */ extern int32 dal_apollo_led_parallelEnable_set(uint32 ledIdx, rtk_enable_t state); #endif /* __DAL_APOLLO_LED_H__ */