ZMOD4510 Nitrogen Dioxide and Ozone Firmware Documentation |

escom.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2024 Renesas Electronics Corporation
3 * All Rights Reserved.
4 *
5 * This code is proprietary to Renesas, and is license pursuant to the terms and
6 * conditions that may be accessed at:
7 * https://www.renesas.com/eu/en/document/msc/renesas-software-license-terms-gas-sensor-software
8 *****************************************************************************/
9
20 #ifndef _ESCOM__H_
21 #define _ESCOM__H_
22
23 #include <stdint.h>
24 #include <stdbool.h>
25
26 #include "hal/hal.h"
27 #include "hal/3rdParty/libusb/libusb.h"
28
33 typedef enum {
34 iesLibUSB = 0x11,
35 iesI2C = 0x12,
36 iesCommand = 0x14
37 } ESComErrorScope_t;
38
39
41 typedef struct {
42 libusb_device* device;
43 libusb_device_handle* handle;
44 uint8_t outEP;
45 uint8_t inEP;
46 wchar_t serial [ 33 ];
47 } ESComInterface_t;
48
49 typedef enum { emUSB, emEVK } ESComMode_t;
50
65 int ESCom_Find ( ESComInterface_t* boards, int* count );
66
76 int ESCom_Connect(ESComInterface_t* board);
77
83 int ESCom_Disconnect(ESComInterface_t* board);
84
91 int ESCom_SetPower(ESComInterface_t* board, bool on);
92
94 int ESCom_I2CWrite(ESComInterface_t* board, uint8_t slAddr, uint8_t* wData1, int wSize1, uint8_t* wData2, int wSize2 );
95
97 int ESCom_I2CRead(ESComInterface_t* board, uint8_t slAddr, uint8_t* wData, int wSize, uint8_t* rData, int rSize );
98
103 int ESCom_GetSensorVoltage(ESComInterface_t* board, float* voltage );
104
110 char const* ESCom_GetErrorString ( int error, int scope, char* buf, int bufLen );
111
114 #endif /* _ESCOM__H_ */
ESCom_SetPower
int ESCom_SetPower(ESComInterface_t *board, bool on)
ESCom_Disconnect
int ESCom_Disconnect(ESComInterface_t *board)
ESCom_Find
int ESCom_Find(ESComInterface_t *boards, int *count)
ESComErrorScope_t
ESComErrorScope_t
Definition: escom.h:33
ESCom_I2CWrite
int ESCom_I2CWrite(ESComInterface_t *board, uint8_t slAddr, uint8_t *wData1, int wSize1, uint8_t *wData2, int wSize2)
ESCom_GetErrorString
char const * ESCom_GetErrorString(int error, int scope, char *buf, int bufLen)
ESCom_GetSensorVoltage
int ESCom_GetSensorVoltage(ESComInterface_t *board, float *voltage)
hal.h
Renesas Environmental Sensor HAL definitions.
ESComInterface_t
Definition: escom.h:41
ESCom_Connect
int ESCom_Connect(ESComInterface_t *board)
ESCom_I2CRead
int ESCom_I2CRead(ESComInterface_t *board, uint8_t slAddr, uint8_t *wData, int wSize, uint8_t *rData, int rSize)