Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions arch/risc-v/src/bl602/bl602_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int bl602_configgpio(gpio_pinset_t cfgset)
uint32_t mask;
uintptr_t regaddr;
uint32_t cfg = 0;
uint8_t pin = (cfgset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
gpio_pinset_t pin = (cfgset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;

if (pin > 27)
{
Expand Down Expand Up @@ -151,7 +151,7 @@ int bl602_configgpio(gpio_pinset_t cfgset)
*
****************************************************************************/

int bl602_gpio_deinit(uint8_t pin)
int bl602_gpio_deinit(gpio_pinset_t pin)
{
bl602_configgpio(GPIO_INPUT | GPIO_FLOAT | pin);
return OK;
Expand All @@ -173,7 +173,7 @@ int bl602_gpio_deinit(uint8_t pin)
int bl602_config_uart_sel(gpio_pinset_t pinset, uint8_t sig_sel)
{
irqstate_t flags;
uint8_t pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
gpio_pinset_t pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
uint8_t sel_idx;
uint32_t reg;

Expand Down Expand Up @@ -204,7 +204,7 @@ int bl602_config_uart_sel(gpio_pinset_t pinset, uint8_t sig_sel)

void bl602_gpiowrite(gpio_pinset_t pinset, bool value)
{
uint8_t pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
gpio_pinset_t pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
if (value)
{
modifyreg32(BL602_GPIO_CFGCTL32, 0, (1 << pin));
Expand All @@ -225,6 +225,6 @@ void bl602_gpiowrite(gpio_pinset_t pinset, bool value)

bool bl602_gpioread(gpio_pinset_t pinset)
{
uint8_t pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
gpio_pinset_t pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
return ((getreg32(BL602_GPIO_CFGCTL30) & (1 << pin)) ? 1 : 0);
}
2 changes: 1 addition & 1 deletion arch/risc-v/src/bl602/bl602_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ int bl602_configgpio(gpio_pinset_t cfgset);
*
****************************************************************************/

int bl602_gpio_deinit(uint8_t pin);
int bl602_gpio_deinit(gpio_pinset_t pin);

/****************************************************************************
* Name: bl602_config_uart_sel
Expand Down