diff options
Diffstat (limited to 'nuttx/arch/arm/src/calypso/calypso_power.c')
-rw-r--r-- | nuttx/arch/arm/src/calypso/calypso_power.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/calypso/calypso_power.c b/nuttx/arch/arm/src/calypso/calypso_power.c new file mode 100644 index 000000000..f85d6890e --- /dev/null +++ b/nuttx/arch/arm/src/calypso/calypso_power.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <nuttx/spi.h> + +int board_power_off(void) +{ + uint16_t tx; + struct spi_dev_s *spi = up_spiinitialize(0); + + SPI_SETBITS(spi, 16); + + tx = (1 << 6) | (1 << 1); + SPI_SNDBLOCK(spi, &tx, 1); + + tx = (1 << 6) | (30 << 1); + SPI_SNDBLOCK(spi, &tx, 1); + + return 0; +} |