mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 18:56:10 +08:00
Move prototype of board_power_off() to include/nuttx/board.h where it belongs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
Submodule configs updated: ca7b002f48...ec14d18d72
@@ -272,6 +272,26 @@ FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||
int board_ioctl(unsigned int cmd, uintptr_t arg);
|
||||
#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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user