Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
high_speed_logger_direct_memory.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Clement Roblot
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 
27 #ifndef HIGH_SPEED_LOGGER_DIRECT_MEMORY_H_
28 #define HIGH_SPEED_LOGGER_DIRECT_MEMORY_H_
29 
30 #include "std.h"
31 
32 
33 //Low level functions, directly acting with the SPI
34 extern void memory_read_id(void);
35 extern void memory_send_wren(void);
36 extern void memory_send_wrdi(void);
37 extern void memory_read_status_1(void);
38 extern void memory_read_values(uint32_t mem_addr, uint8_t size);
39 extern void memory_write_values(uint32_t mem_addr, uint8_t *values, uint8_t size);
40 extern void memory_completly_erase(void);
41 extern void memory_erase_4k(uint32_t mem_addr);
42 
43 //Mid low level functions, abstracting the low SPI layer
44 extern uint8_t ml_write_values_to_memory(uint32_t mem_addr, uint8_t *values, uint8_t size);
45 extern uint8_t ml_erase_4k_on_memory(uint32_t mem_addr);
47 extern void ml_read_log_in_memory(void);
48 
49 //Mid high level function : memory management
50 extern uint8_t append_values_to_memory(uint8_t *values, uint8_t size);
51 extern uint8_t send_buffer_to_memory(uint8_t *buffer, uint8_t *size);
52 extern void send_buffer_to_uart(void);
53 
54 //High level function : local buffer management
55 extern void add_byte_to_buffer(uint8_t value);
56 extern void add_array_to_buffer(uint8_t *array, uint8_t size);
57 extern uint8_t run_memory_management(void);
58 extern uint8_t are_buffers_empty(void);
59 
60 //High level function : log commands
61 extern uint8_t start_new_log(void);
62 extern void add_values_to_buffer(void);
63 extern void run_logger(void);
64 extern uint8_t end_log(void);
65 
66 //Module function
67 extern void high_speed_logger_direct_memory_init(void);
69 
70 //Other functions
71 extern uint8_t is_sequence_in_array(uint8_t *array, uint8_t array_size, uint8_t *sequence, uint8_t sequence_size);
72 
74 
76 
77 #endif /* HIGH_SPEED_LOGGER_DIRECT_MEMORY_H_ */
void memory_write_values(uint32_t mem_addr, uint8_t *values, uint8_t size)
Function sending a request to write a buffer of values to the memory.
uint8_t start_new_log(void)
Function starting a new log.
void ml_read_log_in_memory(void)
Function continuing the reading of the current log in memory.
uint8_t run_memory_management(void)
Function sending the buffer to the memory when possible.
void high_speed_logger_direct_memory_init(void)
Function initialisating the module.
uint8_t end_log(void)
Function ending the current log.
void memory_erase_4k(uint32_t mem_addr)
Function sending a request to erase 4KB of the memory.
void add_array_to_buffer(uint8_t *array, uint8_t size)
Function adding an array to the local buffer.
void memory_read_values(uint32_t mem_addr, uint8_t size)
Function sending a request to read some values in memory.
uint8_t are_buffers_empty(void)
Function returning true if the two local buffers are empty.
void memory_read_status_1(void)
Function sending a request to fetch the status Byte of the memory.
void memory_completly_erase(void)
Function sending a request to erase the entire memory.
uint8_t ml_erase_completely_memory(void)
Function erasing the entire memory.
void add_values_to_buffer(void)
Function adding the configured messages to the buffers of the values to be written in memory.
void memory_read_id(void)
Function sending a request for the ID of the memory chip.
uint8_t ml_write_values_to_memory(uint32_t mem_addr, uint8_t *values, uint8_t size)
Function writting a buffer of values to the memory.
void high_speed_logger_direct_memory_periodic(void)
Main function of the module.
void memory_send_wren(void)
Function sending a request to set the writte enable flag in the memory.
void send_buffer_to_uart(void)
Function sending the read values from the memory to te UART.
uint8_t ml_erase_4k_on_memory(uint32_t mem_addr)
Function erasing 4KB of the memory.
uint8_t send_buffer_to_memory(uint8_t *buffer, uint8_t *size)
Function sending a buffer ot the memory.
void memory_send_wrdi(void)
Function sending a request to clear the writte enable flag in the memory.
uint8_t is_sequence_in_array(uint8_t *array, uint8_t array_size, uint8_t *sequence, uint8_t sequence_size)
Function testing if a sequence is in a buffer of values.
uint8_t logging_status_gui
Status of the module.
void run_logger(void)
Funcion called to add the values to log to the buffer with a frequency divider in order to not overfl...
void high_speed_logger_direct_memory_handler(uint8_t val)
Function managing the interface with the user.
void add_byte_to_buffer(uint8_t value)
Function adding a Byte to the local buffer.
uint8_t append_values_to_memory(uint8_t *values, uint8_t size)
Function adding a buffer of values to the memory.
int * array
uint16_t val[TCOUPLE_NB]
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98