MVMFirmwareCpp v0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HW_V4 Class Reference

Driver for the Nuclear Instruments V4 Hardware Board. More...

#include <fw_board_ni_v4.h>

Inheritance diagram for HW_V4:
Inheritance graph
[legend]
Collaboration diagram for HW_V4:
Collaboration graph
[legend]

Public Member Functions

bool Init ()
 Initialize hardware peripheral in the system. More...
 
bool I2CWrite (t_i2cdevices device, uint8_t *wbuffer, int wlength, bool stop)
 Write buffer to I2C bus. More...
 
bool I2CRead (t_i2cdevices device, uint8_t *wbuffer, int wlength, uint8_t *rbuffer, int rlength, bool stop)
 Write buffer to I2C bus and read data. More...
 
bool I2CRead (t_i2cdevices device, uint8_t *rbuffer, int rlength, bool stop)
 Read I2c data. More...
 
bool PWMSet (hw_pwm id, float value)
 Control PWM device (PV1) More...
 
bool IOSet (hw_gpio id, bool value)
 Set a GPIO Status (IE Control PV6, Alarms, etc) More...
 
bool IOGet (hw_gpio id, bool *value)
 Get GPIO Status. More...
 
void PrintDebugConsole (String s)
 Print a message on console used for Debug. More...
 
void PrintLineDebugConsole (String s)
 Print a message on console used for Debug with a CR+LR at end. More...
 
void Tick ()
 Tick function must be called periodically. More...
 
bool DataAvailableOnUART0 ()
 API to read if on the communication interfaces there are bytes to be read. More...
 
String ReadUART0UntilEOL ()
 Return a
terminated string from communication interface. More...
 
bool WriteUART0 (String s)
 API to write a string to the communication interfaces. More...
 
void GetPowerStatus (bool *batteryPowered, float *charge)
 API to read battery charge and power supply status. More...
 
float GetPIN ()
 API return pressure on input of MVM. More...
 
float GetBoardTemperature ()
 API return temperature of the board. More...
 
uint16_t GetSupervisorAlarms ()
 API return Supervisor managed alarms. More...
 

Private Member Functions

void __service_i2c_detect ()
 Detect all I2C devices on bus. More...
 
void i2c_MuxSelect (uint8_t i)
 Switch I2C multiplexer. More...
 
t_i2cdev GetIICDevice (t_i2cdevices device)
 Search in the iic_devs list a particular device and return descriptor. More...
 
uint16_t ReadSupervisor (uint8_t i_address)
 Read a supervisor register. More...
 
void WriteSupervisor (uint8_t i_address, uint16_t write_data)
 Write a supervisor register. More...
 

Private Attributes

bool EnableWatchdogSupervisor = true
 
t_i2cdev iic_devs [IIC_COUNT]
 
uint8_t current_muxpos = 10
 
uint64_t batteryStatus_reading_LT
 
float currentBatteryCharge
 
bool pWall
 
float pIN
 
float BoardTemperature
 
uint16_t HW_AlarmsFlags
 

Detailed Description

Driver for the Nuclear Instruments V4 Hardware Board.

Definition at line 23 of file fw_board_ni_v4.h.

Member Function Documentation

◆ __service_i2c_detect()

void HW_V4::__service_i2c_detect ( )
private

Detect all I2C devices on bus.

Definition at line 506 of file fw_board_ni_v4.cpp.

507 {
508  byte error, address;
509  int nDevices;
510  Serial.println("Scanning... I2C");
511  nDevices = 0;
512  for (address = 1; address < 127; address++) {
513  Wire.beginTransmission(address);
514  error = Wire.endTransmission();
515  if (error == 0) {
516  Serial.print("I2C device found at address 0x");
517  if (address < 16) {
518  Serial.print("0");
519  }
520  Serial.println(address, HEX);
521  nDevices++;
522  }
523  else if (error == 4) {
524  Serial.print("Unknow error at address 0x");
525  if (address < 16) {
526  Serial.print("0");
527  }
528  Serial.println(address, HEX);
529  }
530  }
531  if (nDevices == 0) {
532  Serial.println("No I2C devices found\n");
533  }
534  else {
535  Serial.println("done\n");
536  }
537 }
Here is the call graph for this function:

