LibDriver UVIS25
Loading...
Searching...
No Matches
driver_uvis25.h File Reference

driver uvis25 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_uvis25.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uvis25_handle_s
 uvis25 handle structure definition More...
struct  uvis25_info_s
 uvis25 information structure definition More...

Macros

#define DRIVER_UVIS25_LINK_INIT(HANDLE, STRUCTURE)
 initialize uvis25_handle_t structure
#define DRIVER_UVIS25_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_UVIS25_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_UVIS25_LINK_IIC_READ(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_UVIS25_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_UVIS25_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_UVIS25_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_UVIS25_LINK_SPI_READ(HANDLE, FUC)
 link spi_read function
#define DRIVER_UVIS25_LINK_SPI_WRITE(HANDLE, FUC)
 link spi_write function
#define DRIVER_UVIS25_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_UVIS25_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_UVIS25_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

Typedefs

typedef struct uvis25_handle_s uvis25_handle_t
 uvis25 handle structure definition
typedef struct uvis25_info_s uvis25_info_t
 uvis25 information structure definition

Enumerations

enum  uvis25_bool_t { UVIS25_BOOL_FALSE = 0x00 , UVIS25_BOOL_TRUE = 0x01 }
 uvis25 bool enumeration definition More...
enum  uvis25_spi_wire_t { UVIS25_SPI_WIRE_4 = 0x00 , UVIS25_SPI_WIRE_3 = 0x01 }
 uvis25 spi wire enumeration definition More...
enum  uvis25_interface_t { UVIS25_INTERFACE_IIC = 0x00 , UVIS25_INTERFACE_SPI = 0x01 }
 uvis25 interface enumeration definition More...
enum  uvis25_boot_mode_t { UVIS25_BOOT_NORMAL_MODE = 0x00 , UVIS25_BOOT_REBOOT_MEMORY_CONTENT = 0x01 }
 uvis25 boot enumeration definition More...
enum  uvis25_interrupt_active_level_t { UVIS25_INTERRUPT_ACTIVE_LEVEL_HIGHER = 0x00 , UVIS25_INTERRUPT_ACTIVE_LEVEL_LOWER = 0x01 }
 uvis25 interrupt active level enumeration definition More...
enum  uvis25_interrupt_pin_type_t { UVIS25_INTERRUPT_PIN_TYPE_PUSH_PULL = 0x00 , UVIS25_INTERRUPT_PIN_TYPE_OPEN_DRAIN = 0x01 }
 uvis25 interrupt pin type enumeration definition More...
enum  uvis25_interrupt_type_t { UVIS25_INTERRUPT_TYPE_DATA_READY = 0x00 , UVIS25_INTERRUPT_TYPE_UV_INDEX_HIGH = 0x01 , UVIS25_INTERRUPT_TYPE_UV_INDEX_LOW = 0x02 , UVIS25_INTERRUPT_TYPE_UV_INDEX_HIGH_LOW = 0x03 }
 uvis25 interrupt type enumeration definition More...
enum  uvis25_interrupt_t { UVIS25_INTERRUPT_ACTIVE = 0x00 , UVIS25_INTERRUPT_HIGHER = 0x01 , UVIS25_INTERRUPT_LOWER = 0x02 }
 uvis25 interrupt status enumeration definition More...

Functions

uint8_t uvis25_info (uvis25_info_t *info)
 get chip's information
uint8_t uvis25_init (uvis25_handle_t *handle)
 initialize the chip
uint8_t uvis25_deinit (uvis25_handle_t *handle)
 close the chip
uint8_t uvis25_single_read (uvis25_handle_t *handle, uint8_t *raw, float *uv)
 read data once
uint8_t uvis25_start_continuous_read (uvis25_handle_t *handle)
 start reading
uint8_t uvis25_stop_continuous_read (uvis25_handle_t *handle)
 stop reading
uint8_t uvis25_continuous_read (uvis25_handle_t *handle, uint8_t *raw, float *uv)
 read data continuously
uint8_t uvis25_set_interface (uvis25_handle_t *handle, uvis25_interface_t interface)
 set the chip interface
uint8_t uvis25_get_interface (uvis25_handle_t *handle, uvis25_interface_t *interface)
 get the chip interface
