RA Flexible Software Package Documentation
Release v5.6.0
|
|
Interface for OB1203 Middleware functions.
The OB1203 interface provides OB1203 functionality.
Data Structures | |
struct | rm_ob1203_callback_args_t |
struct | rm_ob1203_raw_data_t |
struct | rm_ob1203_light_data_t |
struct | rm_ob1203_prox_data_t |
struct | rm_ob1203_ppg_data_t |
struct | rm_ob1203_device_interrupt_cfg_t |
struct | rm_ob1203_device_status_t |
struct | rm_ob1203_gain_t |
struct | rm_ob1203_led_current_t |
struct | rm_ob1203_fifo_info_t |
struct | rm_ob1203_cfg_t |
struct | rm_ob1203_api_t |
struct | rm_ob1203_instance_t |
Typedefs | |
typedef void | rm_ob1203_ctrl_t |
struct rm_ob1203_callback_args_t |
OB1203 callback parameter definition
struct rm_ob1203_raw_data_t |
struct rm_ob1203_light_data_t |
OB1203 light data structure
struct rm_ob1203_prox_data_t |
struct rm_ob1203_ppg_data_t |
struct rm_ob1203_device_interrupt_cfg_t |
OB1203 device interrupt configuration structure
Data Fields | ||
---|---|---|
rm_ob1203_operation_mode_t | light_prox_mode | Light Proximity mode only. If Light mode uses IRQ, set RM_OB1203_OPERATION_MODE_LIGHT. If Proximity mode uses IRQ, set RM_OB1203_OPERATION_MODE_PROXIMITY. |
rm_ob1203_light_interrupt_type_t | light_type | Light mode interrupt type. |
rm_ob1203_light_interrupt_source_t | light_source | Light mode interrupt source. |
rm_ob1203_prox_interrupt_type_t | prox_type | Proximity mode interrupt type. |
uint8_t | persist | The number of similar consecutive Light mode or Proximity interrupt events that must occur before the interrupt is asserted (4bits). |
rm_ob1203_ppg_interrupt_type_t | ppg_type | PPG mode interrupt type. |
struct rm_ob1203_device_status_t |
OB1203 device status
struct rm_ob1203_gain_t |
OB1203 Gain structure
Data Fields | ||
---|---|---|
rm_ob1203_light_gain_t | light | Gain for Light mode. |
rm_ob1203_ppg_prox_gain_t | ppg_prox | Gain for PPG mode and Proximity mode. |
struct rm_ob1203_led_current_t |
struct rm_ob1203_fifo_info_t |
OB1203 FIFO information structure
struct rm_ob1203_cfg_t |
OB1203 Configuration
Data Fields | |
rm_ob1203_semaphore_t const * | p_semaphore |
The semaphore to wait for callback. This is used for another data read/write after a communication. | |
uint32_t | semaphore_timeout |
timeout for callback. | |
rm_comms_instance_t const * | p_comms_instance |
Pointer to Communications Middleware instance. | |
void const * | p_irq_instance |
Pointer to IRQ instance. | |
void const * | p_context |
Pointer to the user-provided context. | |
void const * | p_extend |
Pointer to extended configuration by instance of interface. | |
void(* | p_comms_callback )(rm_ob1203_callback_args_t *p_args) |
I2C Communications callback. | |
void(* | p_irq_callback )(rm_ob1203_callback_args_t *p_args) |
IRQ callback. | |
struct rm_ob1203_api_t |
OB1203 APIs
fsp_err_t(* rm_ob1203_api_t::open) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_cfg_t const *const p_cfg) |
Open sensor.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to configuration structure. |
fsp_err_t(* rm_ob1203_api_t::measurementStart) (rm_ob1203_ctrl_t *const p_ctrl) |
Start measurement.
[in] | p_ctrl | Pointer to control structure. |
[in] | mode | Sensor mode. |
fsp_err_t(* rm_ob1203_api_t::measurementStop) (rm_ob1203_ctrl_t *const p_ctrl) |
Stop measurement.
[in] | p_ctrl | Pointer to control structure. |
[in] | mode | Sensor mode. |
fsp_err_t(* rm_ob1203_api_t::lightRead) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_raw_data_t *const p_raw_data, rm_ob1203_light_data_type_t type) |
Read Light ADC data from OB1203.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_raw_data | Pointer to raw data structure. |
[in] | type | Light data type. |
fsp_err_t(* rm_ob1203_api_t::lightDataCalculate) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_raw_data_t *const p_raw_data, rm_ob1203_light_data_t *const p_ob1203_data) |
Calculate Light data from raw data.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_raw_data | Pointer to raw data structure. |
[in] | p_ob1203_data | Pointer to OB1203 Light data structure. |
fsp_err_t(* rm_ob1203_api_t::proxRead) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_raw_data_t *const p_raw_data) |
Read Proximity ADC data from OB1203.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_raw_data | Pointer to raw data structure. |
fsp_err_t(* rm_ob1203_api_t::proxDataCalculate) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_raw_data_t *const p_raw_data, rm_ob1203_prox_data_t *const p_ob1203_data) |
Calculate Proximity data from raw data.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_raw_data | Pointer to raw data structure. |
[in] | p_ob1203_data | Pointer to OB1203 Proximity data structure. |
fsp_err_t(* rm_ob1203_api_t::ppgRead) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_raw_data_t *const p_raw_data, uint8_t const number_of_samples) |
Read PPG ADC data from OB1203.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_raw_data | Pointer to raw data structure. |
[in] | number_of_samples | Number of PPG samples. One sample is 3 bytes. |
fsp_err_t(* rm_ob1203_api_t::ppgDataCalculate) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_raw_data_t *const p_raw_data, rm_ob1203_ppg_data_t *const p_ob1203_data) |
Calculate PPG data from raw data.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_raw_data | Pointer to raw data structure. |
[in] | p_ob1203_data | Pointer to OB1203 PPG data structure. |
fsp_err_t(* rm_ob1203_api_t::deviceStatusGet) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_device_status_t *const p_status) |
Get device status. Read STATUS_0 and STATUS_1 registers.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_status | Pointer to device status. |
fsp_err_t(* rm_ob1203_api_t::deviceInterruptCfgSet) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_device_interrupt_cfg_t const interrupt_cfg) |
Set device interrupt configuration.
[in] | p_ctrl | Pointer to control structure. |
[in] | interrupt_cfg | Device interrupt configuration. |
fsp_err_t(* rm_ob1203_api_t::gainSet) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_gain_t const gain) |
Set gain.
[in] | p_ctrl | Pointer to control structure. |
[in] | gain | Gain configuration. |
fsp_err_t(* rm_ob1203_api_t::ledCurrentSet) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_led_current_t const led_current) |
Set LED current value.
[in] | p_ctrl | Pointer to control structure. |
[in] | led_current | Current value structure. |
fsp_err_t(* rm_ob1203_api_t::fifoInfoGet) (rm_ob1203_ctrl_t *const p_ctrl, rm_ob1203_fifo_info_t *const p_fifo_info) |
Get FIFO information.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_fifo_info | Pointer to FIFO information (write index, read index and overflow counter). |
fsp_err_t(* rm_ob1203_api_t::close) (rm_ob1203_ctrl_t *const p_ctrl) |
Close OB1203.
[in] | p_ctrl | Pointer to control structure. |
struct rm_ob1203_instance_t |
OB1203 instance
Data Fields | ||
---|---|---|
rm_ob1203_ctrl_t * | p_ctrl |
Pointer to the control structure for this instance |
rm_ob1203_cfg_t const * | p_cfg |
Pointer to the configuration structure for this instance |
rm_ob1203_api_t const * | p_api |
Pointer to the API structure for this instance |
typedef void rm_ob1203_ctrl_t |
OB1203 control block. Allocate an instance specific control block to pass into the OB1203 API calls.
enum rm_ob1203_event_t |
Event in the callback function
Data type of Light
Light interrupt source
Variance threshold
Moving average
Number of averaged samples
Light resolution and measurement period
Proximity pulse width and measurement period
PPG pulse width and measurement period
FIFO Rollover