|
void dwEnableAllLeds(dwDevice_t* dev)
{
//*********标签使能pa/lna
uint32_t reg;
//Set all 4 GPIO in LED mode
reg = dwSpiRead32(GPIO_CTRL, GPIO_MODE_SUB);
reg &= ~0x00003FC0ul;
reg |= 0x00001540ul;
reg &= ~0x000FFFC0ul;
reg |= 0x00055540ul;//0XDE001540 || 0XDE054000
dwSpiWrite32(dev, GPIO_CTRL, GPIO_MODE_SUB, reg);
dwSpiRead32(GPIO_CTRL, GPIO_MODE_SUB);
// Enable debounce clock (used to clock the LED blinking)
reg = dwSpiRead32(PMSC, PMSC_CTRL0_SUB);
reg |= 0x00840000ul;
dwSpiWrite32(dev, PMSC, PMSC_CTRL0_SUB, reg);
// Enable LED blinking and set the rate
reg = 0x00000110ul;
dwSpiWrite32(dev, PMSC, PMSC_LEDC, reg);
// Trigger a manual blink of the LEDs for test
reg |= 0x000f0000ul;
dwSpiWrite32(dev, PMSC, PMSC_LEDC, reg);
reg &= ~0x000f0000ul;
dwSpiWrite32(dev, PMSC, PMSC_LEDC, reg);
//disable fine-grain sequencing
reg = dwSpiRead16(PMSC, PMSC_TXFSEQ);
if(reg)
{
reg = 0;
dwSpiWrite(dev, PMSC, PMSC_TXFSEQ, (uint8_t *)®, LEN_PMSC_TXFSEQ);
dwSpiRead16(PMSC, PMSC_TXFSEQ);
}
}
|
|