summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/calypso/calypso_power.c
blob: 03db7def7f93a8274d13e6f28f00ff95c321fcc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <nuttx/spi/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;
}