XDK API  3.6.0
Documentation
Typedefs | Functions
Sensor_Node

Generic interface to the sensor node BSP API. More...

+ Collaboration diagram for Sensor_Node:

Typedefs

typedef void(* BSP_Sensor_InterruptCallback_T )(uint32_t, uint32_t)
 

Functions

Retcode_T BSP_SensorNode_Connect (void)
 Maps the GPIO pins to their desired function. More...
 
Retcode_T BSP_SensorNode_Disable (uint32_t id)
 Disables the control over the peripheral. More...
 
Retcode_T BSP_SensorNode_Disconnect (void)
 Disconnects the sensor node. More...
 
Retcode_T BSP_SensorNode_Enable (uint32_t id, BSP_Sensor_InterruptCallback_T callback)
 Enables the control over the peripheral. More...
 
HWHandle_T BSP_SensorNode_GetI2CHandle (void)
 Returns the handle of the communication interface used by the peripheral in case I2C is used for the sensor node. More...
 
bool BSP_SensorNode_IsAllNodesDisabled (void)
 Returns the boolean (TRUE/FALSE) based on the sensor node Enable/Disable status used by the peripheral in case I2C is used for the sensor node. More...
 

Detailed Description

Note
A sensor node is defined as a group of peripheral sensors sharing the same MCU resource such an I2C bus.

A prior call to BSP_Board_Initialize(param1, param2) function is necessary to initialize the MCU resources needed by the sensor node.

Once the sensor node is requested a call to BSP_SensorNode_Connect() function is required to map the internal MCU resources to their associated function.

The application needs get the handle for the MCU resource driver via BSP_SensorNode_GetHandle() and to initialize the MCU resource driver by calling the MCU_<RESOURCE>_Initialize() and providing it with the previously acquired handle and an event callback function.

Then a call to BSP_SensorNode_Enable() will execute the required sequence to enable the specified sensor peripheral and the MCU resources dedicated for it (UART, SPI, I2C, etc.) and will associate the interrupt requests to their appropriate service routines.

Note
It is necessary for the application developer to to check if the specified sensor has dedicated interrupt lines in this case the application developer must provide a callback to process those interrupts.

The BSP_SensorNode_Disable() will revert back what the BSP_SensorNode_Enable() has done and set the sensor and the MCU resource into disabled state.

The BSP_SensorNode_Disconnect() will put the GPIO pins associated to the sensors peripheral in analog mode to further reduce the consumption.

Typedef Documentation

typedef void(* BSP_Sensor_InterruptCallback_T)(uint32_t, uint32_t)

type definition for the sensor callback This callback is created by the application whenever the sensor has dedicated interrupt lines. The application should then pass the callback at the BSP_SensorNode_Enable() function.

the first parameter is the interrupt identifier and the second parameter is the edge resulted in the interrupt (falling edge or rising) refer to the implementation for more details.

Function Documentation

Retcode_T BSP_SensorNode_Connect ( void  )

This function once called will map the GPIO pins related to the sensor node to their desired functions.

Return values
RETCODE_OKin the case of success or an error code otherwise.

+ Here is the caller graph for this function:

Retcode_T BSP_SensorNode_Disable ( uint32_t  id)

This function once called will disable control over the requested sensor peripheral by executing the disabling procedure as prescribed in the vendor datasheet.

Parameters
ididentifier of the sensor targeted by the disable request. This is defined in the Board Interface under the BSP_Sensor_E enumeration.
Return values
RETCODE_OKin the case of success or an error code otherwise.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Retcode_T BSP_SensorNode_Disconnect ( void  )

This function disconnects the GPIO pins dedicated to the sensor node and put them into low power consumption status.

Return values
RETCODE_OKin the case of success or an error code otherwise.

+ Here is the caller graph for this function:

Retcode_T BSP_SensorNode_Enable ( uint32_t  id,
BSP_Sensor_InterruptCallback_T  callback 
)

A prior call to MCU_<RESOURCE>_Initialize() is necessary for this function in order to operate.This function once called will allow the required sensor peripheral to receive, execute commands and transmit process data.

Parameters
ididentifier of the sensor targeted by the enable request.
callbackIf the sensor has dedicated interrupt lines a callback is required to process the generated events.
Return values
RETCODE_OKin the case of success or an error code otherwise.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HWHandle_T BSP_SensorNode_GetI2CHandle ( void  )

After successful execution of BSP_Board_Initialize(param1, param2), the application is free to call this function in order to get the handle needed by the resources drivers. This handle will be used by the MCU drivers for the intended resources I2C, SPI, UART, etc.

Returns
HWHandle_T: Handle for the used MCU resource.

+ Here is the caller graph for this function:

bool BSP_SensorNode_IsAllNodesDisabled ( void  )

only after successful Disable of all the sensor nodes this API will return TRUE. Even if one sensor node is enabled then we get FALSE from this API

Returns
Bool: Boolean (TRUE/FALSE).

+ Here is the caller graph for this function:


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:53 by doxygen 1.8.8