Updated peripheral interfaces
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9077 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
d6dd34c381
commit
8b95f8629b
|
@ -74,7 +74,7 @@ struct BaseAccelerometerVMT {
|
|||
*/
|
||||
typedef struct {
|
||||
/** @brief Virtual Methods Table.*/
|
||||
const struct BaseAccelerometerVMT *vmt;
|
||||
const struct BaseAccelerometerVMT *vmtac;
|
||||
_base_sensor_data
|
||||
} BaseAccelerometer;
|
||||
|
||||
|
@ -94,7 +94,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define accelerometerGetAxesNumber(ip) sensorGetAxesNumber(ip)
|
||||
#define accelerometerGetAxesNumber(ip) ((ip)->vmtac->get_axes_number(ip))
|
||||
|
||||
/**
|
||||
* @brief Accelerometer read raw data.
|
||||
|
@ -108,7 +108,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define accelerometerReadRaw(ip, dp) sensorReadRaw(ip, dp)
|
||||
#define accelerometerReadRaw(ip, dp) ((ip)->vmtac->read_raw(ip, dp))
|
||||
|
||||
/**
|
||||
* @brief Accelerometer read cooked data.
|
||||
|
@ -122,7 +122,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define accelerometerReadCooked(ip, dp) sensorReadCooked(ip, dp)
|
||||
#define accelerometerReadCooked(ip, dp) ((ip)->vmtac->read_cooked(ip, dp))
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -74,7 +74,7 @@ struct BaseCompassVMT {
|
|||
*/
|
||||
typedef struct {
|
||||
/** @brief Virtual Methods Table.*/
|
||||
const struct BaseCompassVMT *vmt;
|
||||
const struct BaseCompassVMT *vmtco;
|
||||
_base_compass_data
|
||||
} BaseCompass;
|
||||
|
||||
|
@ -93,7 +93,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define compassGetAxesNumber(ip) sensorGetAxesNumber(ip)
|
||||
#define compassGetAxesNumber(ip) ((ip)->vmtco->get_axes_number(ip))
|
||||
|
||||
/**
|
||||
* @brief Compass read raw data.
|
||||
|
@ -107,7 +107,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define compassReadRaw(ip, dp) sensorReadRaw(ip, dp)
|
||||
#define compassReadRaw(ip, dp) ((ip)->vmtco->read_raw(ip, dp))
|
||||
|
||||
/**
|
||||
* @brief Compass read cooked data.
|
||||
|
@ -121,33 +121,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define compassReadCooked(ip, dp) sensorReadCooked(ip, dp)
|
||||
|
||||
/**
|
||||
* @brief Delete calibration data.
|
||||
*
|
||||
* @param[in] ip pointer to a @p BaseCompass class.
|
||||
*
|
||||
* @return The operation status.
|
||||
* @retval MSG_OK if the function succeeded.
|
||||
* @retval MSG_RESET if one or more errors occurred.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define compassResetCalibration(ip) ((ip)->vmt->reset_calibration(ip))
|
||||
|
||||
/**
|
||||
* @brief Compass calibration procedure.
|
||||
*
|
||||
* @param[in] ip pointer to a @p BaseCompass class.
|
||||
*
|
||||
* @return The operation status.
|
||||
* @retval MSG_OK if the function succeeded.
|
||||
* @retval MSG_RESET if one or more errors occurred.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define compassCalibrate(ip) ((ip)->vmt->calibrate(ip))
|
||||
#define compassReadCooked(ip, dp) ((ip)->vmtco->read_cooked(ip, dp))
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -78,7 +78,7 @@ struct BaseGyroscopeVMT {
|
|||
*/
|
||||
typedef struct {
|
||||
/** @brief Virtual Methods Table.*/
|
||||
const struct BaseGyroscopeVMT *vmt;
|
||||
const struct BaseGyroscopeVMT *vmtgy;
|
||||
_base_gyroscope_data
|
||||
} BaseGyroscope;
|
||||
|
||||
|
@ -98,7 +98,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define gyroscopeGetAxesNumber(ip) sensorGetAxesNumber(ip)
|
||||
#define gyroscopeGetAxesNumber(ip) ((ip)->vmtgy->get_axes_number(ip))
|
||||
|
||||
/**
|
||||
* @brief Gyroscope read raw data.
|
||||
|
@ -112,7 +112,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define gyroscopeReadRaw(ip, dp) sensorReadRaw(ip, dp)
|
||||
#define gyroscopeReadRaw(ip, dp) ((ip)->vmtgy->read_raw(ip, dp))
|
||||
|
||||
/**
|
||||
* @brief Gyroscope read cooked data.
|
||||
|
@ -126,7 +126,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define gyroscopeReadCooked(ip, dp) sensorReadCooked(ip, dp)
|
||||
#define gyroscopeReadCooked(ip, dp) ((ip)->vmtgy->read_cooked(ip, dp))
|
||||
|
||||
/**
|
||||
* @brief Delete calibration data.
|
||||
|
@ -139,7 +139,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define gyroscopeResetCalibration(ip) ((ip)->vmt->reset_calibration(ip))
|
||||
#define gyroscopeResetCalibration(ip) ((ip)->vmtgy->reset_calibration(ip))
|
||||
|
||||
/**
|
||||
* @brief Gyroscope calibration procedure.
|
||||
|
@ -152,7 +152,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define gyroscopeCalibrate(ip) ((ip)->vmt->calibrate(ip))
|
||||
#define gyroscopeCalibrate(ip) ((ip)->vmtgy->calibrate(ip))
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -79,7 +79,7 @@ struct BaseSensorVMT {
|
|||
*/
|
||||
typedef struct {
|
||||
/** @brief Virtual Methods Table.*/
|
||||
const struct BaseSensorVMT *vmt;
|
||||
const struct BaseSensorVMT *vmtse;
|
||||
_base_sensor_data
|
||||
} BaseSensor;
|
||||
|
||||
|
@ -99,7 +99,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define sensorGetAxesNumber(ip) ((ip)->vmt->get_axes_number(ip))
|
||||
#define sensorGetAxesNumber(ip) ((ip)->vmtse->get_axes_number(ip))
|
||||
|
||||
/**
|
||||
* @brief Sensors read raw data.
|
||||
|
@ -113,7 +113,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define sensorReadRaw(ip, dp) ((ip)->vmt->read_raw(ip, dp))
|
||||
#define sensorReadRaw(ip, dp) ((ip)->vmtse->read_raw(ip, dp))
|
||||
|
||||
/**
|
||||
* @brief Sensors read cooked data.
|
||||
|
@ -127,7 +127,7 @@ typedef struct {
|
|||
*
|
||||
* @api
|
||||
*/
|
||||
#define sensorReadCooked(ip, dp) ((ip)->vmt->read_cooked(ip, dp))
|
||||
#define sensorReadCooked(ip, dp) ((ip)->vmtse->read_cooked(ip, dp))
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
Loading…
Reference in New Issue