Skip to content

Commit

Permalink
boards/arm/spresense: Add a function to control gpo
Browse files Browse the repository at this point in the history
Add a function to control gpo pin for alt1250.
  • Loading branch information
SPRESENSE committed Nov 7, 2024
1 parent dce74ea commit 6e69c60
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions boards/arm/cxd56xx/spresense/src/cxd56_alt1250_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
#include "cxd56_gpio.h"
#include "cxd56_pinconfig.h"

/****************************************************************************
* Private Data
****************************************************************************/

static int s_lte_power = POWER_LTE;

/****************************************************************************
* Public Functions
****************************************************************************/
Expand All @@ -52,7 +58,7 @@

void board_alt1250_poweron(void)
{
board_power_control(POWER_LTE, true);
board_power_control(s_lte_power, true);
}

/****************************************************************************
Expand All @@ -65,7 +71,7 @@ void board_alt1250_poweron(void)

void board_alt1250_poweroff(void)
{
board_power_control(POWER_LTE, false);
board_power_control(s_lte_power, false);
}

/****************************************************************************
Expand All @@ -78,7 +84,7 @@ void board_alt1250_poweroff(void)

bool board_alt1250_powerstatus(void)
{
return board_power_monitor(POWER_LTE);
return board_power_monitor(s_lte_power);
}

/****************************************************************************
Expand All @@ -93,12 +99,17 @@ int board_alt1250_powerkeep(bool enable)
{
if (enable)
{
return board_unset_reset_gpo(POWER_LTE);
return board_unset_reset_gpo(s_lte_power);
}
else
{
return board_set_reset_gpo(POWER_LTE);
return board_set_reset_gpo(s_lte_power);
}
}
#endif

void board_alt1250_powergpo_control(int p)
{
s_lte_power = p;
}

#endif

0 comments on commit 6e69c60

Please sign in to comment.