void Init8LED(void) { if (!(RCC->APB2ENR & RCC_APB2ENR_IOPEEN)) { RCC->APB2ENR |= RCC_APB2ENR_IOPEEN; RCC->APB2RSTR |= RCC_APB2RSTR_IOPERST; RCC->APB2RSTR &= ~RCC_APB2RSTR_IOPERST; } GPIOE->CRH = 0x33333333; // 0011 } void Write8LED(uint8_t val) { GPIOE->ODR = (GPIOE->ODR & 0x00ff) | (val << 8); }