Пример #1
0
/*!
    \brief      write data to the specified GPIO pin
    \param[in]  port
      \arg        GPIOx(x = A,B,C,D,F)
    \param[in]  pin
                  GPIO_PIN_x(x=0..15), GPIO_PIN_ALL
    \param[in]  bitvalue
      \arg        RESET: clear the port pin
      \arg        SET: set the port pin
    \param[out] none
    \retval     none
*/
void gpio_bit_write(uint32_t port, uint16_t pin, bit_status bit_value)
{
    if (RESET != bit_value){
        GPIO_BOP(port) = pin;
    }else{
        GPIO_BC(port) = pin;
    }
}
Пример #2
0
/*!
    \brief      write data to the specified GPIO pin
    \param[in]  gpio_periph: GPIOx(x = A,B,C,F) 
                only one parameter can be selected which is shown as below:
      \arg        GPIOx(x = A,B,C,F) 
    \param[in]  pin: GPIO pin
                one or more parameters can be selected which are shown as below:
      \arg        GPIO_PIN_x(x=0..15), GPIO_PIN_ALL
    \param[in]  bit_value: SET or RESET
      \arg        RESET: clear the port pin
      \arg        SET: set the port pin
    \param[out] none
    \retval     none
*/
void gpio_bit_write(uint32_t gpio_periph, uint32_t pin, bit_status bit_value)
{
    if(RESET != bit_value){
        GPIO_BOP(gpio_periph) = (uint32_t)pin;
    }else{
        GPIO_BC(gpio_periph) = (uint32_t)pin;
    }
}
Пример #3
0
/*!
    \brief      set GPIO pin
    \param[in]  port
      \arg        GPIOx(x = A,B,C,D,F)
    \param[in]  pin
      \arg        GPIO_PIN_x(x=0..15), GPIO_PIN_ALL
    \param[out] none
    \retval     none
*/
void gpio_bit_set(uint32_t port, uint16_t pin)
{
    GPIO_BOP(port) = pin;
}
Пример #4
0
/*!
    \brief      set GPIO pin bit
    \param[in]  gpio_periph: GPIOx(x = A,B,C,F) 
                only one parameter can be selected which is shown as below:
      \arg        GPIOx(x = A,B,C,F) 
    \param[in]  pin: GPIO pin
                one or more parameters can be selected which are shown as below:
      \arg        GPIO_PIN_x(x=0..15), GPIO_PIN_ALL
    \param[out] none
    \retval     none
*/
void gpio_bit_set(uint32_t gpio_periph, uint32_t pin)
{
    GPIO_BOP(gpio_periph) = (uint32_t)pin;
}