I2C_Drivers (ARM) 1.1
SMFSW collection of HAL I2C Drivers for ARM
Loading...
Searching...
No Matches
S11059.h File Reference

S11059 Driver. More...

#include "sarmfsw.h"
#include "I2C_component.h"
#include "I2C_peripheral.h"
#include "S11059_proc.h"
#include "S11059_ex.h"
Include dependency graph for S11059.h:
This graph shows which files directly or indirectly include this file:

Data Structures

union  uS11059_REG__CONTROL
 Union for CONTROL register of S11059. More...
 

Macros

#define I2C_S11059_NB   1U
 Number of S11059 peripherals.
 
#define S11059_ADDR   0x2AU
 S11059 address.
 
#define S11059_BASE_ADDR   S11059_ADDR
 S11059 Base address.
 

Enumerations

enum  S11059_reg {
  S11059__CONTROL = 0U , S11059__MANUAL_TIMING_MSB , S11059__MANUAL_TIMING_LSB , S11059__RED_DATA_MSB ,
  S11059__RED_DATA_LSB , S11059__GREEN_DATA_MSB , S11059__GREEN_DATA_LSB , S11059__BLUE_DATA_MSB ,
  S11059__BLUE_DATA_LSB , S11059__IR_DATA_MSB , S11059__IR_DATA_LSB
}
 Register map enum of S11059. More...
 
enum  S11059_prescaler { S11059__INTEG_87_5US = 0U , S11059__INTEG_1_4MS , S11059__INTEG_22_4MS , S11059__INTEG_179_2MS }
 Integration times of S11059. More...
 
enum  S11059_integ { S11059__FIXED_PERIOD_INTEGRATION = 0U , S11059__MANUAL_INTEGRATION }
 Integration modes of S11059. More...
 
enum  S11059_gain { S11059__LOW_GAIN = 0U , S11059__HIGH_GAIN }
 Gain values of S11059. More...
 
enum  S11059_standby_fct { S11059__OPERATING_MODE = 0U , S11059__STANDBY_MODE }
 Standby function of S11059. More...
 
enum  S11059_adc_reset { S11059__ADC_OPERATION = 0U , S11059__ADC_RESET }
 ADC operation mode of S11059. More...
 

Functions

FctERR S11059_Init (const uint8_t idx, I2C_HandleTypeDef *const hi2c, const uint16_t devAddress)
 Initialization for S11059 peripheral.
 
FctERR S11059_Init_Single (void)
 Initialization for S11059 peripheral.
 
FctERR S11059_Write (I2C_slave_t *const pSlave, const uint8_t *data, const uint16_t addr, const uint16_t nb)
 I2C Write function for S11059.
 
FctERR S11059_Read (I2C_slave_t *const pSlave, uint8_t *data, const uint16_t addr, const uint16_t nb)
 I2C Read function for S11059.
 
FctERR S11059_Write_Word (I2C_slave_t *const pSlave, const uint16_t *data, const uint16_t addr)
 I2C Word Write (big endian) function for S11059.
 
FctERR S11059_Read_Word (I2C_slave_t *const pSlave, uint16_t *data, const uint16_t addr)
 I2C Word Read (big endian) function for S11059.
 

Detailed Description

S11059 Driver.

Author
SMFSW

S11059: I2C interface-compatible color sensor

Macro Definition Documentation

◆ I2C_S11059_NB

#define I2C_S11059_NB   1U

Number of S11059 peripherals.

Note
Define I2C_S11059_NB to enable multiple peripherals of this type

◆ S11059_ADDR

#define S11059_ADDR   0x2AU

S11059 address.

◆ S11059_BASE_ADDR

#define S11059_BASE_ADDR   S11059_ADDR

S11059 Base address.

Note
Define S11059_BASE_ADDR to change default device base address

Enumeration Type Documentation

◆ S11059_adc_reset

ADC operation mode of S11059.

Enumerator
S11059__ADC_OPERATION 

Operation.

