Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lisa_test_adxl345_dma.c File Reference
#include <stm32/gpio.h>
#include <stm32/flash.h>
#include <stm32/misc.h>
#include <stm32/exti.h>
#include <stm32/spi.h>
#include <stm32/dma.h>
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "mcu_periph/uart.h"
#include "subsystems/datalink/downlink.h"
#include "peripherals/adxl345.h"
#include "my_debug_servo.h"
#include "led.h"
+ Include dependency graph for lisa_test_adxl345_dma.c:

Go to the source code of this file.

Macros

#define CONFIGURED   6
 
#define AccUnselect()   GPIOB->BSRR = GPIO_Pin_12
 
#define AccSelect()   GPIOB->BRR = GPIO_Pin_12
 
#define AccToggleSelect()   GPIOB->ODR ^= GPIO_Pin_12
 

Functions

static void main_init (void)
 
static void main_periodic_task (void)
 
static void main_event_task (void)
 
static void main_init_hw (void)
 
void exti2_irq_handler (void)
 
void dma1_c4_irq_handler (void)
 
int main (void)
 
static void write_to_reg (uint8_t addr, uint8_t val)
 
static uint8_t read_fom_reg (uint8_t addr)
 
static void read_data (void)
 

Variables

static uint8_t acc_status =0
 
static volatile uint8_t acc_data_available = FALSE
 
static uint8_t dma_tx_buf [7]
 
static uint8_t dma_rx_buf [7]
 

Macro Definition Documentation

#define AccSelect ( )    GPIOB->BRR = GPIO_Pin_12

Definition at line 79 of file lisa_test_adxl345_dma.c.

Referenced by read_data(), read_fom_reg(), and write_to_reg().

#define AccToggleSelect ( )    GPIOB->ODR ^= GPIO_Pin_12

Definition at line 80 of file lisa_test_adxl345_dma.c.

#define AccUnselect ( )    GPIOB->BSRR = GPIO_Pin_12
#define CONFIGURED   6

Definition at line 71 of file lisa_test_adxl345_dma.c.

Referenced by main_event_task(), and main_periodic_task().

Function Documentation

void dma1_c4_irq_handler ( void  )

Definition at line 294 of file lisa_test_adxl345_dma.c.

References acc_data_available, AccUnselect, and TRUE.

void exti2_irq_handler ( void  )

Definition at line 282 of file lisa_test_adxl345_dma.c.

References DEBUG_S4_TOGGLE, read_data(), and RESET.

+ Here is the call graph for this function:

int main ( void  )

Definition at line 50 of file lisa_test_adxl345_dma.c.

References main_event_task(), main_init(), main_periodic_task(), and sys_time_check_and_ack_timer().

+ Here is the call graph for this function:

static void main_event_task ( void  )
inlinestatic

Definition at line 192 of file lisa_test_adxl345_dma.c.

References acc_data_available, acc_status, CONFIGURED, DefaultChannel, DefaultDevice, dma_rx_buf, and FALSE.

Referenced by main().

+ Here is the caller graph for this function:

static void main_init ( void  )
inlinestatic

Definition at line 62 of file lisa_test_adxl345_dma.c.

References main_init_hw(), mcu_init(), PERIODIC_FREQUENCY, and sys_time_register_timer().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void main_init_hw ( void  )
inlinestatic

Definition at line 207 of file lisa_test_adxl345_dma.c.

References AccUnselect, DEBUG_SERVO2_INIT, IMU_ACC_DRDY_GPIO, IMU_ACC_DRDY_GPIO_PORTSOURCE, and IMU_ACC_DRDY_RCC_GPIO.

Referenced by main_init().

+ Here is the caller graph for this function:

static void main_periodic_task ( void  )
inlinestatic

Definition at line 161 of file lisa_test_adxl345_dma.c.

References acc_status, ADXL345_REG_BW_RATE, ADXL345_REG_DATA_FORMAT, ADXL345_REG_INT_ENABLE, ADXL345_REG_POWER_CTL, CONFIGURED, DefaultChannel, DefaultDevice, LED_PERIODIC, read_data(), and write_to_reg().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void read_data ( void  )
static

Definition at line 106 of file lisa_test_adxl345_dma.c.

References AccSelect, ADXL345_REG_DATA_X0, dma_rx_buf, and dma_tx_buf.

Referenced by exti2_irq_handler(), and main_periodic_task().

+ Here is the caller graph for this function:

static uint8_t read_fom_reg ( uint8_t  addr)
static

Definition at line 94 of file lisa_test_adxl345_dma.c.

References AccSelect, AccUnselect, and RESET.

static void write_to_reg ( uint8_t  addr,
uint8_t  val 
)
static

Definition at line 82 of file lisa_test_adxl345_dma.c.

References AccSelect, AccUnselect, and RESET.

Referenced by main_periodic_task().

+ Here is the caller graph for this function:

Variable Documentation

volatile uint8_t acc_data_available = FALSE
static

Definition at line 73 of file lisa_test_adxl345_dma.c.

Referenced by dma1_c4_irq_handler(), and main_event_task().

uint8_t acc_status =0
static

Definition at line 72 of file lisa_test_adxl345_dma.c.

Referenced by main_event_task(), and main_periodic_task().

uint8_t dma_rx_buf[7]
static

Definition at line 76 of file lisa_test_adxl345_dma.c.

Referenced by main_event_task(), and read_data().

uint8_t dma_tx_buf[7]
static

Definition at line 75 of file lisa_test_adxl345_dma.c.

Referenced by read_data().