◆ DataAvailableOnUART0()

bool HW_V4::DataAvailableOnUART0 ( )

API to read if on the communication interfaces there are bytes to be read.

Returns
true if bytes are available

Definition at line 452 of file fw_board_ni_v4.cpp.

453 {
454  return Serial.available();
455 }
Here is the caller graph for this function:

◆ GetBoardTemperature()

float HW_V4::GetBoardTemperature ( )

API return temperature of the board.

Returns
temperature in °C

Definition at line 633 of file fw_board_ni_v4.cpp.

634 {
635  return BoardTemperature;
636 }
Here is the caller graph for this function:

◆ GetIICDevice()

t_i2cdev HW_V4::GetIICDevice ( t_i2cdevices  device)
private

Search in the iic_devs list a particular device and return descriptor.

Parameters
devicedevice (t_i2cdevices) to be searched for
Returns
device handler

Definition at line 570 of file fw_board_ni_v4.cpp.

571 {
572  for (int i = 0; i < IIC_COUNT; i++)
573  {
574  if (iic_devs[i].t_device == device)
575  {
576  return iic_devs[i];
577  }
578  }
579 }
Here is the caller graph for this function:

◆ GetPIN()

float HW_V4::GetPIN ( )

API return pressure on input of MVM.

Returns
pressure in mbar

Definition at line 623 of file fw_board_ni_v4.cpp.

624 {
625  return pIN;
626 }
Here is the caller graph for this function:

◆ GetPowerStatus()

void HW_V4::GetPowerStatus ( bool *  batteryPowered,
float *  charge 
)

API to read battery charge and power supply status.

Parameters
batteryPoweredtrue the system is battery powered false the system is powered from 220v
charge% of battery charge

Definition at line 438 of file fw_board_ni_v4.cpp.

439 {
440  *batteryPowered = pWall ? false:true;
441  *charge = currentBatteryCharge ;
442 
443 }
Here is the caller graph for this function:

◆ GetSupervisorAlarms()

uint16_t HW_V4::GetSupervisorAlarms ( )

API return Supervisor managed alarms.

    bit 0 : input pressure too low
    bit 1 : input pressure too high
    bit 2 : board temperature too low
    bit 3 : board temperature too high
    bit 4 : no activity on the valves
    bit 5 : power regulator issue
    bit 6 : battery charge critical
Returns
encoded alarm status

Definition at line 652 of file fw_board_ni_v4.cpp.

653 {
654  return HW_AlarmsFlags;
655 }
Here is the caller graph for this function:

◆ i2c_MuxSelect()

void HW_V4::i2c_MuxSelect ( uint8_t  i)
private

Switch I2C multiplexer.

Check if mux is already in the correct position otherwise commutate

Parameters
i

Definition at line 546 of file fw_board_ni_v4.cpp.

547 {
548  if (i > 7)
549  return;
550 
551  if (i < 0)
552  return;
553 
554  if (current_muxpos == i) return;
555 
556  current_muxpos = i;
557 
558  Wire.beginTransmission(TCAADDR);
559  Wire.write(1 << i);
560  Wire.endTransmission();
561  delayMicroseconds(500);
562 }
Here is the caller graph for this function:

◆ I2CRead() [1/2]

bool HW_V4::I2CRead ( t_i2cdevices  device,
uint8_t *  rbuffer,
int  rlength,
bool  stop 
)

Read I2c data.

This function also switch mux port in order to access to required device

Parameters
devicename of the device listened in the iic_dev (t_i2cdevices)
rbufferreading buffer (should be allocated externally)
rlengthnumber of bytes to be read
stopadd stop at end of transaction
Returns
true if success

Definition at line 227 of file fw_board_ni_v4.cpp.

