JC42 compliant temperature sensor driver.
More...
JC42 compliant temperature sensor driver.
Description
The connection between the MCU and jc42 compliant temperature sensors is based on a I2C-interface. There are multiple jc42 compliant temperature sensors available such as the mcp9804 and the MAX6604. This driver reads the temperature from these sensors. The sensors support a alarm wire, but this is not supported by this driver.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
|
file | jc42.h |
| Driver for jc42 compliant temperature sensors.
|
|
file | jc42_internal.h |
| Internal addresses, registers, constants for jc42 sensors.
|
|
file | jc42_params.h |
| Default configuration for jc42.
|
|
|
const saul_driver_t | jc42_temperature_saul_driver |
| Export SAUL endpoint.
|
|
◆ JC42_NODEV
◆ JC42_NOI2C
◆ JC42_OK
◆ jc42_get_config()
int jc42_get_config |
( |
const jc42_t * |
dev, |
|
|
uint16_t * |
data |
|
) |
| |
Get content of configuration register.
- Parameters
-
[in] | dev | device descriptor |
[out] | data | buffer where config register will be written to |
- Returns
- 0 on success
-
-1 on error
◆ jc42_get_temperature()
int jc42_get_temperature |
( |
const jc42_t * |
dev, |
|
|
int16_t * |
temperature |
|
) |
| |
Get measured temperature.
- Parameters
-
[in] | dev | device descriptor |
[out] | temperature | uint16_t buffer where temperature will be written to in centi-degree |
- Returns
- 0 on success
-
-1 on error
◆ jc42_init()
Initialize a jc42 device.
- Parameters
-
[out] | dev | device descriptor |
[in] | params | jc42 initialization struct |
- Returns
- 0 on success
-
-1 on error
◆ jc42_set_config()
int jc42_set_config |
( |
const jc42_t * |
dev, |
|
|
uint16_t |
data |
|
) |
| |
Set content of configuration register.
- Parameters
-
[in] | dev | device descriptor |
[in] | data | new value for configuration register |
- Returns
- 0 on success
-
-1 on error