#include "MZ_Addon_Si1133.h"
#include "MZ_error_handler.h"
#include "stm32l4xx_hal.h"
#include "MZ_Addon_board_Si1133_i2c.h"
Go to the source code of this file.
|
#define | X_ORDER_MASK 0x0070 |
|
#define | Y_ORDER_MASK 0x0007 |
|
#define | SIGN_MASK 0x0080 |
|
#define | GET_X_ORDER(m) ( ((m) & X_ORDER_MASK) >> 4) |
|
#define | GET_Y_ORDER(m) ( ((m) & Y_ORDER_MASK) ) |
|
#define | GET_SIGN(m) ( ((m) & SIGN_MASK) >> 7) |
|
#define | UV_INPUT_FRACTION 15 |
|
#define | UV_OUTPUT_FRACTION 12 |
|
#define | UV_NUMCOEFF 2 |
|
#define | ADC_THRESHOLD 16000 |
|
#define | INPUT_FRACTION_HIGH 7 |
|
#define | INPUT_FRACTION_LOW 15 |
|
#define | LUX_OUTPUT_FRACTION 12 |
|
#define | NUMCOEFF_LOW 9 |
|
#define | NUMCOEFF_HIGH 4 |
|
#define | UV_I2C_SEND(ADDRESS, LEN, TIME) MZ_I2C_Master_Transmit(MZ_ADDONUV_I2C_INSTANCE,SLAVE_ADD,(uint8_t *) ADDRESS,LEN,TIME) |
|
#define | UV_I2C_GET(ADDRESS, LEN, TIME) MZ_I2C_Master_Receive(MZ_ADDONUV_I2C_INSTANCE,SLAVE_ADD,(uint8_t *) ADDRESS,LEN,TIME) |
|
#define | SI1133_CONFIRM_COUNT (5) |
|
|
static Si1133_error | SI1133_Write_Reg (Si1133_register w_addr, uint8_t data) |
|
static Si1133_error | SI1133_Write_Reg_block (Si1133_register w_addr, uint8_t len, uint8_t *data) |
|
static Si1133_error | SI1133_Read_Reg (Si1133_register r_addr, uint8_t *buf) |
|
static Si1133_error | SI1133_Read_Reg_block (Si1133_register r_addr, uint8_t len, uint8_t *buf) |
|
static Si1133_error | SI1133_reset (void) |
|
static Si1133_error | SI1133_wait_until_sleep (void) |
|
static Si1133_error | SI1133_send_cmd (Si1133_command command) |
|
static Si1133_error | SI1133_force_measurement (void) |
|
static Si1133_error | SI1133_pause_measurement (void) |
|
static Si1133_error | SI1133_set_parameter (Si1133_parameter address, uint8_t value) |
|
static int32_t | SI1133_calculate_polynomial_helper (int32_t input, int8_t fraction, uint16_t mag, int8_t shift) |
|
static int32_t | SI1133_calculate_polynomial (int32_t x, int32_t y, uint8_t input_fraction, uint8_t output_fraction, uint8_t num_coeff, const Si1133_coeff *kp) |
|
static int32_t | SI1133_get_uv (int32_t uv) |
|
static int32_t | SI1133_get_lux (int32_t vis_high, int32_t vis_low, int32_t ir) |
|
Si1133_error | SI1133_init (void) |
|
Si1133_error | SI1133_deinit (void) |
|
static Si1133_error | SI1133_measure (Si1133_samples *_s1) |
|
Si1133_error | SI1133_get_hardware_id (uint8_t *hardware_id) |
|
Si1133_error | SI1133_measure_lux_uv (float *lux, float *uvi) |
|
Si1133_error | SI1133_get_measurement (float *lux, float *uvi) |
|
float | SI1133_get_light_level (void) |
|
float | SI1133_get_uv_index (void) |
|
◆ X_ORDER_MASK
#define X_ORDER_MASK 0x0070 |
◆ Y_ORDER_MASK
#define Y_ORDER_MASK 0x0007 |
◆ SIGN_MASK
◆ GET_X_ORDER
◆ GET_Y_ORDER
◆ GET_SIGN
#define GET_SIGN |
( |
|
m | ) |
( ((m) & SIGN_MASK) >> 7) |
◆ UV_INPUT_FRACTION
#define UV_INPUT_FRACTION 15 |
◆ UV_OUTPUT_FRACTION
#define UV_OUTPUT_FRACTION 12 |
◆ UV_NUMCOEFF
◆ ADC_THRESHOLD
#define ADC_THRESHOLD 16000 |
◆ INPUT_FRACTION_HIGH
#define INPUT_FRACTION_HIGH 7 |
◆ INPUT_FRACTION_LOW
#define INPUT_FRACTION_LOW 15 |
◆ LUX_OUTPUT_FRACTION
#define LUX_OUTPUT_FRACTION 12 |
◆ NUMCOEFF_LOW
◆ NUMCOEFF_HIGH
◆ UV_I2C_SEND
◆ UV_I2C_GET
◆ SI1133_CONFIRM_COUNT
#define SI1133_CONFIRM_COUNT (5) |
◆ SI1133_Write_Reg()
◆ SI1133_Write_Reg_block()
◆ SI1133_Read_Reg()
◆ SI1133_Read_Reg_block()
◆ SI1133_reset()
◆ SI1133_wait_until_sleep()
◆ SI1133_send_cmd()
◆ SI1133_force_measurement()
◆ SI1133_pause_measurement()
◆ SI1133_set_parameter()
◆ SI1133_calculate_polynomial_helper()
static int32_t SI1133_calculate_polynomial_helper |
( |
int32_t |
input, |
|
|
int8_t |
fraction, |
|
|
uint16_t |
mag, |
|
|
int8_t |
shift |
|
) |
| |
|
static |
◆ SI1133_calculate_polynomial()
static int32_t SI1133_calculate_polynomial |
( |
int32_t |
x, |
|
|
int32_t |
y, |
|
|
uint8_t |
input_fraction, |
|
|
uint8_t |
output_fraction, |
|
|
uint8_t |
num_coeff, |
|
|
const Si1133_coeff * |
kp |
|
) |
| |
|
static |
◆ SI1133_get_uv()
static int32_t SI1133_get_uv |
( |
int32_t |
uv | ) |
|
|
static |
◆ SI1133_get_lux()
static int32_t SI1133_get_lux |
( |
int32_t |
vis_high, |
|
|
int32_t |
vis_low, |
|
|
int32_t |
ir |
|
) |
| |
|
static |
◆ SI1133_init()
◆ SI1133_deinit()
◆ SI1133_measure()
◆ SI1133_get_hardware_id()
Si1133_error SI1133_get_hardware_id |
( |
uint8_t * |
hardware_id | ) |
|
◆ SI1133_measure_lux_uv()
Si1133_error SI1133_measure_lux_uv |
( |
float * |
lux, |
|
|
float * |
uvi |
|
) |
| |
◆ SI1133_get_measurement()
Si1133_error SI1133_get_measurement |
( |
float * |
lux, |
|
|
float * |
uvi |
|
) |
| |
◆ SI1133_get_light_level()
float SI1133_get_light_level |
( |
void |
| ) |
|
◆ SI1133_get_uv_index()
float SI1133_get_uv_index |
( |
void |
| ) |
|
◆ Si1133_lk
Initial value:=
{
{ { 0, 209 },
{ 1665, 93 },
{ 2064, 65 },
{ -2671, 234 } },
{ { 0, 0 },
{ 1921, 29053 },
{ -1022, 36363 },
{ 2320, 20789 },
{ -367, 57909 },
{ -1774, 38240 },
{ -608, 46775 },
{ -1503, 51831 },
{ -1886, 58928 } }
}
Definition at line 45 of file MZ_Addon_Si1133.c.
◆ Si1133_uk
Initial value:=
{
{ 1281, 30902 },
{ -638, 46301 }
}
Definition at line 67 of file MZ_Addon_Si1133.c.