ZMOD4510 Ultra-Low Power 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
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 ];
48 
49 typedef enum { emUSB, emEVK } ESComMode_t;
50 
65 int ESCom_Find ( ESComInterface_t* boards, int* count );
66 
77 
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_ */
int ESCom_SetPower(ESComInterface_t *board, bool on)
int ESCom_Disconnect(ESComInterface_t *board)
int ESCom_Find(ESComInterface_t *boards, int *count)
ESComErrorScope_t
Definition: escom.h:33
int ESCom_I2CWrite(ESComInterface_t *board, uint8_t slAddr, uint8_t *wData1, int wSize1, uint8_t *wData2, int wSize2)
char const * ESCom_GetErrorString(int error, int scope, char *buf, int bufLen)
int ESCom_GetSensorVoltage(ESComInterface_t *board, float *voltage)
Renesas Environmental Sensor HAL definitions.
Definition: escom.h:41
int ESCom_Connect(ESComInterface_t *board)
int ESCom_I2CRead(ESComInterface_t *board, uint8_t slAddr, uint8_t *wData, int wSize, uint8_t *rData, int rSize)