之前一直用8s105k4,现在我用STM8S103f3,PB4设置为输出,但是程序无法控制,
#define DALI_TX GPIO_PIN_4
GPIOB->CR2 &= (uint8_t)(~DALI_TX); // maximum output 2Mhz
GPIOB->ODR &= (uint8_t)(~DALI_TX); /* Low level */
GPIOB->DDR |= (uint8_t)DALI_TX; /* Set Output mode */
GPIOB->CR1 |= (uint8_t)DALI_TX; /* Pull-Up or Push-Pull */
GPIOB->CR2 |= (uint8_t)DALI_TX; // maximum output 10Mhz
在main 设置IO为High GPIOB->ODR |= (uint8_t)DALI_TX;
没有反应,我奇了怪 |