renamed functions
This commit is contained in:
parent
5138f89323
commit
6ca5f69a4d
12
sht4x.c
12
sht4x.c
@ -14,15 +14,15 @@
|
||||
|
||||
/* TODO prejmenovat vsechny na sht4x_* */
|
||||
/* I2C */
|
||||
int8_t i2c_transmit(uint8_t address, uint8_t *buffer, int len) __attribute__((weak));
|
||||
int8_t i2c_receive(uint8_t address, uint8_t *buffer, int len) __attribute__((weak));
|
||||
int8_t sht4x_i2c_transmit(uint8_t address, uint8_t *buffer, int len) __attribute__((weak));
|
||||
int8_t sht4x_i2c_receive(uint8_t address, uint8_t *buffer, int len) __attribute__((weak));
|
||||
/* CRC */
|
||||
uint8_t sensirion_crc8_calculate(const uint8_t *data, uint16_t count) __attribute__((weak));
|
||||
/* Interrupts */
|
||||
int8_t sht4x_disable_interrupts(void) __attribute__((weak));
|
||||
int8_t sht4x_enable_interrupts(void) __attribute__((weak));
|
||||
/* delay function */
|
||||
void sht4x_delay_ms(int delay_ms) __attribute__((weak));
|
||||
void delay_ms(int delay_ms) __attribute__((weak));
|
||||
|
||||
int8_t sht4x_send_cmd(sht4x_cmd_t cmd)
|
||||
{
|
||||
@ -43,15 +43,15 @@ int8_t sht4x_measure(int16_t *temperature, uint16_t *relative_humidity)
|
||||
buffer[0] = SHT4X_START_MEAS_HIGH_PRECISION;
|
||||
/* disable interrupts to prevent modbus/i2c conflict */
|
||||
sht4x_disable_interrupts();
|
||||
result = i2c_transmit(SHT4X_I2C_ADDRESS<<1, buffer, 1);
|
||||
result = sht4x_i2c_transmit(SHT4X_I2C_ADDRESS<<1, buffer, 1);
|
||||
sht4x_enable_interrupts();
|
||||
if (result != 0) {
|
||||
return SHT4X_ERROR;
|
||||
}
|
||||
sht4x_delay_ms(10); /* 10 ms should be enough */
|
||||
delay_ms(10); /* 10 ms should be enough */
|
||||
/* read out */
|
||||
sht4x_disable_interrupts();
|
||||
result = i2c_receive(SHT4X_I2C_ADDRESS<<1, buffer, 6);
|
||||
result = sht4x_i2c_receive(SHT4X_I2C_ADDRESS<<1, buffer, 6);
|
||||
sht4x_enable_interrupts();
|
||||
if (result != 0) {
|
||||
return SHT4X_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user