📄 custom_led_patterns.c
字号:
const LED_PATTERN_STRUCT *led_gpio_patterns[] =
{
led_gpio_ptn1,
led_gpio_ptn2,
led_gpio_ptn3,
led_gpio_ptn4,
led_gpio_ptn5,
led_gpio_ptn6,
led_gpio_ptn7,
led_gpio_ptn8,
led_gpio_ptn9,
led_gpio_ptn10,
led_gpio_ptn11,
led_gpio_ptn12,
led_gpio_ptn13,
led_gpio_ptn14,
led_gpio_ptn15,
led_gpio_ptn16,
led_gpio_ptn17,
led_gpio_ptn18,
led_gpio_ptn19,
led_gpio_ptn20
};
/*
* LCD pattern
*/
#define LCD_LEVEL_0 0
#define LCD_LEVEL_1 1
const LCD_PATTERN_STRUCT lcd_gpio_ptn1[] =
{
/* lcd, duration time */
{{LCD_LEVEL_1}, 1000},
{{LCD_LEVEL_0}, 1000}, /* duration timer is zero to terminate it */
{{LCD_LEVEL_0}, 0} /* duration timer is zero to terminate it */
};
const LCD_PATTERN_STRUCT lcd_gpio_ptn2[] =
{
/* lcd, duration time */
{{LCD_LEVEL_1}, 0} /* duration timer is zero to terminate it */
};
const LCD_PATTERN_STRUCT *lcd_gpio_patterns[] =
{
lcd_gpio_ptn1,
lcd_gpio_ptn2
};
/*
* VIB pattern
*/
#define VIB_LEVEL_0 0
#define VIB_LEVEL_1 1
const VIB_PATTERN_STRUCT vib_gpio_ptn1[] =
{
/* vib, duration time */
{{VIB_LEVEL_1}, 1000},
{{VIB_LEVEL_0}, 1000},
{{VIB_LEVEL_0}, 0} /* duration timer is zero to terminate it */
};
const VIB_PATTERN_STRUCT vib_gpio_ptn2[] =
{
/* vib duration time */
{{VIB_LEVEL_1}, 0} /* duration timer is zero to terminate it */
};
const VIB_PATTERN_STRUCT vib_gpio_ptn3[] =
{
/* Incomming SMS */
{{VIB_LEVEL_1}, 500}, /* duration timer is zero to terminate it */
{{VIB_LEVEL_0}, 500}, /* duration timer is zero to terminate it */
{{VIB_LEVEL_1}, 500}, /* duration timer is zero to terminate it */
{{VIB_LEVEL_0}, 1500}, /* duration timer is zero to terminate it */
{{VIB_LEVEL_1}, 500}, /* duration timer is zero to terminate it */
{{VIB_LEVEL_0}, 500}, /* duration timer is zero to terminate it */
{{VIB_LEVEL_1}, 500}, /* duration timer is zero to terminate it */
{{VIB_LEVEL_0}, 0} /* duration timer is zero to terminate it */
};
const VIB_PATTERN_STRUCT *vib_gpio_patterns[] =
{
vib_gpio_ptn1,
vib_gpio_ptn2,
vib_gpio_ptn3
};
/*****************************************************************************
* FUNCTION
* custom_get_led_patterns
* DESCRIPTION
*
* PARAMETERS
* led_pattern_id [IN]
* RETURNS
*
*****************************************************************************/
const LED_PATTERN_STRUCT *custom_get_led_patterns(PATTERN_ID led_pattern_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* out of pattern number */
if (led_pattern_id - LED_PATTERN_BEGIN > (sizeof(led_gpio_patterns) / sizeof(led_gpio_patterns[0])))
{
ASSERT(0);
}
/* based index from 0 */
return (led_gpio_patterns[led_pattern_id - LED_PATTERN_BEGIN]);
}
/*****************************************************************************
* FUNCTION
* custom_get_lcd_patterns
* DESCRIPTION
*
* PARAMETERS
* lcd_pattern_id [IN]
* RETURNS
*
*****************************************************************************/
const LCD_PATTERN_STRUCT *custom_get_lcd_patterns(PATTERN_ID lcd_pattern_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* out of pattern number */
if (lcd_pattern_id - LCD_PATTERN_BEGIN > (sizeof(lcd_gpio_patterns) / sizeof(lcd_gpio_patterns[0])))
{
ASSERT(0);
}
/* based index from 0 */
return (lcd_gpio_patterns[lcd_pattern_id - LCD_PATTERN_BEGIN]);
}
/*****************************************************************************
* FUNCTION
* custom_get_vib_patterns
* DESCRIPTION
*
* PARAMETERS
* vib_pattern_id [IN]
* RETURNS
*
*****************************************************************************/
const VIB_PATTERN_STRUCT *custom_get_vib_patterns(PATTERN_ID vib_pattern_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* out of pattern number */
if (vib_pattern_id - VIB_PATTERN_BEGIN > (sizeof(vib_gpio_patterns) / sizeof(vib_gpio_patterns[0])))
{
ASSERT(0);
}
/* based index from 0 */
return (vib_gpio_patterns[vib_pattern_id - VIB_PATTERN_BEGIN]);
}
/*****************************************************************************
* FUNCTION
* custom_get_led_label
* DESCRIPTION
*
* PARAMETERS
* id [IN]
* RETURNS
*
*****************************************************************************/
const kal_uint8 custom_get_led_label(const kal_uint8 id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (id)
{
case 0:
return GPIO_DEV_LED_STATUS_1;
case 1:
return GPIO_DEV_LED_STATUS_2;
case 2:
return GPIO_DEV_LED_STATUS_3;
default:
return GPIO_DEV_LED_STATUS_1;
}
}
/*****************************************************************************
* FUNCTION
* custom_get_lcd_label
* DESCRIPTION
*
* PARAMETERS
* id [IN]
* RETURNS
*
*****************************************************************************/
const kal_uint8 custom_get_lcd_label(const kal_uint8 id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (id)
{
case 0:
return GPIO_DEV_LED_SUBLCD;
case 1:
return GPIO_DEV_LED_MAINLCD;
default:
return GPIO_DEV_LED_SUBLCD;
}
}
/*****************************************************************************
* FUNCTION
* custom_get_vib_label
* DESCRIPTION
*
* PARAMETERS
* id [IN]
* RETURNS
*
*****************************************************************************/
const kal_uint8 custom_get_vib_label(const kal_uint8 id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return GPIO_DEV_VIBRATOR;
}
#endif /* __L1_STANDALONE__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -