sop板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
778 B

#include "bsp_led.h"
void bsp_led_init(void)
{
//初始化
LED0 = LED0_OFF;
BLED0 = BLED0_OFF;
//BLED1 = BLED2 = BLED3 = BLED4 = BLED5 = BLED6 = BLED0_OFF;
//BLED7 = BLED8 = BLED9 = BLED10 = BLED11 = BLED12 = BLED13 = BLED0_OFF;
MBI_CLK = 0;
MBI_SDI = 0;
}
void bsp_led_set(U8 status)
{
LED0 = status;
}
void bsp_bled0_set()
{
BLED0 = BLED0_ON;
}
extern void delay(unsigned int i);
void bsp_bled_set_multi(unsigned int dat)
{
unsigned char i;
//其他led通过芯片驱动
for(i=0; i<16; i++)
{
MBI_SDI = (dat & 0x8000) ? 1 : 0;
MBI_CLK = 1;
dat <<= 1;
MBI_CLK = 0;
}
//锁存
MBI_LE = 1;
delay(100);
MBI_LE = 0;
//输出
delay(1000);
MBI_OE = 0;
}
void delay(unsigned int i)
{
while(i>0)
i--;
}