S11059__ADC_RESET 

Reset.

◆ S11059_gain

Gain values of S11059.

Enumerator
S11059__LOW_GAIN 

Low gain mode (x1)

S11059__HIGH_GAIN 

High gain mode (x10)

◆ S11059_integ

Integration modes of S11059.

Enumerator
S11059__FIXED_PERIOD_INTEGRATION 

Fixed period mode.

S11059__MANUAL_INTEGRATION 

Manual setting mode.

◆ S11059_prescaler

Integration times of S11059.

Enumerator
S11059__INTEG_87_5US 

87.5us integration time

S11059__INTEG_1_4MS 

1.4ms integration time

S11059__INTEG_22_4MS 

22.4ms integration time

S11059__INTEG_179_2MS 

179.2ms integration time

◆ S11059_reg

enum S11059_reg

Register map enum of S11059.

Enumerator
S11059__CONTROL 

Control register.

S11059__MANUAL_TIMING_MSB 

Manual timing register MSB.

S11059__MANUAL_TIMING_LSB 

Manual timing register LSB.

S11059__RED_DATA_MSB 

Sensor data register Red MSB.

S11059__RED_DATA_LSB 

Sensor data register Red LSB.

S11059__GREEN_DATA_MSB 

Sensor data register Green MSB.

S11059__GREEN_DATA_LSB 

Sensor data register Green LSB.

S11059__BLUE_DATA_MSB 

Sensor data register Blue MSB.

S11059__BLUE_DATA_LSB 

Sensor data register Blue LSB.

S11059__IR_DATA_MSB 

Sensor data register Infra-red MSB.

S11059__IR_DATA_LSB 

Sensor data register Infra-red LSB.

◆ S11059_standby_fct

Standby function of S11059.

Enumerator
S11059__OPERATING_MODE 

Operating mode.

S11059__STANDBY_MODE 

Standby mode.

Function Documentation

◆ S11059_Init()

FctERR S11059_Init ( const uint8_t idx,
I2C_HandleTypeDef *const hi2c,
const uint16_t devAddress )

Initialization for S11059 peripheral.

Parameters
[in]idx- S11059 index
[in]hi2c- pointer to S11059 I2C instance
[in]devAddress- S11059 device address
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ S11059_Init_Single()

FctERR S11059_Init_Single ( void )

Initialization for S11059 peripheral.

Warning
In case multiple devices (defined by I2C_S11059_NB > 1), you shall use S11059_Init instead
Returns
FctERR - error code
Here is the call graph for this function:

◆ S11059_Read()

FctERR S11059_Read ( I2C_slave_t *const pSlave,
uint8_t * data,
const uint16_t addr,
const uint16_t nb )

I2C Read function for S11059.

Parameters
[in,out]pSlave- Pointer to I2C slave instance
[in,out]data- pointer to read to
[in]addr- Address to read from
[in]nb- Number of bytes to read
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ S11059_Read_Word()

FctERR S11059_Read_Word ( I2C_slave_t *const pSlave,
uint16_t * data,
const uint16_t addr )

I2C Word Read (big endian) function for S11059.

Parameters
[in,out]pSlave- Pointer to I2C slave instance
[in,out]data- pointer to read to
[in]addr- Address to read from
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ S11059_Write()

FctERR S11059_Write ( I2C_slave_t *const pSlave,
const uint8_t * data,
const uint16_t addr,
const uint16_t nb )

I2C Write function for S11059.

Parameters
[in,out]pSlave- Pointer to I2C slave instance
[in]data- pointer to write from
[in]addr- Address to write to
[in]nb- Number of bytes to write
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ S11059_Write_Word()

FctERR S11059_Write_Word ( I2C_slave_t *const pSlave,
const uint16_t * data,
const uint16_t addr )

I2C Word Write (big endian) function for S11059.

Parameters
[in,out]pSlave- Pointer to I2C slave instance
[in]data- pointer to write from
[in]addr- Address to write to
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function: