1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// fw_board_razzeto_v3.h

#ifndef _FW_BOARD_RAZZETO_V3_h
#define _FW_BOARD_RAZZETO_V3_h

#if defined(ARDUINO) && ARDUINO >= 100
	#include "arduino.h"    
   
#else
	#include "WProgram.h"
#endif

#include "hw.h"  
#include <functional>


#define IIC_COUNT 6

#define PLOOP_MODEL     DS_01
#define PPATIENT_MODEL  DS_01
#define PVENTURI        DS_01

class HW_V3 :  public HW {
public:
    

    bool Init();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool I2CWrite(t_i2cdevices device, uint8_t* wbuffer, int wlength, bool stop);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool I2CRead(t_i2cdevices device, uint8_t* wbuffer, int wlength, uint8_t* rbuffer, int rlength, bool stop);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool I2CRead(t_i2cdevices device, uint8_t* rbuffer, int rlength, bool stop);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool PWMSet(hw_pwm id, float value);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool IOSet(hw_gpio id, bool value);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool IOGet(hw_gpio id, bool* value);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    void PrintDebugConsole(String s);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    void PrintLineDebugConsole(String s);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    void __delay_blocking_ms(uint32_t ms);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    void Tick();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    uint64_t GetMillis();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    int64_t Get_dT_millis(uint64_t ms);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool DataAvailableOnUART0();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    String ReadUART0UntilEOL();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    bool WriteUART0(String s);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    void GetPowerStatus(bool* batteryPowered, float* charge);<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    float GetPIN();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    float GetBoardTemperature();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
    uint16_t GetSupervisorAlarms();<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class<--- Function in derived class
   

private:
    void __service_i2c_detect();
    void i2c_MuxSelect(uint8_t i);
    t_i2cdev GetIICDevice(t_i2cdevices device);

  
    t_i2cdev iic_devs[IIC_COUNT];
    uint8_t current_muxpos = 10;

    
};


#endif

//                  #     # ### 
//                  ##    #  #  
//                  # #   #  #  
//                  #  #  #  #  
//                  #   # #  #  
//                  #    ##  #  
//                  #     # ### 
//
// Nuclear Instruments 2020 - All rights reserved
// Any commercial use of this code is forbidden
// Contact info@nuclearinstruments.eu