#include "stdio.h"
#include "board.h"
#include "print_funcs.h"
#include "gpio.h"
#include "pm.h"
#include "intc.h"
#include "lis3l06al.h"
#include "usart.h"
Macros | |
Axis reference values for a set of predefined angles. | |
#define | ACC_TRIG_X0 (int) ( ACC_ZERO_X - SIN15 * ACC_1G ) |
#define | ACC_TRIG_X1 (int) ( ACC_ZERO_X + SIN15 * ACC_1G ) |
#define | ACC_TRIG_Y0 (int) ( ACC_ZERO_Y - SIN15 * ACC_1G ) |
#define | ACC_TRIG_Y1 (int) ( ACC_ZERO_Y + SIN15 * ACC_1G ) |
#define | ACC_TRIG_Z_TOP (int) ( ACC_ZERO_Z - SIN75 * ACC_1G ) |
#define | ACC_TRIG_Z_BOT (int) ( ACC_ZERO_Z + SIN60 * ACC_1G ) |
Functions | |
int | _init_startup (void) |
Low-level initialization routine called during startup, before the main function. More... | |
int | main (void) |
This is an example demonstrating the accelerometer functionalities using the accelerometer driver. More... | |
void | print_angles () |
Detect 30 and 60 angles. More... | |
void | print_mouse () |
Detect board orientation. More... | |
void | print_move () |
Display the tilt. !! this is harder and certainly needs calibration + tuning !! More... | |
Variables | |
volatile char | meuh_en = 0 |
volatile char | meuh_stop = 1 |
#define ACC_TRIG_X0 (int) ( ACC_ZERO_X - SIN15 * ACC_1G ) |
Referenced by is_acc_right(), and print_mouse().
#define ACC_TRIG_X1 (int) ( ACC_ZERO_X + SIN15 * ACC_1G ) |
Referenced by is_acc_left(), and print_mouse().
#define ACC_TRIG_Y0 (int) ( ACC_ZERO_Y - SIN15 * ACC_1G ) |
Referenced by is_acc_up(), and print_mouse().
#define ACC_TRIG_Y1 (int) ( ACC_ZERO_Y + SIN15 * ACC_1G ) |
Referenced by is_acc_down(), and print_mouse().
#define ACC_TRIG_Z_BOT (int) ( ACC_ZERO_Z + SIN60 * ACC_1G ) |
Referenced by is_acc_meuh(), and is_acc_topdown().
#define ACC_TRIG_Z_TOP (int) ( ACC_ZERO_Z - SIN75 * ACC_1G ) |
Referenced by is_acc_meuh().
int _init_startup | ( | void | ) |
Low-level initialization routine called during startup, before the main function.
This version comes in replacement to the default one provided by the Newlib add-ons library. Newlib add-ons' _init_startup only calls init_exceptions, but Newlib add-ons' exception and interrupt vectors are defined in the same section and Newlib add-ons' interrupt vectors are not compatible with the interrupt management of the INTC module. More low-level initializations are besides added here.
References _evba, Enable_global_exception, FOSC0, init_dbg_rs232(), INTC_init_interrupts(), and Set_system_register.
int main | ( | void | ) |
This is an example demonstrating the accelerometer functionalities using the accelerometer driver.
References acc_init(), acc_update(), FOSC0, init_dbg_rs232(), is_acc_meuh(), is_acc_slow(), meuh_en, meuh_stop, OSC0_STARTUP, pm_switch_to_osc0(), print_angles(), print_dbg(), print_mouse(), and print_move().
void print_angles | ( | ) |
Detect 30 and 60 angles.
References is_acc_abs_angle_x(), is_acc_abs_angle_y(), print_dbg(), print_dbg_ulong(), xyz_t::x, and xyz_t::y.
Referenced by main().
void print_mouse | ( | ) |
Detect board orientation.
References acc_get_m_x(), acc_get_m_y(), acc_get_m_z(), ACC_TRIG_X0, ACC_TRIG_X1, ACC_TRIG_Y0, ACC_TRIG_Y1, ACC_ZERO_X, ACC_ZERO_Y, is_acc_down(), is_acc_left(), is_acc_meuh(), is_acc_right(), is_acc_topdown(), is_acc_up(), print_dbg(), and print_dbg_hex().
Referenced by main().
void print_move | ( | ) |
Display the tilt. !! this is harder and certainly needs calibration + tuning !!
References print_dbg().
Referenced by main().
volatile char meuh_en = 0 |
Referenced by main().
volatile char meuh_stop = 1 |
Referenced by main().