Class to drive the Gyroscope (L3GD20 device) present on DISCO_F429ZI board.

Dependents:   DISCO-F429ZI_LCDTS_and_GYRO_test DISCO-F429ZI_Gyro_demo DISCO-F429ZI_Gyr WIRE-BANDING_FT810 ... more

Committer:
bcostm
Date:
Fri Dec 18 14:39:07 2015 +0000
Revision:
0:dfe10fcd7524
Initial version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:dfe10fcd7524 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
bcostm 0:dfe10fcd7524 2 *
bcostm 0:dfe10fcd7524 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
bcostm 0:dfe10fcd7524 4 * and associated documentation files (the "Software"), to deal in the Software without
bcostm 0:dfe10fcd7524 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
bcostm 0:dfe10fcd7524 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
bcostm 0:dfe10fcd7524 7 * Software is furnished to do so, subject to the following conditions:
bcostm 0:dfe10fcd7524 8 *
bcostm 0:dfe10fcd7524 9 * The above copyright notice and this permission notice shall be included in all copies or
bcostm 0:dfe10fcd7524 10 * substantial portions of the Software.
bcostm 0:dfe10fcd7524 11 *
bcostm 0:dfe10fcd7524 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
bcostm 0:dfe10fcd7524 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
bcostm 0:dfe10fcd7524 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
bcostm 0:dfe10fcd7524 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
bcostm 0:dfe10fcd7524 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bcostm 0:dfe10fcd7524 17 */
bcostm 0:dfe10fcd7524 18
bcostm 0:dfe10fcd7524 19 #include "GYRO_DISCO_F429ZI.h"
bcostm 0:dfe10fcd7524 20
bcostm 0:dfe10fcd7524 21 // Constructor
bcostm 0:dfe10fcd7524 22 GYRO_DISCO_F429ZI::GYRO_DISCO_F429ZI()
bcostm 0:dfe10fcd7524 23 {
bcostm 0:dfe10fcd7524 24 BSP_GYRO_Init();
bcostm 0:dfe10fcd7524 25 }
bcostm 0:dfe10fcd7524 26
bcostm 0:dfe10fcd7524 27 // Destructor
bcostm 0:dfe10fcd7524 28 GYRO_DISCO_F429ZI::~GYRO_DISCO_F429ZI()
bcostm 0:dfe10fcd7524 29 {
bcostm 0:dfe10fcd7524 30
bcostm 0:dfe10fcd7524 31 }
bcostm 0:dfe10fcd7524 32
bcostm 0:dfe10fcd7524 33 //=================================================================================================================
bcostm 0:dfe10fcd7524 34 // Public methods
bcostm 0:dfe10fcd7524 35 //=================================================================================================================
bcostm 0:dfe10fcd7524 36
bcostm 0:dfe10fcd7524 37 uint8_t GYRO_DISCO_F429ZI::Init(void)
bcostm 0:dfe10fcd7524 38 {
bcostm 0:dfe10fcd7524 39 return BSP_GYRO_Init();
bcostm 0:dfe10fcd7524 40 }
bcostm 0:dfe10fcd7524 41
bcostm 0:dfe10fcd7524 42 uint8_t GYRO_DISCO_F429ZI::ReadID(void)
bcostm 0:dfe10fcd7524 43 {
bcostm 0:dfe10fcd7524 44 return BSP_GYRO_ReadID();
bcostm 0:dfe10fcd7524 45 }
bcostm 0:dfe10fcd7524 46
bcostm 0:dfe10fcd7524 47 void GYRO_DISCO_F429ZI::Reset(void)
bcostm 0:dfe10fcd7524 48 {
bcostm 0:dfe10fcd7524 49 BSP_GYRO_Reset();
bcostm 0:dfe10fcd7524 50 }
bcostm 0:dfe10fcd7524 51
bcostm 0:dfe10fcd7524 52 void GYRO_DISCO_F429ZI::ITConfig(GYRO_InterruptConfigTypeDef *pIntConfig)
bcostm 0:dfe10fcd7524 53 {
bcostm 0:dfe10fcd7524 54 BSP_GYRO_ITConfig(pIntConfig);
bcostm 0:dfe10fcd7524 55 }
bcostm 0:dfe10fcd7524 56
bcostm 0:dfe10fcd7524 57 void GYRO_DISCO_F429ZI::EnableIT(uint8_t IntPin)
bcostm 0:dfe10fcd7524 58 {
bcostm 0:dfe10fcd7524 59 BSP_GYRO_EnableIT(IntPin);
bcostm 0:dfe10fcd7524 60 }
bcostm 0:dfe10fcd7524 61
bcostm 0:dfe10fcd7524 62 void GYRO_DISCO_F429ZI::DisableIT(uint8_t IntPin)
bcostm 0:dfe10fcd7524 63 {
bcostm 0:dfe10fcd7524 64 BSP_GYRO_DisableIT(IntPin);
bcostm 0:dfe10fcd7524 65 }
bcostm 0:dfe10fcd7524 66
bcostm 0:dfe10fcd7524 67 void GYRO_DISCO_F429ZI::GetXYZ(float *pfData)
bcostm 0:dfe10fcd7524 68 {
bcostm 0:dfe10fcd7524 69 BSP_GYRO_GetXYZ(pfData);
bcostm 0:dfe10fcd7524 70 }
bcostm 0:dfe10fcd7524 71
bcostm 0:dfe10fcd7524 72 //=================================================================================================================
bcostm 0:dfe10fcd7524 73 // Private methods
bcostm 0:dfe10fcd7524 74 //=================================================================================================================