openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
lpc17_spi.h
Go to the documentation of this file.
1/*
2 * openMMC --
3 *
4 * Copyright (C) 2015 Henrique Silva <henrique.silva@lnls.br>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
28#ifndef LPC17xx_SPI_H_
29#define LPC17xx_SPI_H_
30
31#include "spi_17xx_40xx.h"
32
33#define spi_init(id) Chip_SPI_Init(id)
34#define spi_deinit(id) Chip_SPI_DeInit(id)
35#define spi_flush_rx(id) Chip_SPI_Int_FlushData(id)
36#define spi_set_bitrate(id, bitrate) Chip_SPI_SetBitRate(id, bitrate)
37
38#define SPI_SLAVE 0
39#define SPI_MASTER 1
40#define SPI_INTERRUPT 0
41#define SPI_POLLING 1
42
43void spi_config( uint32_t bitrate, uint8_t frame_sz, bool master_mode, bool poll );
44uint32_t spi_write( uint8_t * buffer, uint32_t buffer_len );
45void spi_assertSSEL(void);
46void spi_deassertSSEL(void);
47#endif
void spi_config(uint32_t bitrate, uint8_t frame_sz, bool master_mode, bool poll)
Definition lpc17_spi.c:46
void spi_assertSSEL(void)
Definition lpc17_spi.c:35
uint32_t spi_write(uint8_t *buffer, uint32_t buffer_len)
Definition lpc17_spi.c:76
void spi_deassertSSEL(void)
Definition lpc17_spi.c:41