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 9db4d7da94
commit 064b4923c6
3 changed files with 52 additions and 11 deletions

View File

@ -1,18 +1,39 @@
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <nuttx/board.h>
#include <nuttx/spi/spi.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; uint16_t tx;
struct spi_dev_s *spi = up_spiinitialize(0); struct spi_dev_s *spi = up_spiinitialize(0);
SPI_SETBITS(spi, 16); SPI_SETBITS(spi, 16);
tx = (1 << 6) | (1 << 1); tx = (1 << 6) | (1 << 1);
SPI_SNDBLOCK(spi, &tx, 1); SPI_SNDBLOCK(spi, &tx, 1);
tx = (1 << 6) | (30 << 1); tx = (1 << 6) | (30 << 1);
SPI_SNDBLOCK(spi, &tx, 1); SPI_SNDBLOCK(spi, &tx, 1);
return 0;
} }

@ -1 +1 @@
Subproject commit ca7b002f4864217794a2c3ac545fceba528c1292 Subproject commit ec14d18d72612c037efb5cb906628a665dba8a9d

View File

@ -272,6 +272,26 @@ FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
int board_ioctl(unsigned int cmd, uintptr_t arg); int board_ioctl(unsigned int cmd, uintptr_t arg);
#endif #endif
/****************************************************************************
* Name: board_power_off
*
* Description:
* Power off the board. This function may or may not be supported by a
* particular board architecture.
*
* If this function returns, then it was not possible to power-off the
* board due to some constraints.
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void board_power_off(void);
/**************************************************************************** /****************************************************************************
* Name: board_lcd_initialize, board_lcd_getdev, board_lcd_uninitialize * Name: board_lcd_initialize, board_lcd_getdev, board_lcd_uninitialize
* *