MVMFirmwareCpp v0.1
fw_board_razzeto_v3.h
Go to the documentation of this file.
1 // fw_board_razzeto_v3.h
2 
3 #ifndef _FW_BOARD_RAZZETO_V3_h
4 #define _FW_BOARD_RAZZETO_V3_h
5 
6 #if defined(ARDUINO) && ARDUINO >= 100
7  #include "arduino.h"
8 
9 #else
10  #include "WProgram.h"
11 #endif
12 
13 #include "hw.h"
14 #include <functional>
15 
16 
17 #define IIC_COUNT 6
18 
19 #define PLOOP_MODEL DS_01
20 #define PPATIENT_MODEL DS_01
21 #define PVENTURI DS_01
22 
23 class HW_V3 : public HW {
24 public:
25 
26 
27  bool Init();
28  bool I2CWrite(t_i2cdevices device, uint8_t* wbuffer, int wlength, bool stop);
29  bool I2CRead(t_i2cdevices device, uint8_t* wbuffer, int wlength, uint8_t* rbuffer, int rlength, bool stop);
30  bool I2CRead(t_i2cdevices device, uint8_t* rbuffer, int rlength, bool stop);
31  bool PWMSet(hw_pwm id, float value);
32  bool IOSet(hw_gpio id, bool value);
33  bool IOGet(hw_gpio id, bool* value);
34  void PrintDebugConsole(String s);
35  void PrintLineDebugConsole(String s);
36  void __delay_blocking_ms(uint32_t ms);
37  void Tick();
38  uint64_t GetMillis();
39  int64_t Get_dT_millis(uint64_t ms);
40  bool DataAvailableOnUART0();
41  String ReadUART0UntilEOL();
42  bool WriteUART0(String s);
43  void GetPowerStatus(bool* batteryPowered, float* charge);
44  float GetPIN();
45  float GetBoardTemperature();
46  uint16_t GetSupervisorAlarms();
47 
48 
49 private:
50  void __service_i2c_detect();
51  void i2c_MuxSelect(uint8_t i);
53 
54 
56  uint8_t current_muxpos = 10;
57 
58 
59 };
60 
61 
62 #endif
63 
64 // # # ###
65 // ## # #
66 // # # # #
67 // # # # #
68 // # # # #
69 // # ## #
70 // # # ###
71 //
72 // Nuclear Instruments 2020 - All rights reserved
73 // Any commercial use of this code is forbidden
74 // Contact info@nuclearinstruments.eu
HW_V3::GetIICDevice
t_i2cdev GetIICDevice(t_i2cdevices device)
Definition: fw_board_razzeto_v3.cpp:299
HW_V3::WriteUART0
bool WriteUART0(String s)
Definition: fw_board_razzeto_v3.cpp:227
HW_V3::GetPIN
float GetPIN()
Definition: fw_board_razzeto_v3.cpp:315
HW_V3::ReadUART0UntilEOL
String ReadUART0UntilEOL()
Definition: fw_board_razzeto_v3.cpp:232
arduino.h
HW_V3::PWMSet
bool PWMSet(hw_pwm id, float value)
Definition: fw_board_razzeto_v3.cpp:137
HW_V3::PrintLineDebugConsole
void PrintLineDebugConsole(String s)
Definition: fw_board_razzeto_v3.cpp:210
HW_V3::GetSupervisorAlarms
uint16_t GetSupervisorAlarms()
Definition: fw_board_razzeto_v3.cpp:323
HW_V3::I2CWrite
bool I2CWrite(t_i2cdevices device, uint8_t *wbuffer, int wlength, bool stop)
Definition: fw_board_razzeto_v3.cpp:70
hw_gpio
hw_gpio
Definition: generic_definitions.h:33
HW_V3::iic_devs
t_i2cdev iic_devs[IIC_COUNT]
Definition: fw_board_razzeto_v3.h:55
HW_V3::GetBoardTemperature
float GetBoardTemperature()
Definition: fw_board_razzeto_v3.cpp:319
hw.h
HW_V3::PrintDebugConsole
void PrintDebugConsole(String s)
Definition: fw_board_razzeto_v3.cpp:205
HW_V3::I2CRead
bool I2CRead(t_i2cdevices device, uint8_t *wbuffer, int wlength, uint8_t *rbuffer, int rlength, bool stop)
Definition: fw_board_razzeto_v3.cpp:88
HW_V3::__service_i2c_detect
void __service_i2c_detect()
Definition: fw_board_razzeto_v3.cpp:248
t_i2cdev
Definition: generic_definitions.h:51
HW_V3::Init
bool Init()
Definition: fw_board_razzeto_v3.cpp:18
HW_V3::GetPowerStatus
void GetPowerStatus(bool *batteryPowered, float *charge)
Definition: fw_board_razzeto_v3.cpp:310
HW_V3::DataAvailableOnUART0
bool DataAvailableOnUART0()
Definition: fw_board_razzeto_v3.cpp:222
HW_V4
Driver for the Nuclear Instruments V4 Hardware Board.
Definition: fw_board_ni_v4.h:23
t_i2cdevices
t_i2cdevices
Definition: generic_definitions.h:36
IIC_COUNT
#define IIC_COUNT
Definition: fw_board_razzeto_v3.h:17
HW_V3::IOGet
bool IOGet(hw_gpio id, bool *value)
Definition: fw_board_razzeto_v3.cpp:176
HW_V3::current_muxpos
uint8_t current_muxpos
Definition: fw_board_razzeto_v3.h:56
HW_V3::Tick
void Tick()
Definition: fw_board_razzeto_v3.cpp:215
HW_V3::i2c_MuxSelect
void i2c_MuxSelect(uint8_t i)
Definition: fw_board_razzeto_v3.cpp:282
HW_V3
Definition: fw_board_razzeto_v3.h:23
hw_pwm
hw_pwm
Definition: generic_definitions.h:32
HW_V3::IOSet
bool IOSet(hw_gpio id, bool value)
Definition: fw_board_razzeto_v3.cpp:154