Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
eeprom25AA256.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Gautier Hattenberger
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi 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 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi 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 paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
31#ifndef EEPROM25AA256_H
32#define EEPROM25AA256_H
33
34#include "std.h"
35#include "mcu_periph/spi.h"
36
42#ifndef E25_IN_BUFFER_LEN
43#define E25_IN_BUFFER_LEN (1024 + 3)
44#endif
45
51#ifndef E25_OUT_BUFFER_LEN
52#define E25_OUT_BUFFER_LEN 3
53#endif
54
64
71extern void eeprom25AA256_init(struct Eeprom25AA256 *eeprom, struct spi_periph *spi_p, uint8_t slave_idx);
72
79extern void eeprom25AA256_read(struct Eeprom25AA256 *eeprom, uint16_t addr, uint16_t length);
80
85extern void eeprom25AA256_event(struct Eeprom25AA256 *eeprom);
86
87#endif // EEPROM25AA256_H
88
#define E25_IN_BUFFER_LEN
Input buffer length.
void eeprom25AA256_event(struct Eeprom25AA256 *eeprom)
Event function.
struct spi_periph * spi_p
spi peripheral
struct spi_transaction spi_trans
spi transaction
void eeprom25AA256_init(struct Eeprom25AA256 *eeprom, struct spi_periph *spi_p, uint8_t slave_idx)
Init function.
volatile uint8_t tx_buf[E25_OUT_BUFFER_LEN]
transmit buffer
volatile uint8_t rx_buf[E25_IN_BUFFER_LEN]
receive buffer
#define E25_OUT_BUFFER_LEN
Output buffer length.
bool data_available
data read flag
void eeprom25AA256_read(struct Eeprom25AA256 *eeprom, uint16_t addr, uint16_t length)
Read function.
25AA256 eeprom structure
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
Definition spi.h:153
SPI peripheral structure.
Definition spi.h:174
SPI transaction structure.
Definition spi.h:148
uint16_t foo
Definition main_demo5.c:58
Architecture independent SPI (Serial Peripheral Interface) API.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.