|
void DAC_Init(void)+ w8 v& n. g2 n {% O- I) N5 s- w6 I z /* (1) Enable the peripheral clock of GPIOA */& `9 c+ u6 x' y5 m2 M% g7 Q& Z- @9 Q* e /* (2) Select analog mode for PA4 (reset value) */ GPIOPinInitial(ZITON_COMM_TX_PORT, ZITON_COMM_TX_PIN_NUMBER, GPIO_MOD_ANALOG_FUNCTION,* O7 b4 l: J! }/ C! E GPIO_NOPUPD); /* (1) Enable the peripheral clock of the DAC */ /* (2) Enable the DAC ch1 */- z! M( Q4 b* u9 W; H /* (3) disable the DAC ch1 */0 f7 o( M# Z$ F9 S& _4 d- Q RCC->APB1ENR |= RCC_APB1ENR_DACEN; /* (1) */ DAC->CR |= DAC_CR_EN1 | DAC_CR_BOFF1; /* (2) */ #if 0 DAC->CR &= ~DAC_CR_EN1; /* (3) */ #endif } |
我擦。人才。。这都能发帖出来
|
微信公众号
手机版