2011-02-14 17:48:42 +02:00
|
|
|
/*
|
|
|
|
* fw/spi.h - ATmega8 family SPI I/O
|
|
|
|
*
|
2013-07-31 01:46:55 +03:00
|
|
|
* Written 2011, 2013 by Werner Almesberger
|
|
|
|
* Copyright 2011, 2013 Werner Almesberger
|
2011-02-14 17:48:42 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
2011-02-14 04:46:36 +02:00
|
|
|
#ifndef SPI_H
|
|
|
|
#define SPI_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
|
|
void spi_begin(void);
|
|
|
|
uint8_t spi_io(uint8_t v);
|
|
|
|
void spi_end(void);
|
2011-06-09 20:02:26 +03:00
|
|
|
void spi_off(void);
|
2011-02-14 04:46:36 +02:00
|
|
|
void spi_init(void);
|
|
|
|
|
|
|
|
#define spi_send(v) (void) spi_io(v)
|
|
|
|
#define spi_recv(v) spi_io(0)
|
|
|
|
|
2013-07-31 01:46:55 +03:00
|
|
|
void spi_recv_block(uint8_t *buf, uint8_t n);
|
|
|
|
|
2011-02-14 04:46:36 +02:00
|
|
|
#endif /* !SPI_H */
|