ISSDK  1.8
IoT Sensing Software Development Kit
Macros | Functions | Variables
isl29023_poll.c File Reference

The isl29023_poll.c file implements the ISSDK ISL29023 sensor driver example demonstration in poll mode. More...

#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_debug_console.h"
#include "fsl_irqsteer.h"
#include "Driver_I2C.h"
#include "issdk_hal.h"
#include "isl29023_drv.h"
Include dependency graph for isl29023_poll.c:

Go to the source code of this file.

Macros

#define ISL29023_DATA_SIZE   (2) /* 2 bytes of information */
 The size of the ISL29023 sensor data. More...
 
#define ISL29023_INT_HT_DATA   (11000) /* HI-IRQ treshold value (relative to 16-bit res.)*/
 
#define ISL29023_INT_LT_DATA   (5000) /* LO-IRQ treshold value (relative to 16-bit res.)*/
 

Functions

int main (void)
 Main function. More...
 

Variables

const registerwritelist_t ISL29023_Config_Poll []
 
const registerreadlist_t ISL29023_Status [] = {{.readFrom = ISL29023_CMD_I, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t ISL29023_Output_Values []
 

Detailed Description

The isl29023_poll.c file implements the ISSDK ISL29023 sensor driver example demonstration in poll mode.

Definition in file isl29023_poll.c.

Macro Definition Documentation

◆ ISL29023_DATA_SIZE

#define ISL29023_DATA_SIZE   (2) /* 2 bytes of information */

The size of the ISL29023 sensor data.

Definition at line 34 of file isl29023_poll.c.

Referenced by main().

◆ ISL29023_INT_HT_DATA

#define ISL29023_INT_HT_DATA   (11000) /* HI-IRQ treshold value (relative to 16-bit res.)*/

Definition at line 43 of file isl29023_poll.c.

◆ ISL29023_INT_LT_DATA

#define ISL29023_INT_LT_DATA   (5000) /* LO-IRQ treshold value (relative to 16-bit res.)*/

Definition at line 44 of file isl29023_poll.c.

Function Documentation

◆ main()

int main ( void  )

Main function.

Initialize the MCU hardware.

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize the ISL29023 sensor driver.

Configure the ISL29023 sensor driver.

Wait for clear IRQ flag bit.

Read the raw sensor data from the ISL29023.

Convert the raw sensor data to signed 16-bit container for display to the debug port.

Definition at line 78 of file isl29023_poll.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), ISL29023_CMD_I_FLAG_MASK, ISL29023_DATA_SIZE, ISL29023_I2C_ADDRESS, ISL29023_I2C_Configure(), ISL29023_I2C_Initialize(), ISL29023_I2C_ReadData(), ISL29023_I2C_TEST_VALUE, isl29023_lightdata_t::light, rawData, SENSOR_ERROR_NONE, and status.

Here is the call graph for this function:

Variable Documentation

◆ ISL29023_Config_Poll

const registerwritelist_t ISL29023_Config_Poll[]
Initial value:
= {
{ISL29023_INT_LT_MSB, ((ISL29023_INT_LT_DATA & 0xFF00)>>8), 0xFF},
{ISL29023_INT_HT_MSB, ((ISL29023_INT_HT_DATA & 0xFF00)>>8), 0xFF},
#define ISL29023_CMD_I_OP_MASK
Definition: isl29023.h:58
#define ISL29023_CMD_II_RANGE_1
Definition: isl29023.h:113
#define ISL29023_CMD_I_OP_ALS_CONT
Definition: isl29023.h:74
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define ISL29023_CMD_I_PRST_MASK
Definition: isl29023.h:52
#define ISL29023_INT_LT_DATA
Definition: isl29023_poll.c:44
#define ISL29023_INT_HT_DATA
Definition: isl29023_poll.c:43
#define ISL29023_CMD_II_RANGE_MASK
Definition: isl29023.h:103
#define ISL29023_CMD_II_RES_MASK
Definition: isl29023.h:106
#define ISL29023_CMD_I_PRST_1
Definition: isl29023.h:65
#define ISL29023_CMD_II_RES_16
Definition: isl29023.h:117

Prepare the register write list to configure ISL29023 in 16-bits ALS continuous mode.

Definition at line 50 of file isl29023_poll.c.

◆ ISL29023_Output_Values

const registerreadlist_t ISL29023_Output_Values[]
Initial value:
= {
#define ISL29023_DATA_SIZE
The size of the ISL29023 sensor data.
Definition: isl29023_poll.c:34
#define __END_READ_DATA__
Definition: sensor_drv.h:51

Prepare the register read list to read the raw ADC data from the ISL29023.

Definition at line 69 of file isl29023_poll.c.

◆ ISL29023_Status

const registerreadlist_t ISL29023_Status[] = {{.readFrom = ISL29023_CMD_I, .numBytes = 1}, __END_READ_DATA__}

Prepare the register read list to read ISL29023 IRQ flag bit.

Definition at line 66 of file isl29023_poll.c.