uint8_t uvis25_irq_handler (uvis25_handle_t *handle)
 irq handler
uint8_t uvis25_set_block_data_update (uvis25_handle_t *handle, uvis25_bool_t enable)
 enable or disable blocking data update
uint8_t uvis25_get_block_data_update (uvis25_handle_t *handle, uvis25_bool_t *enable)
 get blocking data update status
uint8_t uvis25_set_boot (uvis25_handle_t *handle, uvis25_boot_mode_t mode)
 set the boot mode
uint8_t uvis25_get_boot (uvis25_handle_t *handle, uvis25_boot_mode_t *mode)
 get the boot mode
uint8_t uvis25_set_iic (uvis25_handle_t *handle, uvis25_bool_t enable)
 enable or disable the chip iic
uint8_t uvis25_get_iic (uvis25_handle_t *handle, uvis25_bool_t *enable)
 get the chip iic status
uint8_t uvis25_set_spi_wire (uvis25_handle_t *handle, uvis25_spi_wire_t wire)
 set the spi wire
uint8_t uvis25_get_spi_wire (uvis25_handle_t *handle, uvis25_spi_wire_t *wire)
 get the spi wire
uint8_t uvis25_set_interrupt_active_level (uvis25_handle_t *handle, uvis25_interrupt_active_level_t level)
 set the interrupt active level
uint8_t uvis25_get_interrupt_active_level (uvis25_handle_t *handle, uvis25_interrupt_active_level_t *level)
 get the interrupt active level
uint8_t uvis25_set_interrupt_pin_type (uvis25_handle_t *handle, uvis25_interrupt_pin_type_t pin_type)
 set the interrupt pin type
uint8_t uvis25_get_interrupt_pin_type (uvis25_handle_t *handle, uvis25_interrupt_pin_type_t *pin_type)
 get the interrupt pin type
uint8_t uvis25_set_interrupt_type (uvis25_handle_t *handle, uvis25_interrupt_type_t type)
 set the interrupt type
uint8_t uvis25_get_interrupt_type (uvis25_handle_t *handle, uvis25_interrupt_type_t *type)
 get the interrupt type
uint8_t uvis25_set_interrupt (uvis25_handle_t *handle, uvis25_bool_t enable)
 enable or disable the chip interrupt
uint8_t uvis25_get_interrupt (uvis25_handle_t *handle, uvis25_bool_t *enable)
 get the chip interrupt status
uint8_t uvis25_set_latch_interrupt (uvis25_handle_t *handle, uvis25_bool_t enable)
 enable or disable latching interrupt
uint8_t uvis25_get_latch_interrupt (uvis25_handle_t *handle, uvis25_bool_t *enable)
 get the latching interrupt status
uint8_t uvis25_set_interrupt_low_threshold (uvis25_handle_t *handle, uvis25_bool_t enable)
 enable or disable the low threshold interrupt
uint8_t uvis25_get_interrupt_low_threshold (uvis25_handle_t *handle, uvis25_bool_t *enable)
 get the low threshold interrupt status
uint8_t uvis25_set_interrupt_high_threshold (uvis25_handle_t *handle, uvis25_bool_t enable)
 enable or disable the high threshold interrupt
uint8_t uvis25_get_interrupt_high_threshold (uvis25_handle_t *handle, uvis25_bool_t *enable)
 get the high threshold interrupt status
uint8_t uvis25_set_threshold (uvis25_handle_t *handle, uint8_t threshold)
 set the interrupt threshold
uint8_t uvis25_get_threshold (uvis25_handle_t *handle, uint8_t *threshold)
 get the interrupt threshold
uint8_t uvis25_threshold_convert_to_register (uvis25_handle_t *handle, float uv, uint8_t *reg)
 convert a uv index to a raw register data
uint8_t uvis25_threshold_convert_to_data (uvis25_handle_t *handle, uint8_t reg, float *uv)
 convert a raw register data to a converted uv index
uint8_t uvis25_set_reg (uvis25_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t uvis25_get_reg (uvis25_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver uvis25 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
2.0.0
Author
Shifeng Li
Date
2021-03-24

history

Date Version Author Description
2021/03/24 2.0 Shifeng Li format the code
2020/12/06 1.0 Shifeng Li first upload

Definition in file driver_uvis25.h.