Move prototype of board_power_off() to include/nuttx/board.h where it belongs

This commit is contained in:
Gregory Nutt 2015-07-02 16:25:31 -06:00
parent 51df91e93d
commit 19320d157a

View File

@ -1,18 +1,39 @@
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
int board_power_off(void)
/****************************************************************************
* Name: board_power_off
*
* Description:
* Power off the board.
*
* If this function returns, then it was not possible to power-off the
* board due to some other constraints.
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void board_power_off(void)
{
uint16_t tx;
struct spi_dev_s *spi = up_spiinitialize(0);
uint16_t tx;
struct spi_dev_s *spi = up_spiinitialize(0);
SPI_SETBITS(spi, 16);
SPI_SETBITS(spi, 16);
tx = (1 << 6) | (1 << 1);
SPI_SNDBLOCK(spi, &tx, 1);
tx = (1 << 6) | (1 << 1);
SPI_SNDBLOCK(spi, &tx, 1);
tx = (1 << 6) | (30 << 1);
SPI_SNDBLOCK(spi, &tx, 1);
return 0;
tx = (1 << 6) | (30 << 1);
SPI_SNDBLOCK(spi, &tx, 1);
}