37 #define I2C_DEVICE (I2CDEV_2) 46 #define I2C_DEVICE (I2CDEV_2) 59 for (pinpos = 0; pinpos < 16; pinpos++) {
61 if (config->
pin & (0x1 << pinpos)) {
63 __IO uint32_t *cr = &gpio->
CRL + (pinpos / 8);
65 uint32_t currentmode = config->
mode & 0x0F;
67 uint32_t shift = (pinpos % 8) * 4;
71 if (config->
mode & 0x10)
72 currentmode |= config->
speed;
74 tmp &= ~(0xF << shift);
76 tmp |= currentmode << shift;
80 gpio->
ODR &= ~(1U << pinpos);
82 gpio->
ODR |= (1U << pinpos);
92 tmp = ((uint32_t)0x0F) << (0x04 * (pinsrc & (uint8_t)0x03));
93 AFIO->EXTICR[pinsrc >> 0x02] &= ~tmp;
94 AFIO->EXTICR[pinsrc >> 0x02] |= (((uint32_t)portsrc) << (0x04 * (pinsrc & (uint8_t)0x03)));
97 #define LSB_MASK ((uint16_t)0xFFFF) 98 #define DBGAFR_POSITION_MASK ((uint32_t)0x000F0000) 99 #define DBGAFR_SWJCFG_MASK ((uint32_t)0xF0FFFFFF) 100 #define DBGAFR_LOCATION_MASK ((uint32_t)0x00200000) 101 #define DBGAFR_NUMBITS_MASK ((uint32_t)0x00100000) 105 uint32_t tmp = 0x00, tmp1 = 0x00, tmpreg = 0x00, tmpmask = 0x00;
106 if ((remap & 0x80000000) == 0x80000000)
107 tmpreg =
AFIO->MAPR2;
118 tmp1 = ((uint32_t)0x03) << tmpmask;
122 tmpreg &= ~(tmp << ((remap >> 0x15) * 0x10));
127 tmpreg |= (tmp << ((remap >> 0x15) * 0x10));
129 if ((remap & 0x80000000) == 0x80000000)
130 AFIO->MAPR2 = tmpreg;
#define DBGAFR_LOCATION_MASK
void gpioPinRemapConfig(uint32_t remap, bool enable)
void gpioInit(GPIO_TypeDef *gpio, gpio_config_t *config)
#define DBGAFR_SWJCFG_MASK
#define DBGAFR_NUMBITS_MASK
#define DBGAFR_POSITION_MASK
void gpioExtiLineConfig(uint8_t portsrc, uint8_t pinsrc)