Revision 3ed0cc4d drivers/VL53L1X/v1/api/platform/vl53l1_platform_user_data.h

View differences:

drivers/VL53L1X/v1/api/platform/vl53l1_platform_user_data.h
59 59
*
60 60
********************************************************************************
61 61
*
62
* Modified for use within AMiRo-LLD.
63
*
64
* AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous
65
* Mini Robot (AMiRo) platform.
66
* Copyright (C) 2016..2019  Thomas Schöpping et al.
67
*
68
********************************************************************************
69
*
62 70
*/
63 71

  
64 72
#ifndef _VL53L1_PLATFORM_USER_DATA_H_
65 73
#define _VL53L1_PLATFORM_USER_DATA_H_
66
// #include "stm32xxx_hal.h"
74

  
67 75
#include "vl53l1_def.h"
68
#include <alld_VL53L1X_types.h>
76
#include <periphAL.h>
77

  
69 78
#ifdef __cplusplus
70 79
extern "C"
71 80
{
72 81
#endif
73 82

  
83
/**
84
 * @brief VL53L1X interface related data structure.
85
 */
86
typedef struct {
87
  /**
88
   * @brief   Pointer to the associated I2C driver.
89
   */
90
  apalI2CDriver_t* i2cd;
91

  
92
  /**
93
   * @brief   Currently set I2C device address.
94
   */
95
  apalI2Caddr_t addr;
74 96

  
75
// typedef struct {
76
//     uint32_t dummy;
77
// } I2C_HandleTypeDef;
97
  /**
98
   * @brief   Pointer to the GPIO driver for the GPIO1 signal.
99
   */
100
  const apalControlGpio_t* gpio1;
78 101

  
79
typedef struct {
102
  /**
103
   * @brief   Pointer to the GPIO driver for the XSHUT signal.
104
   */
105
  const apalControlGpio_t* xshut;
106
} VL53L1_IfData_t;
80 107

  
81
	VL53L1_DevData_t   Data;
108
/**
109
 * @brief   VL53L1X device driver structure as to be used by the ST API.
110
 */
111
typedef struct {
112
  /**
113
   * @brief   Device data as specified by the ST API.
114
   */
115
  VL53L1_DevData_t   Data;
82 116

  
83
	// uint8_t   I2cDevAddr;
84
	// uint8_t   comms_type;
85
	// uint16_t  comms_speed_khz;
86
	// uint32_t  new_data_ready_poll_duration_ms;
87
	// I2C_HandleTypeDef *I2cHandle;
88
	VL53L1XDriver vl53l1x;
117
  /**
118
   * @brief   Interface data.
119
   */
120
  VL53L1_IfData_t     Interface;
89 121

  
90 122
} VL53L1_Dev_t;
91 123

  
124
/**
125
 * @brief   Typedef as it is used by the ST API.
126
 */
92 127
typedef VL53L1_Dev_t *VL53L1_DEV;
93 128

  
129
/**
130
 * @brief   Typedef matching the PeriphAL conventions.
131
 */
132
typedef VL53L1_Dev_t VL53L1XDriver;
133

  
94 134
#define VL53L1DevDataGet(Dev, field) (Dev->Data.field)
95 135
#define VL53L1DevDataSet(Dev, field, VL53L1_PRM_00005) ((Dev->Data.field) = (VL53L1_PRM_00005))
96 136
#define VL53L1DevStructGetLLDriverHandle(Dev) (&Dev->Data.LLData)
97 137
#define VL53L1DevStructGetLLResultsHandle(Dev) (&Dev->Data.llresults)
138

  
98 139
#ifdef __cplusplus
99 140
}
100 141
#endif
101
#endif
142

  
143
#endif /* _VL53L1_PLATFORM_USER_DATA_H_ */

Also available in: Unified diff