BH1745 digital color sensor API.
More...
BH1745 digital color sensor API.
◆ drv_bh1745_close()
uint32_t drv_bh1745_close |
( |
void |
| ) |
|
Function for closing the BH1745 driver.
- Returns
- Codes from the underlying drivers.
◆ drv_bh1745_data_get()
Function for getting the BH1745 data.
- Parameters
-
[out] | p_data | The measurement results. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
NRF_ERROR_NULL A NULL pointer was supplied.
-
Codes from the underlying drivers.
◆ drv_bh1745_gain_set()
Function for setting the BH1745 ADC gain.
- Parameters
-
[in] | gain | The desired gain value. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_init()
uint32_t drv_bh1745_init |
( |
void |
| ) |
|
Function for initializing the BH1745 driver.
- Returns
- NRF_SUCCESS Only possible return value.
◆ drv_bh1745_int_get()
uint32_t drv_bh1745_int_get |
( |
uint8_t * |
p_int_reg | ) |
|
Function for getting the BH1745 interrupt register.
- Parameters
-
[out] | p_int_reg | Contents of the interrupt register. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_int_reset()
uint32_t drv_bh1745_int_reset |
( |
void |
| ) |
|
Function for resetting the interrupt.
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_int_set()
uint32_t drv_bh1745_int_set |
( |
uint8_t |
int_reg | ) |
|
Function for setting the BH1745 interrupt register.
- Parameters
-
[in] | int_reg | Contents of the interrupt register. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
NRF_ERROR_INVALID_PARAM Invalid register content supplied.
-
Codes from the underlying drivers.
◆ drv_bh1745_manu_id_get()
uint32_t drv_bh1745_manu_id_get |
( |
uint8_t * |
p_manu_id | ) |
|
Function for getting the BH1745 manufacturer ID.
- Parameters
-
[out] | p_manu_id | The manufacturer ID. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_meas_enable()
uint32_t drv_bh1745_meas_enable |
( |
bool |
enable | ) |
|
Function for enabling the BH1745 measurements.
- Parameters
-
[in] | enable | True if measurements are to be enabled. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_meas_time_set()
Function for setting the BH1745 measurement time.
- Parameters
-
[in] | meas_time | The desired measurement time. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_open()
Function for opening the BH1745 driver according to the specified configuration.
- Parameters
-
[in] | p_cfg | Pointer to the driver configuration for the session to be opened. |
- Returns
- Codes from the underlying drivers.
◆ drv_bh1745_part_id_get()
uint32_t drv_bh1745_part_id_get |
( |
uint8_t * |
p_part_id | ) |
|
Function for getting the BH1745 part ID.
- Parameters
-
- Returns
- NRF_SUCCESS If the call was successful.
-
NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_persistance_get()
uint32_t drv_bh1745_persistance_get |
( |
uint8_t * |
p_per_reg | ) |
|
Function for getting the BH1745 persistance register.
- Parameters
-
[out] | p_per_reg | Contents of the persistance register. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_persistance_set()
uint32_t drv_bh1745_persistance_set |
( |
uint8_t |
per_reg | ) |
|
Function for setting the BH1745 persistance register.
- Parameters
-
[in] | per_reg | Contents of the persistance register. |
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
NRF_ERROR_INVALID_PARAM Invalid register content supplied.
-
Codes from the underlying drivers.
◆ drv_bh1745_sw_reset()
uint32_t drv_bh1745_sw_reset |
( |
void |
| ) |
|
Function for resetting the BH1745 registers.
- Note
- Will also power down the BH1745.
- Returns
- NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_threshold_get()
Function for getting the BH1745 threshold.
- Parameters
-
- Returns
- NRF_SUCCESS If the call was successful.
-
NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.
◆ drv_bh1745_threshold_set()
Function for setting the BH1745 threshold.
- Parameters
-
- Returns
- NRF_SUCCESS If the call was successful.
-
NRF_ERROR_INVALID_STATE The driver was not open.
-
Codes from the underlying drivers.