|
void DAC_Init(void) { /* (1) Enable the peripheral clock of GPIOA */ /* (2) Select analog mode for PA4 (reset value) */ GPIOPinInitial(ZITON_COMM_TX_PORT, ZITON_COMM_TX_PIN_NUMBER, GPIO_MOD_ANALOG_FUNCTION, GPIO_NOPUPD); /* (1) Enable the peripheral clock of the DAC */ /* (2) Enable the DAC ch1 */ /* (3) disable the DAC ch1 */ RCC->APB1ENR |= RCC_APB1ENR_DACEN; /* (1) */ DAC->CR |= DAC_CR_EN1 | DAC_CR_BOFF1; /* (2) */ #if 0 DAC->CR &= ~DAC_CR_EN1; /* (3) */ #endif } |
我擦。人才。。这都能发帖出来
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
微信公众号
手机版