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.c File Reference
#include <stm32/gpio.h>
#include <stm32/flash.h>
#include <stm32/misc.h>
#include <stm32/exti.h>
#include <stm32/spi.h>
#include "mcu.h"
#include "mcu_periph/sys_time.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.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)
 
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_ready_for_read = FALSE
 
static uint8_t values [6]
 

Macro Definition Documentation

#define AccSelect ( )    GPIOB->BRR = GPIO_Pin_12

Definition at line 81 of file lisa_test_adxl345.c.

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

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

Definition at line 82 of file lisa_test_adxl345.c.

#define AccUnselect ( )    GPIOB->BSRR = GPIO_Pin_12

Definition at line 80 of file lisa_test_adxl345.c.

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

#define CONFIGURED   6

Definition at line 75 of file lisa_test_adxl345.c.

Referenced by main_event_task(), and main_periodic_task().

Function Documentation

void exti2_irq_handler ( void  )

Definition at line 269 of file lisa_test_adxl345.c.

References acc_ready_for_read, DEBUG_S4_TOGGLE, RESET, and TRUE.

int main ( void  )

Definition at line 54 of file lisa_test_adxl345.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 193 of file lisa_test_adxl345.c.

References acc_ready_for_read, acc_status, CONFIGURED, DefaultChannel, DefaultDevice, FALSE, read_data(), and values.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void main_init ( void  )
inlinestatic

Definition at line 66 of file lisa_test_adxl345.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 206 of file lisa_test_adxl345.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 147 of file lisa_test_adxl345.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 108 of file lisa_test_adxl345.c.

References __attribute__(), AccSelect, AccUnselect, ADXL345_REG_DATA_X0, foo, RESET, and values.

Referenced by main_event_task(), and main_periodic_task().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uint8_t read_fom_reg ( uint8_t  addr)
static

Definition at line 96 of file lisa_test_adxl345.c.

References AccSelect, AccUnselect, and RESET.

static void write_to_reg ( uint8_t  addr,
uint8_t  val 
)
static

Definition at line 84 of file lisa_test_adxl345.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_ready_for_read = FALSE
static

Definition at line 77 of file lisa_test_adxl345.c.

Referenced by exti2_irq_handler(), and main_event_task().

uint8_t acc_status =0
static

Definition at line 76 of file lisa_test_adxl345.c.

Referenced by main_event_task(), and main_periodic_task().

uint8_t values[6]
static

Definition at line 78 of file lisa_test_adxl345.c.

Referenced by main_event_task(), and read_data().