Paparazzi UAS  v5.18.0_stable
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_ */
high_speed_logger_direct_memory_handler
void high_speed_logger_direct_memory_handler(uint8_t val)
Function managing the interface with the user.
Definition: high_speed_logger_direct_memory.c:1242
add_byte_to_buffer
void add_byte_to_buffer(uint8_t value)
Function adding a Byte to the local buffer.
Definition: high_speed_logger_direct_memory.c:822
val
uint16_t val[TCOUPLE_NB]
Definition: temp_tcouple_adc.c:49
memory_send_wrdi
void memory_send_wrdi(void)
Function sending a request to clear the writte enable flag in the memory.
Definition: high_speed_logger_direct_memory.c:239
add_array_to_buffer
void add_array_to_buffer(uint8_t *array, uint8_t size)
Function adding an array to the local buffer.
Definition: high_speed_logger_direct_memory.c:854
memory_read_id
void memory_read_id(void)
Function sending a request for the ID of the memory chip.
Definition: high_speed_logger_direct_memory.c:200
high_speed_logger_direct_memory_init
void high_speed_logger_direct_memory_init(void)
Function initialisating the module.
Definition: high_speed_logger_direct_memory.c:1095
uint32_t
unsigned long uint32_t
Definition: types.h:18
array
int * array
Definition: snake_gate_detection.c:94
memory_completly_erase
void memory_completly_erase(void)
Function sending a request to erase the entire memory.
Definition: high_speed_logger_direct_memory.c:319
memory_write_values
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.
Definition: high_speed_logger_direct_memory.c:343
send_buffer_to_uart
void send_buffer_to_uart(void)
Function sending the read values from the memory to te UART.
Definition: high_speed_logger_direct_memory.c:738
append_values_to_memory
uint8_t append_values_to_memory(uint8_t *values, uint8_t size)
Function adding a buffer of values to the memory.
Definition: high_speed_logger_direct_memory.c:643
std.h
memory_read_status_1
void memory_read_status_1(void)
Function sending a request to fetch the status Byte of the memory.
Definition: high_speed_logger_direct_memory.c:258
high_speed_logger_direct_memory_periodic
void high_speed_logger_direct_memory_periodic(void)
Main function of the module.
Definition: high_speed_logger_direct_memory.c:1141
memory_send_wren
void memory_send_wren(void)
Function sending a request to set the writte enable flag in the memory.
Definition: high_speed_logger_direct_memory.c:220
uint8_t
unsigned char uint8_t
Definition: types.h:14
memory_read_values
void memory_read_values(uint32_t mem_addr, uint8_t size)
Function sending a request to read some values in memory.
Definition: high_speed_logger_direct_memory.c:377
ml_read_log_in_memory
void ml_read_log_in_memory(void)
Function continuing the reading of the current log in memory.
Definition: high_speed_logger_direct_memory.c:613
add_values_to_buffer
void add_values_to_buffer(void)
Function adding the configured messages to the buffers of the values to be written in memory.
Definition: high_speed_logger_direct_memory.c:1026
memory_erase_4k
void memory_erase_4k(uint32_t mem_addr)
Function sending a request to erase 4KB of the memory.
Definition: high_speed_logger_direct_memory.c:293
logging_status_gui
uint8_t logging_status_gui
Status of the module.
Definition: high_speed_logger_direct_memory.c:181
is_sequence_in_array
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.
Definition: high_speed_logger_direct_memory.c:1217
ml_erase_completely_memory
uint8_t ml_erase_completely_memory(void)
Function erasing the entire memory.
Definition: high_speed_logger_direct_memory.c:573
are_buffers_empty
uint8_t are_buffers_empty(void)
Function returning true if the two local buffers are empty.
Definition: high_speed_logger_direct_memory.c:928
run_logger
void run_logger(void)
Funcion called to add the values to log to the buffer with a frequency divider in order to not overfl...
Definition: high_speed_logger_direct_memory.c:1046
send_buffer_to_memory
uint8_t send_buffer_to_memory(uint8_t *buffer, uint8_t *size)
Function sending a buffer ot the memory.
Definition: high_speed_logger_direct_memory.c:786
run_memory_management
uint8_t run_memory_management(void)
Function sending the buffer to the memory when possible.
Definition: high_speed_logger_direct_memory.c:869
ml_write_values_to_memory
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.
Definition: high_speed_logger_direct_memory.c:462
start_new_log
uint8_t start_new_log(void)
Function starting a new log.
Definition: high_speed_logger_direct_memory.c:961
end_log
uint8_t end_log(void)
Function ending the current log.
Definition: high_speed_logger_direct_memory.c:1070
ml_erase_4k_on_memory
uint8_t ml_erase_4k_on_memory(uint32_t mem_addr)
Function erasing 4KB of the memory.
Definition: high_speed_logger_direct_memory.c:528