mirror of https://github.com/ARMmbed/mbed-os.git
Add alternative function to pinmap for STM32.
parent
40abe5fb74
commit
4718fc6e2b
|
|
@ -26,9 +26,15 @@ typedef struct {
|
|||
PinName pin;
|
||||
int peripheral;
|
||||
int function;
|
||||
#ifdef defined(TARGET_STM32F407)
|
||||
int alternate_function;
|
||||
#endif
|
||||
} PinMap;
|
||||
|
||||
void pin_function(PinName pin, int function);
|
||||
# if defined(TARGET_STM32F407)
|
||||
void pin_alternate_function(PinName pin, int alternate_function);
|
||||
#endif
|
||||
void pin_mode (PinName pin, PinMode mode);
|
||||
|
||||
uint32_t pinmap_peripheral(PinName pin, const PinMap* map);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ void pinmap_pinout(PinName pin, const PinMap *map) {
|
|||
while (map->pin != NC) {
|
||||
if (map->pin == pin) {
|
||||
pin_function(pin, map->function);
|
||||
#if defined(TARGET_STM32F407)
|
||||
pin_alternate_function(pin, map->alternate_function);
|
||||
#endif
|
||||
pin_mode(pin, PullNone);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue