|
|
@ -102,6 +102,82 @@ uint16_t chip_get_pinoff(Pin_t pin) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
const char* chip_gpio_group_get_name(GPIO_TypeDef* gpio_group) { |
|
|
|
if (gpio_group == GPIOA) { |
|
|
|
return "GPIOA"; |
|
|
|
} |
|
|
|
if (gpio_group == GPIOB) { |
|
|
|
return "GPIOB"; |
|
|
|
} |
|
|
|
if (gpio_group == GPIOC) { |
|
|
|
return "GPIOC"; |
|
|
|
} |
|
|
|
if (gpio_group == GPIOD) { |
|
|
|
return "GPIOD"; |
|
|
|
} |
|
|
|
if (gpio_group == GPIOE) { |
|
|
|
return "GPIOE"; |
|
|
|
} |
|
|
|
if (gpio_group == GPIOF) { |
|
|
|
return "GPIOF"; |
|
|
|
} |
|
|
|
if (gpio_group == GPIOG) { |
|
|
|
return "GPIOG"; |
|
|
|
} |
|
|
|
return "unknown gpio group"; |
|
|
|
} |
|
|
|
const char* chip_pinoff_get_name(uint16_t pinoff) { |
|
|
|
if (pinoff == GPIO_PIN_0) { |
|
|
|
return "0"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_1) { |
|
|
|
return "1"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_2) { |
|
|
|
return "2"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_3) { |
|
|
|
return "3"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_4) { |
|
|
|
return "4"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_5) { |
|
|
|
return "5"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_6) { |
|
|
|
return "6"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_7) { |
|
|
|
return "7"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_8) { |
|
|
|
return "8"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_9) { |
|
|
|
return "9"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_10) { |
|
|
|
return "10"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_11) { |
|
|
|
return "11"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_12) { |
|
|
|
return "12"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_13) { |
|
|
|
return "13"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_14) { |
|
|
|
return "14"; |
|
|
|
} |
|
|
|
if (pinoff == GPIO_PIN_15) { |
|
|
|
return "15"; |
|
|
|
} |
|
|
|
return "unknown pinoff"; |
|
|
|
} |
|
|
|
|
|
|
|
// // no tim1
|
|
|
|
// TIM2_IRQn
|
|
|
|
// TIM3_IRQn
|
|
|
|