STSW-STLKT01: Drivers/BSP/SensorTile/SensorTile.c File Reference

STSW-STLKT01

STSW-STLKT01
SensorTile.c File Reference

This file provides low level functionalities for Sensor Tile board. More...

#include "SensorTile.h"

Go to the source code of this file.

Macros

#define __SensorTile_BSP_VERSION_MAIN   (0x01)
 SensorTile BSP Driver version number V1.0.0. More...
 
#define __SensorTile_BSP_VERSION_SUB1   (0x00)
 
#define __SensorTile_BSP_VERSION_SUB2   (0x00)
 
#define __SensorTile_BSP_VERSION_RC   (0x00)
 
#define __SensorTile_BSP_VERSION
 

Functions

static void I2C_SENSORTILE_MspInit (void)
 I2C MSP Initialization. More...
 
static void I2C_SENSORTILE_Error (uint8_t Addr)
 Manages error callback by re-initializing I2C. More...
 
static uint8_t I2C_SENSORTILE_ReadData (uint8_t Addr, uint8_t Reg, uint8_t *pBuffer, uint16_t Size)
 Read a register of the device through BUS. More...
 
static uint8_t I2C_SENSORTILE_WriteData (uint8_t Addr, uint8_t Reg, uint8_t *pBuffer, uint16_t Size)
 Write data to the register of the device through BUS. More...
 
static uint8_t I2C_SENSORTILE_Init (void)
 Configures I2C interface. More...
 
static void SD_IO_SPI_Init (void)
 Initializes SPI HAL. High baundrate. More...
 
static void SD_IO_SPI_Init_LS (void)
 Initializes SPI HAL. Low baundrate for initializazion phase. More...
 
static void SD_IO_SPI_Write (uint8_t Value)
 SPI Write a byte to device. More...
 
static uint32_t SD_IO_SPI_Read (void)
 SPI Read 4 bytes from device. More...
 
static void SD_IO_SPI_Error (void)
 SPI error treatment function. More...
 
static void SD_IO_SPI_MspInit (SPI_HandleTypeDef *hspi)
 Initializes SPI MSP. More...
 
void SPI_Read (SPI_HandleTypeDef *xSpiHandle, uint8_t *val)
 This function reads a single byte on SPI 3-wire. More...
 
void SPI_Read_nBytes (SPI_HandleTypeDef *xSpiHandle, uint8_t *val, uint16_t nBytesToRead)
 This function reads multiple bytes on SPI 3-wire. More...
 
void SPI_Write (SPI_HandleTypeDef *xSpiHandle, uint8_t val)
 This function writes a single byte on SPI 3-wire. More...
 
void SD_IO_Init (void)
 Initializes the SD Card and put it into StandBy State (Ready for data transfer). More...
 
void SD_IO_Init_LS ()
 Initializes the SD Card and put it into StandBy State (Ready for data transfer). Low baundrate. More...
 
HAL_StatusTypeDef SD_IO_WriteCmd (uint8_t Cmd, uint32_t Arg, uint8_t Crc, uint8_t Response)
 Sends 5 bytes command to the SD card and get response. More...
 
uint8_t SD_IO_WriteCmd_wResp (uint8_t Cmd, uint32_t Arg, uint8_t Crc)
 Sends 5 bytes command to the SD card and get response. More...
 
HAL_StatusTypeDef SD_IO_WaitResponse (uint8_t Response)
 Waits response from the SD card. More...
 
void SD_IO_WriteDummy (void)
 Sends dummy byte with CS High. More...
 
void SD_IO_WriteByte (uint8_t Data)
 Writes a byte on the SD. More...
 
uint8_t SD_IO_ReadByte (void)
 Reads a byte from the SD. More...
 
void SD_IO_WriteDMA (uint8_t *pData, uint16_t Size)
 Writes a block by DMA on the SD. More...
 
uint32_t BSP_GetVersion (void)
 This method returns the STM32446E EVAL BSP Driver revision. More...
 
void BSP_LED_Init (Led_TypeDef Led)
 Configures LEDs. More...
 
void BSP_LED_DeInit (Led_TypeDef Led)
 DeInit LEDs. More...
 
void BSP_LED_On (Led_TypeDef Led)
 Turns selected LED On. More...
 
void BSP_LED_Off (Led_TypeDef Led)
 Turns selected LED Off. More...
 
void BSP_LED_Toggle (Led_TypeDef Led)
 Toggles the selected LED. More...
 
DrvStatusTypeDef Sensor_IO_I2C_Init (void)
 Configures sensor SPI interface. More...
 
DrvStatusTypeDef Sensor_IO_SPI_Init (void)
 Configures sensor SPI interface. More...
 
uint8_t Sensor_IO_SPI_CS_Init_All (void)
 
uint8_t Sensor_IO_SPI_CS_Init (void *handle)
 
uint8_t Sensor_IO_Write (void *handle, uint8_t WriteAddr, uint8_t *pBuffer, uint16_t nBytesToWrite)
 Writes a buffer to the sensor. More...
 
uint8_t Sensor_IO_I2C_Write (void *handle, uint8_t WriteAddr, uint8_t *pBuffer, uint16_t nBytesToWrite)
 Writes a buffer to the sensor by I2C. More...
 
uint8_t Sensor_IO_Read (void *handle, uint8_t ReadAddr, uint8_t *pBuffer, uint16_t nBytesToRead)
 Reads from the sensor to a buffer. More...
 
uint8_t Sensor_IO_I2C_Read (void *handle, uint8_t ReadAddr, uint8_t *pBuffer, uint16_t nBytesToRead)
 Reads from the sensor to a buffer by I2C. More...
 
uint8_t Sensor_IO_SPI_Write (void *handle, uint8_t WriteAddr, uint8_t *pBuffer, uint16_t nBytesToWrite)
 Writes a buffer to the sensor. More...
 
uint8_t Sensor_IO_SPI_Read (void *handle, uint8_t ReadAddr, uint8_t *pBuffer, uint16_t nBytesToRead)
 Reads a from the sensor to buffer. More...
 
uint8_t Sensor_IO_SPI_CS_Enable (void *handle)
 
uint8_t Sensor_IO_SPI_CS_Disable (void *handle)
 
DrvStatusTypeDef LSM6DSM_Sensor_IO_ITConfig (void)
 Configures sensor interrupts interface for LSM6DSM sensor. More...
 
void SD_IO_CS_Init (void)
 
void SD_IO_CS_DeInit (void)
 

Variables

static uint32_t I2C_SENSORTILE_Timeout = SENSORTILE_I2C_ONBOARD_SENSORS_TIMEOUT_MAX
 
static I2C_HandleTypeDef I2C_SENSORTILE_Handle
 
static SPI_HandleTypeDef SPI_Sensor_Handle
 
SPI_HandleTypeDef SPI_SD_Handle
 
DMA_HandleTypeDef hdma_tx
 
GPIO_TypeDef * GPIO_PORT [LEDn] = {LED1_GPIO_PORT, LEDSWD_GPIO_PORT}
 
const uint32_t GPIO_PIN [LEDn] = {LED1_PIN, LEDSWD_PIN}
 
uint32_t SpixTimeout = SENSORTILE_SD_SPI_TIMEOUT_MAX
 

Detailed Description

This file provides low level functionalities for Sensor Tile board.

Author
Central Labs
Version
V1.3.1
Date
27-Apr-2017
Attention

© COPYRIGHT(c) 2015 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file SensorTile.c.

Generated by   doxygen 1.8.13