228 {
229  uint8_t count;
230  uint8_t address;
231  t_i2cdev dev = GetIICDevice(device);
232  address = dev.address;
233  i2c_MuxSelect(dev.muxport);
234 
235  count = Wire.requestFrom((uint16_t)address, (uint8_t)rlength, stop);
236 
237  if (count < rlength)
238  return false;
239 
240 
241  for (int i = 0;i < rlength; i++)
242  {
243  rbuffer[i] = Wire.read();
244  }
245 
246  return true;
247 }
Here is the call graph for this function:

◆ I2CRead() [2/2]

bool HW_V4::I2CRead ( t_i2cdevices  device,
uint8_t *  wbuffer,
int  wlength,
uint8_t *  rbuffer,
int  rlength,
bool  stop 
)

Write buffer to I2C bus and read data.

This function also switch mux port in order to access to required device

Parameters
devicename of the device listened in the iic_dev (t_i2cdevices)
wbufferbuffer to be written
wlengthlength of the buffer to be written
rbufferreading buffer (should be allocated externally)
rlengthnumber of bytes to be read
stopadd stop at end of transaction
Returns
true if success

Definition at line 182 of file fw_board_ni_v4.cpp.

183 {
184  uint8_t address;
185  uint8_t count;
186  uint8_t result;
187 
188  //Search I2C device by name
189  t_i2cdev dev = GetIICDevice(device);
190  address = dev.address;
191 
192  //Switch multiplexer
193  i2c_MuxSelect(dev.muxport);
194 
195  //Arduino I2C Write operation
196  Wire.beginTransmission(address);
197  for (int i = 0;i < wlength; i++)
198  Wire.write(wbuffer[i]);
199  result = Wire.endTransmission();
200  if (result != 0)
201  return false;
202 
203  //Arduino I2C Read operation
204  count = Wire.requestFrom((uint16_t)address, (uint8_t)rlength, stop);
205  if (count < rlength)
206  return false;
207 
208  for (int i = 0;i < rlength; i++)
209  {
210  rbuffer[i] = Wire.read();
211  }
212 
213  return true;
214 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ I2CWrite()

bool HW_V4::I2CWrite ( t_i2cdevices  device,
uint8_t *  wbuffer,
int  wlength,
bool  stop 
)

Write buffer to I2C bus.

This function also switch mux port in order to access to required device

Parameters
devicename of the device listened in the t_i2cdevices iic_dev
wbufferbuffer to be written
wlengthlength of the buffer
stopadd stop bit at end of transaction
Returns
true if success

Definition at line 145 of file fw_board_ni_v4.cpp.

146 {
147  uint8_t address;
148  uint8_t result;
149 
150  //Search I2C device by name
151  t_i2cdev dev = GetIICDevice(device);
152  address = dev.address;
153 
154  //Switch multiplexer
155  i2c_MuxSelect(dev.muxport);
156 
157  //Arduino I2C Write operation
158  Wire.beginTransmission(address);
159  for (int i = 0;i < wlength; i++)
160  Wire.write(wbuffer[i]);
161  result = Wire.endTransmission();
162 
163  if (result != 0)
164  return false;
165  else
166  return true;
167 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

bool HW_V4::Init ( )

Initialize hardware peripheral in the system.

The function configure:

  • Serial Port
  • PWM
  • PINS
  • I2C
  • Initialize the device list iic_devs
  • Variables

It also perform a I2C scan

Returns

Definition at line 36 of file fw_board_ni_v4.cpp.

37 {
38 
39  //Init serial port 115200,8,n,1
40  Serial.begin(115200);
41 
42  //Init PWM for PV1, 10KHz, 12 bit
43  ledcSetup(0, 10000, 12);
44  ledcAttachPin(VALVE_IN_PIN, 0);
45  ledcWrite(0, 0);
46 
47  //Init pins: PV2, ALARM LED, BUZZER, RELE
48  digitalWrite(VALVE_OUT_PIN, LOW);
49  digitalWrite(ALARM_LED, LOW);
50  digitalWrite(BUZZER, LOW);
51  digitalWrite(ALARM_RELE, HIGH);
52 
53  pinMode(VALVE_OUT_PIN, OUTPUT);
54  pinMode(ALARM_LED, OUTPUT);
55  pinMode(BUZZER, OUTPUT);
56  pinMode(ALARM_RELE, OUTPUT);
57 
58  //Start I2C Master and Scan bus
59  Wire.begin();
60 
61  for (int i = 0; i < 8; i++) {
62  i2c_MuxSelect(i);
63  Serial.println("SCAN I2C BUS: " + String(i));
65  }
66 
67  //Init list of devices on I2C bus
68 
69  iic_devs[0].t_device = IIC_PS_0; //NAME OF THE SENSORE
70  iic_devs[0].muxport = 0; //Multiplexer PORT
71  iic_devs[0].address = 0x76; //I2C ADDRESS
72 
74  iic_devs[1].muxport = 0;
75  iic_devs[1].address = 0x77;
76 
78  iic_devs[2].muxport = 1;
79  iic_devs[2].address = 0x76;
80 
81 #ifdef USE_SPIROMETER_SFM3019
83  iic_devs[3].muxport = 1;
84  iic_devs[3].address = 0x2E;
85 
86 #endif
87 
88 #ifdef USE_SPIROMETER_SFM3000
90  iic_devs[3].muxport = 1;
91  iic_devs[3].address = 0x40;
92 #endif
93 
95  iic_devs[4].muxport = 4;
96  iic_devs[4].address = 0x48;
97 
99  iic_devs[5].muxport = 3;
100  iic_devs[5].address = 0x22;
101 
102 
104  iic_devs[6].muxport = -1;
105  iic_devs[6].address = 0x70;
106 
108  iic_devs[7].muxport = 1;
109  iic_devs[7].address = 0x00;
110 
111 
112  batteryStatus_reading_LT = GetMillis();
113 
114 
115  currentBatteryCharge = 100;
116  pWall=true;
117  pIN=3;
118  BoardTemperature=25;
119 
120  //init supervisor watchdog
121 
122  /*
123  * During development we keep disabled supervisor watchdog
124  * otherwise it will trigger low level alarm every time
125  * we reprogram ESP
126  *
127  * 0 : DEVELOPMENT - NO SUPERVISOR WATCHDOG
128  * 1 : PRODUCTION - ENABLE SUPERVISOR WATCHDOG
129  */
130 
131 
132 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IOGet()

bool HW_V4::IOGet ( hw_gpio  id,
bool *  value 
)

Get GPIO Status.

Parameters
idname of the GPIO (enum hw_gpio)
valueOUTPUT true: logic level HI, low: logic level LOW
Returns
true if GPIO exists

Definition at line 325 of file fw_board_ni_v4.cpp.

326 {
327  switch (id)
328  {
329  case GPIO_PV2:
330  *value = digitalRead(VALVE_OUT_PIN);
331  break;
332  case GPIO_BUZZER:
333  *value = digitalRead(BUZZER);
334  break;
335  case GPIO_LED:
336  *value = digitalRead(ALARM_LED);
337  break;
338  case GPIO_RELEALLARM:
339  *value = digitalRead(ALARM_RELE);
340  break;
341  default:
342  return false;
343  break;
344  }
345  return true;
346 }

◆ IOSet()

bool HW_V4::IOSet ( hw_gpio  id,
bool  value 
)

Set a GPIO Status (IE Control PV6, Alarms, etc)

Parameters
idname of the GPIO (enum hw_gpio)
valuetrue: logic level HI, low: logic level LOW
Returns
true if GPIO exists

Definition at line 288 of file fw_board_ni_v4.cpp.

289 {
290  switch (id)
291  {
292  case GPIO_PV2:
293  digitalWrite(VALVE_OUT_PIN, value ? HIGH : LOW);
294  /*
295  * The breethe signal is used by the supervisor to check
296  * whenever the driver for PV1 and PV2 is not working
297  * We need to commutate breethe synchronous with PV2
298  */
299  if (value==LOW)
300  digitalWrite(BREETHE, LOW);
301  break;
302  case GPIO_BUZZER:
303  digitalWrite(BUZZER, value ? HIGH : LOW);
304  break;
305  case GPIO_LED:
306  digitalWrite(ALARM_LED, value ? HIGH : LOW);
307  break;
308  case GPIO_RELEALLARM:
309  digitalWrite(ALARM_RELE, value ? HIGH : LOW);
310  break;
311  default:
312  return false;
313  break;
314  }
315  return true;
316 }
Here is the caller graph for this function:

◆ PrintDebugConsole()

void HW_V4::PrintDebugConsole ( String  s)

Print a message on console used for Debug.

For ESP32 this is the same console of interface bus this is dangerous and in production DEBUG LEVEL should be set in order to be sure that no debug message is forwarded on this console otherwise GUI will crash

Parameters
sString to be print

Definition at line 368 of file fw_board_ni_v4.cpp.

369 {
370  Serial.print(s);
371 }
Here is the call graph for this function:

◆ PrintLineDebugConsole()

void HW_V4::PrintLineDebugConsole ( String  s)

Print a message on console used for Debug with a CR+LR at end.

For ESP32 this is the same console of interface bus this is dangerous and in production DEBUG LEVEL should be set in order to be sure that no debug message is forwarded on this console otherwise GUI will crash

Parameters
sString to be print

Definition at line 384 of file fw_board_ni_v4.cpp.

385 {
386  Serial.println(s);
387 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PWMSet()

bool HW_V4::PWMSet ( hw_pwm  id,
float  value 
)

Control PWM device (PV1)

Parameters
idname of the device (enum hw_pwm)
valuevalue from 0 to 100
Returns
always true

Definition at line 256 of file fw_board_ni_v4.cpp.

257 {
258 
259  if ((value < 0) || (value > 100.0)) return false;
260 
261  switch (id)
262  {
263  case PWM_PV1:
264  uint32_t v = (uint32_t)value * 4095.0 / 100.0;
265  ledcWrite(0, v);
266  /*
267  * The breethe signal is used by the supervisor to check
268  * whenever the driver for PV1 and PV2 is not working
269  * We need to commutate breethe synchronous with PV1
270  */
271  if (v > 0)
272  digitalWrite(BREETHE, HIGH);
273  break;
274 
275  }
276 
277 
278  return true;
279 }
Here is the caller graph for this function:

◆ ReadSupervisor()

uint16_t HW_V4::ReadSupervisor ( uint8_t  i_address)
private

Read a supervisor register.

Parameters
i_addressaddress of the register in the supervisor register file
Returns
value of the register

Definition at line 587 of file fw_board_ni_v4.cpp.

588 {
589  uint8_t wbuffer[4];
590  uint8_t rbuffer[4];
591 
592  wbuffer[0] = i_address;
593  I2CRead(IIC_SUPERVISOR, wbuffer, 1, rbuffer, 2, true);
594 
595  uint16_t a;
596 
597  a = (rbuffer [1]<< 8) | rbuffer[0];
598  return a;
599 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadUART0UntilEOL()

String HW_V4::ReadUART0UntilEOL ( )

Return a
terminated string from communication interface.

Returns
Recevied string

Definition at line 474 of file fw_board_ni_v4.cpp.

475 {
476  //PERICOLO. SE IL \n NON VIENE INVIATO TUTTO STALLA!!!!
477  return Serial.readStringUntil('\n');
478 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Tick()

void HW_V4::Tick ( )

Tick function must be called periodically.

The function performs in this driver polling task

Every seconds the function will contact the supervisor to do:

  • read battery charge
  • read power status (power line/battery)
  • read input pressure
  • read board temperature
  • read supervisor alarm flags
  • reset supervisor watchdog

Definition at line 403 of file fw_board_ni_v4.cpp.

404 {
405  if (Get_dT_millis(batteryStatus_reading_LT)>1000)
406  {
407  batteryStatus_reading_LT = GetMillis();
408  currentBatteryCharge = (float)ReadSupervisor(0x51);
411  pWall = ReadSupervisor(0x52) >0 ? false : true ;
412  pIN = ((float)ReadSupervisor(0x50));
413  BoardTemperature = ((float)ReadSupervisor(0x56)/10.0);
414  HW_AlarmsFlags = (uint16_t)ReadSupervisor(0x57);
415 
416  //reset supervisor watchdog
417  WriteSupervisor(0x00, 1);
418 
420  WriteSupervisor(0x01, 1);
421  EnableWatchdogSupervisor = false;
422  }
423  //Serial.println("Battery: " + String(currentBatteryCharge) + " PWALL: " + String (pWall));
424  }
425 
426 
427  return;
428 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteSupervisor()

void HW_V4::WriteSupervisor ( uint8_t  i_address,
uint16_t  write_data 
)
private

Write a supervisor register.

Parameters
i_addressaddress of the register in the supervisor register file
write_datavalue of the register

Definition at line 607 of file fw_board_ni_v4.cpp.

608 {
609  uint8_t wbuffer[4];
610  wbuffer[0] = i_address;
611  wbuffer[1] = write_data & 0xFF;
612  wbuffer[2] = (write_data >> 8) & 0xFF;
613 
614  I2CWrite(IIC_SUPERVISOR, wbuffer, 3, true);
615 
616 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteUART0()

bool HW_V4::WriteUART0 ( String  s)

API to write a string to the communication interfaces.

Parameters
sString to be written
Returns
always true

Definition at line 463 of file fw_board_ni_v4.cpp.

464 {
465  Serial.println(s);
466  return true;
467 }
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ batteryStatus_reading_LT

uint64_t HW_V4::batteryStatus_reading_LT
private

Definition at line 63 of file fw_board_ni_v4.h.

◆ BoardTemperature

float HW_V4::BoardTemperature
private

Definition at line 68 of file fw_board_ni_v4.h.

◆ current_muxpos

uint8_t HW_V4::current_muxpos = 10
private

Definition at line 61 of file fw_board_ni_v4.h.

◆ currentBatteryCharge

float HW_V4::currentBatteryCharge
private

Definition at line 64 of file fw_board_ni_v4.h.

◆ EnableWatchdogSupervisor

bool HW_V4::EnableWatchdogSupervisor = true
private

Definition at line 51 of file fw_board_ni_v4.h.

◆ HW_AlarmsFlags

uint16_t HW_V4::HW_AlarmsFlags
private

Definition at line 69 of file fw_board_ni_v4.h.

◆ iic_devs

t_i2cdev HW_V4::iic_devs[IIC_COUNT]
private

Definition at line 60 of file fw_board_ni_v4.h.

◆ pIN

float HW_V4::pIN
private

Definition at line 67 of file fw_board_ni_v4.h.

◆ pWall

bool HW_V4::pWall
private

Definition at line 65 of file fw_board_ni_v4.h.


The documentation for this class was generated from the following files:
t_i2cdev::address
uint8_t address
Definition: generic_definitions.h:53
t_i2cdev::muxport
int8_t muxport
Definition: generic_definitions.h:54
HW_V4::pIN
float pIN
Definition: fw_board_ni_v4.h:67
VALVE_IN_PIN
#define VALVE_IN_PIN
Definition: fw_board_ni_v4.cpp:11
IIC_PS_2
@ IIC_PS_2
Definition: generic_definitions.h:39
HW_V4::iic_devs
t_i2cdev iic_devs[IIC_COUNT]
Definition: fw_board_ni_v4.h:60
PWM_PV1
@ PWM_PV1
Definition: generic_definitions.h:32
HW_V4::I2CRead
bool I2CRead(t_i2cdevices device, uint8_t *wbuffer, int wlength, uint8_t *rbuffer, int rlength, bool stop)
Write buffer to I2C bus and read data.
Definition: fw_board_ni_v4.cpp:182
GPIO_RELEALLARM
@ GPIO_RELEALLARM
Definition: generic_definitions.h:33
IIC_FLOW1
@ IIC_FLOW1
Definition: generic_definitions.h:43
t_i2cdev::t_device
t_i2cdevices t_device
Definition: generic_definitions.h:52
IIC_PS_0
@ IIC_PS_0
Definition: generic_definitions.h:37
BREETHE
#define BREETHE
Definition: fw_board_ni_v4.cpp:17
IIC_COUNT
#define IIC_COUNT
Definition: fw_board_ni_v4.h:14
HW_V4::__service_i2c_detect
void __service_i2c_detect()
Detect all I2C devices on bus.
Definition: fw_board_ni_v4.cpp:506
IIC_ADC_0
@ IIC_ADC_0
Definition: generic_definitions.h:45
IIC_MUX
@ IIC_MUX
Definition: generic_definitions.h:48
BUZZER
#define BUZZER
Definition: fw_board_ni_v4.cpp:14
HW_V4::I2CWrite
bool I2CWrite(t_i2cdevices device, uint8_t *wbuffer, int wlength, bool stop)
Write buffer to I2C bus.
Definition: fw_board_ni_v4.cpp:145
Serial::println
void println()
ALARM_LED
#define ALARM_LED
Definition: fw_board_ni_v4.cpp:15
GPIO_PV2
@ GPIO_PV2
Definition: generic_definitions.h:33
HW_V4::pWall
bool pWall
Definition: fw_board_ni_v4.h:65
Serial
Definition: arduino.h:2
HW_V4::batteryStatus_reading_LT
uint64_t batteryStatus_reading_LT
Definition: fw_board_ni_v4.h:63
GPIO_LED
@ GPIO_LED
Definition: generic_definitions.h:33
t_i2cdev
Definition: generic_definitions.h:51
ALARM_RELE
#define ALARM_RELE
Definition: fw_board_ni_v4.cpp:16
HW_V4::currentBatteryCharge
float currentBatteryCharge
Definition: fw_board_ni_v4.h:64
HW_V4::GetIICDevice
t_i2cdev GetIICDevice(t_i2cdevices device)
Search in the iic_devs list a particular device and return descriptor.
Definition: fw_board_ni_v4.cpp:570
Serial::begin
void begin()
TCAADDR
#define TCAADDR
Definition: fw_board_ni_v4.cpp:19
GPIO_BUZZER
@ GPIO_BUZZER
Definition: generic_definitions.h:33
HW_V4::BoardTemperature
float BoardTemperature
Definition: fw_board_ni_v4.h:68
HW_V4::HW_AlarmsFlags
uint16_t HW_AlarmsFlags
Definition: fw_board_ni_v4.h:69
HW_V4::EnableWatchdogSupervisor
bool EnableWatchdogSupervisor
Definition: fw_board_ni_v4.h:51
HW_V4::WriteSupervisor
void WriteSupervisor(uint8_t i_address, uint16_t write_data)
Write a supervisor register.
Definition: fw_board_ni_v4.cpp:607
IIC_SUPERVISOR
@ IIC_SUPERVISOR
Definition: generic_definitions.h:46
HW_V4::ReadSupervisor
uint16_t ReadSupervisor(uint8_t i_address)
Read a supervisor register.
Definition: fw_board_ni_v4.cpp:587
Serial::print
void print()
IIC_GENERAL_CALL_SENSIRION
@ IIC_GENERAL_CALL_SENSIRION
Definition: generic_definitions.h:49
VALVE_OUT_PIN
#define VALVE_OUT_PIN
Definition: fw_board_ni_v4.cpp:12
HW_V4::current_muxpos
uint8_t current_muxpos
Definition: fw_board_ni_v4.h:61
Serial::readStringUntil
int readStringUntil()
HW_V4::i2c_MuxSelect
void i2c_MuxSelect(uint8_t i)
Switch I2C multiplexer.
Definition: fw_board_ni_v4.cpp:546
IIC_PS_1
@ IIC_PS_1
Definition: generic_definitions.h:38