mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
gpiochip: export ioexpander pointer to user
sim gpiochip ioexpander export to user Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
This commit is contained in:
parent
b11f669676
commit
227d7237ab
2 changed files with 24 additions and 0 deletions
|
|
@ -93,6 +93,8 @@ static struct ioexpander_ops_s g_sim_gpiochip_ops =
|
|||
#endif
|
||||
};
|
||||
|
||||
struct ioexpander_dev_s *g_gpiochip = NULL;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -450,5 +452,26 @@ int sim_gpiochip_initialize(const char *path)
|
|||
wd_start(&priv->wdog, SIM_GPIOCHIP_WDOG_DELAY,
|
||||
sim_gpiochip_interrupt, (wdparm_t)priv);
|
||||
|
||||
g_gpiochip = (struct ioexpander_dev_s *)priv;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sim_gpiochip_get_ioe
|
||||
*
|
||||
* Description:
|
||||
* Get the ioexpander pointer of gpiochip device
|
||||
*
|
||||
* Input Parameters:
|
||||
* None.
|
||||
*
|
||||
* Returned Value:
|
||||
* The pointer to the instance of sim gpiochip device.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct ioexpander_dev_s *sim_gpiochip_get_ioe(void)
|
||||
{
|
||||
return g_gpiochip;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -518,6 +518,7 @@ void sim_stack_color(void *stackbase, size_t nbytes);
|
|||
|
||||
#ifdef CONFIG_SIM_GPIOCHIP
|
||||
int sim_gpiochip_initialize(const char *filename);
|
||||
struct ioexpander_dev_s *sim_gpiochip_get_ioe(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue