pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT

Dependencies:   mbed MMA8451Q USBDevice WakeUp vt100

Fork of afero_node_suntory_2017_06_15 by Orefatoi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Accelerometer_Sekisan.hpp Source File

Accelerometer_Sekisan.hpp

00001 #ifndef _ACCELEROMETER_SEKISAN_HPP_
00002 #define _ACCELEROMETER_SEKISAN_HPP_
00003 
00004 #include "mbed.h"
00005 #include "ToDoQ.h"
00006 #include "RTC_Handler.h"
00007 #include "MMA8451Q.h"
00008 #include "WakeUp.h"
00009 #include "Preferences.hpp"
00010 #include "TimeEventHandler.hpp"
00011 #include "Singletoned.hpp"
00012 #include "MCUResetReason.hpp"
00013 
00014 class Accelerometer_Sekisan :
00015     public ToDo,
00016     public TimeEventHandler<Accelerometer_Sekisan>,
00017     public Singletoned<Accelerometer_Sekisan>
00018 {
00019     MMA8451Q *acc;
00020     Accelerometer_Sekisan();
00021     ~Accelerometer_Sekisan();
00022     void go();
00023     virtual void checkIntervalUpdate();
00024     float read_count;
00025     void (Accelerometer_Sekisan::*ptr_to_go)();
00026     void go_NormalOperation();
00027     void go_WhileWaitingForSuccess();
00028     void readSensorAndIncCount();
00029     float sensing_interval;
00030     class SekisanCounter
00031     {
00032         friend Accelerometer_Sekisan;
00033         int32_t sekisanchi;
00034         uint16_t sampling_count;
00035         uint32_t sampling_interval;
00036         int32_t prev_x, prev_y, prev_z;
00037     public:
00038         SekisanCounter();
00039         inline uint32_t get_sampling_interval()
00040         {
00041             return sampling_interval;
00042         }
00043         void push(int32_t, int32_t, int32_t);
00044         int32_t pop();
00045     };
00046     SekisanCounter *sekisan_counter;
00047 public:
00048     friend class TimeEventHandler;
00049     friend class Singletoned;
00050     virtual void toJSON(char*);
00051     virtual void getBytes(uint8_t*){}
00052     virtual void toBASE64(char *buf, PREFERENCES::_crc32 *crc32){}
00053     virtual void success();
00054 };
00055 
00056 #endif //_MARUSOL_SENSOR_MANAGER_TEMP_H_