mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
gpio: Fix GPIO expanders warnings
- ISO1H812G is *output* only expander, not input. - Warning make sense when we try to set the expander the wrong way. Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
This commit is contained in:
parent
0281e71cf8
commit
e50a2d34d2
2 changed files with 14 additions and 5 deletions
|
|
@ -181,8 +181,8 @@ static void iso1h812g_deselect(FAR struct spi_dev_s *spi,
|
||||||
* Name: iso1h812g_direction
|
* Name: iso1h812g_direction
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* ISO1H812G is only input pin. However interface is provided in order
|
* ISO1H812G is only output expander. However interface is provided in
|
||||||
* to avoid system falls if called.
|
* order to avoid system falls if called.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* dev - Device-specific state data
|
* dev - Device-specific state data
|
||||||
|
|
@ -201,7 +201,12 @@ static int iso1h812g_direction(FAR struct ioexpander_dev_s *dev,
|
||||||
|
|
||||||
DEBUGASSERT(priv != NULL && priv->config != NULL);
|
DEBUGASSERT(priv != NULL && priv->config != NULL);
|
||||||
|
|
||||||
gpiowarn("WARNING: ISO1H812G is only input expander!\n");
|
if (IOEXPANDER_DIRECTION_IN == direction
|
||||||
|
|| IOEXPANDER_DIRECTION_IN_PULLUP == direction
|
||||||
|
|| IOEXPANDER_DIRECTION_IN_PULLDOWN == direction)
|
||||||
|
{
|
||||||
|
gpiowarn("WARNING: ISO1H812G is only output expander!\n");
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ static void iso1i813t_deselect(FAR struct spi_dev_s *spi,
|
||||||
* Name: iso1i813t_direction
|
* Name: iso1i813t_direction
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* ISO1I813T is only input pin. However interface is provided in order
|
* ISO1I813T is only input expander. However interface is provided in order
|
||||||
* to avoid system falls if called.
|
* to avoid system falls if called.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
|
|
@ -200,7 +200,11 @@ static int iso1i813t_direction(FAR struct ioexpander_dev_s *dev,
|
||||||
|
|
||||||
DEBUGASSERT(priv != NULL && priv->config != NULL);
|
DEBUGASSERT(priv != NULL && priv->config != NULL);
|
||||||
|
|
||||||
gpiowarn("WARNING: ISO1I813T is only input expander!\n");
|
if (IOEXPANDER_DIRECTION_OUT == direction
|
||||||
|
|| IOEXPANDER_DIRECTION_OUT_OPENDRAIN == direction)
|
||||||
|
{
|
||||||
|
gpiowarn("WARNING: ISO1I813T is only input expander!\n");
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue