|
|
|
@ -84,6 +84,10 @@ typedef uint32_t gpio_t;
|
|
|
|
|
* @brief Available MUX values for configuring a pin's alternate function
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
#ifdef CPU_FAM_STM32F1
|
|
|
|
|
GPIO_AF_OUT_PP = 0xb, /**< alternate function output - push-pull */
|
|
|
|
|
GPIO_AF_OUT_OD = 0xf, /**< alternate function output - open-drain */
|
|
|
|
|
#else
|
|
|
|
|
GPIO_AF0 = 0, /**< use alternate function 0 */
|
|
|
|
|
GPIO_AF1, /**< use alternate function 1 */
|
|
|
|
|
GPIO_AF2, /**< use alternate function 2 */
|
|
|
|
@ -102,6 +106,7 @@ typedef enum {
|
|
|
|
|
GPIO_AF14, /**< use alternate function 14 */
|
|
|
|
|
GPIO_AF15 /**< use alternate function 15 */
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
} gpio_af_t;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -152,6 +157,14 @@ void periph_clk_en(bus_t bus, uint32_t mask);
|
|
|
|
|
*/
|
|
|
|
|
void periph_clk_dis(bus_t bus, uint32_t mask);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Configure the alternate function for the given pin
|
|
|
|
|
*
|
|
|
|
|
* @param[in] pin pin to configure
|
|
|
|
|
* @param[in] af alternate function to use
|
|
|
|
|
*/
|
|
|
|
|
void gpio_init_af(gpio_t pin, gpio_af_t af);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Configure the given pin to be used as ADC input
|
|
|
|
|
*
|
|
|
|
|