Environmental Shield API

Committer:
Deepti
Date:
Tue Aug 19 07:13:15 2014 +0000
Revision:
0:9e645e6ed2ce
Environment Shield API

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Deepti 0:9e645e6ed2ce 1 #include "nucleo-f401re.h"
Deepti 0:9e645e6ed2ce 2 #include "Envt_Shield_F4_API.h"
Deepti 0:9e645e6ed2ce 3 /*#include "x_nucleo_ike01x1_hum_temp.h"
Deepti 0:9e645e6ed2ce 4 #include "x_nucleo_ike01x1_pressure.h"
Deepti 0:9e645e6ed2ce 5 #include "x_nucleo_ike01x1_uv.h"*/
Deepti 0:9e645e6ed2ce 6
Deepti 0:9e645e6ed2ce 7
Deepti 0:9e645e6ed2ce 8 uint8_t Envt_Shield_API::Pressure_Init(void)
Deepti 0:9e645e6ed2ce 9 {
Deepti 0:9e645e6ed2ce 10 uint8_t ret= BSP_PRESSURE_Init();
Deepti 0:9e645e6ed2ce 11 return ret;
Deepti 0:9e645e6ed2ce 12 }
Deepti 0:9e645e6ed2ce 13
Deepti 0:9e645e6ed2ce 14 uint8_t Envt_Shield_API::Pressure_isInitialized(void)
Deepti 0:9e645e6ed2ce 15 {
Deepti 0:9e645e6ed2ce 16 uint8_t PressureInitialised=BSP_PRESSURE_isInitialized();
Deepti 0:9e645e6ed2ce 17 return PressureInitialised;
Deepti 0:9e645e6ed2ce 18 }
Deepti 0:9e645e6ed2ce 19
Deepti 0:9e645e6ed2ce 20 void Envt_Shield_API::Pressure_Reset(void)
Deepti 0:9e645e6ed2ce 21 {
Deepti 0:9e645e6ed2ce 22 BSP_PRESSURE_Reset();
Deepti 0:9e645e6ed2ce 23 }
Deepti 0:9e645e6ed2ce 24
Deepti 0:9e645e6ed2ce 25 uint8_t Envt_Shield_API::Pressure_ReadID(void)
Deepti 0:9e645e6ed2ce 26 {
Deepti 0:9e645e6ed2ce 27 uint8_t id = BSP_PRESSURE_ReadID();
Deepti 0:9e645e6ed2ce 28 return id;
Deepti 0:9e645e6ed2ce 29 }
Deepti 0:9e645e6ed2ce 30
Deepti 0:9e645e6ed2ce 31 void Envt_Shield_API::Pressure_ITConfig(
Deepti 0:9e645e6ed2ce 32 void/*PRESSURE_InterruptConfigTypeDef *pIntConfigStruct*/)
Deepti 0:9e645e6ed2ce 33 {
Deepti 0:9e645e6ed2ce 34 BSP_PRESSURE_ITConfig();
Deepti 0:9e645e6ed2ce 35 }
Deepti 0:9e645e6ed2ce 36
Deepti 0:9e645e6ed2ce 37 void Envt_Shield_API::Pressure_EnableIT(uint8_t IntPin)
Deepti 0:9e645e6ed2ce 38 {
Deepti 0:9e645e6ed2ce 39 BSP_PRESSURE_EnableIT(IntPin);
Deepti 0:9e645e6ed2ce 40 }
Deepti 0:9e645e6ed2ce 41
Deepti 0:9e645e6ed2ce 42 void Envt_Shield_API::Pressure_DisableIT(uint8_t IntPin)
Deepti 0:9e645e6ed2ce 43 {
Deepti 0:9e645e6ed2ce 44 BSP_PRESSURE_DisableIT(IntPin);
Deepti 0:9e645e6ed2ce 45 }
Deepti 0:9e645e6ed2ce 46
Deepti 0:9e645e6ed2ce 47 void Envt_Shield_API::Pressure_GetPressure(float* pfData)
Deepti 0:9e645e6ed2ce 48 {
Deepti 0:9e645e6ed2ce 49 BSP_PRESSURE_GetPressure(pfData);
Deepti 0:9e645e6ed2ce 50 }
Deepti 0:9e645e6ed2ce 51
Deepti 0:9e645e6ed2ce 52 void Envt_Shield_API::Pressure_GetTemperature(float* pfData)
Deepti 0:9e645e6ed2ce 53 {
Deepti 0:9e645e6ed2ce 54 BSP_PRESSURE_GetTemperature(pfData);
Deepti 0:9e645e6ed2ce 55 }
Deepti 0:9e645e6ed2ce 56
Deepti 0:9e645e6ed2ce 57
Deepti 0:9e645e6ed2ce 58 uint8_t Envt_Shield_API::Hum_Temp_Init(void)
Deepti 0:9e645e6ed2ce 59 {
Deepti 0:9e645e6ed2ce 60 uint8_t ret = BSP_HUM_TEMP_Init();
Deepti 0:9e645e6ed2ce 61 return ret;
Deepti 0:9e645e6ed2ce 62 }
Deepti 0:9e645e6ed2ce 63
Deepti 0:9e645e6ed2ce 64 uint8_t Envt_Shield_API::Hum_Temp_isInitialized(void)
Deepti 0:9e645e6ed2ce 65 {
Deepti 0:9e645e6ed2ce 66 uint8_t HumpTempInitialised=BSP_HUM_TEMP_isInitialized();
Deepti 0:9e645e6ed2ce 67 return HumpTempInitialised;
Deepti 0:9e645e6ed2ce 68 }
Deepti 0:9e645e6ed2ce 69
Deepti 0:9e645e6ed2ce 70 void Envt_Shield_API::Hum_Temp_Reset(void)
Deepti 0:9e645e6ed2ce 71 {
Deepti 0:9e645e6ed2ce 72 BSP_HUM_TEMP_Reset();
Deepti 0:9e645e6ed2ce 73 }
Deepti 0:9e645e6ed2ce 74
Deepti 0:9e645e6ed2ce 75 uint8_t Envt_Shield_API::Hum_Temp_ReadID(void)
Deepti 0:9e645e6ed2ce 76 {
Deepti 0:9e645e6ed2ce 77 uint8_t id = BSP_HUM_TEMP_ReadID();
Deepti 0:9e645e6ed2ce 78 return id;
Deepti 0:9e645e6ed2ce 79 }
Deepti 0:9e645e6ed2ce 80
Deepti 0:9e645e6ed2ce 81 void Envt_Shield_API::Hum_Temp_ITConfig(
Deepti 0:9e645e6ed2ce 82 void/*HUM_TEMP_InterruptConfigTypeDef *pIntConfig*/)
Deepti 0:9e645e6ed2ce 83 {
Deepti 0:9e645e6ed2ce 84 BSP_HUM_TEMP_ITConfig();
Deepti 0:9e645e6ed2ce 85 }
Deepti 0:9e645e6ed2ce 86
Deepti 0:9e645e6ed2ce 87 void Envt_Shield_API::Hum_Temp_EnableIT(uint8_t IntPin)
Deepti 0:9e645e6ed2ce 88 {
Deepti 0:9e645e6ed2ce 89 BSP_HUM_TEMP_EnableIT(IntPin);
Deepti 0:9e645e6ed2ce 90 }
Deepti 0:9e645e6ed2ce 91
Deepti 0:9e645e6ed2ce 92 void Envt_Shield_API::Hum_Temp_DisableIT(uint8_t IntPin)
Deepti 0:9e645e6ed2ce 93 {
Deepti 0:9e645e6ed2ce 94 BSP_HUM_TEMP_DisableIT(IntPin);
Deepti 0:9e645e6ed2ce 95 }
Deepti 0:9e645e6ed2ce 96
Deepti 0:9e645e6ed2ce 97 void Envt_Shield_API::Hum_Temp_GetHumidity(float* pfData)
Deepti 0:9e645e6ed2ce 98 {
Deepti 0:9e645e6ed2ce 99 BSP_HUM_TEMP_GetHumidity(pfData);
Deepti 0:9e645e6ed2ce 100 }
Deepti 0:9e645e6ed2ce 101
Deepti 0:9e645e6ed2ce 102 void Envt_Shield_API::Hum_Temp_GetTemperature(float* pfData)
Deepti 0:9e645e6ed2ce 103 {
Deepti 0:9e645e6ed2ce 104 BSP_HUM_TEMP_GetTemperature(pfData);
Deepti 0:9e645e6ed2ce 105 }
Deepti 0:9e645e6ed2ce 106
Deepti 0:9e645e6ed2ce 107 void Envt_Shield_API::Hum_Temp_PowerOFF()
Deepti 0:9e645e6ed2ce 108 {
Deepti 0:9e645e6ed2ce 109 BSP_HUM_TEMP_PowerOFF();
Deepti 0:9e645e6ed2ce 110 }
Deepti 0:9e645e6ed2ce 111
Deepti 0:9e645e6ed2ce 112 uint8_t Envt_Shield_API::UV_Init(void)
Deepti 0:9e645e6ed2ce 113 {
Deepti 0:9e645e6ed2ce 114 uint8_t ret = BSP_UV_Init();
Deepti 0:9e645e6ed2ce 115 return ret;
Deepti 0:9e645e6ed2ce 116 }
Deepti 0:9e645e6ed2ce 117
Deepti 0:9e645e6ed2ce 118 uint8_t Envt_Shield_API::UV_isInitialized(void)
Deepti 0:9e645e6ed2ce 119 {
Deepti 0:9e645e6ed2ce 120 uint8_t UvInitialized=BSP_UV_isInitialized();
Deepti 0:9e645e6ed2ce 121 return UvInitialized;
Deepti 0:9e645e6ed2ce 122 }
Deepti 0:9e645e6ed2ce 123
Deepti 0:9e645e6ed2ce 124 /**
Deepti 0:9e645e6ed2ce 125 * @brief Read ID of Uv component
Deepti 0:9e645e6ed2ce 126 * @param None
Deepti 0:9e645e6ed2ce 127 * @retval ID
Deepti 0:9e645e6ed2ce 128 */
Deepti 0:9e645e6ed2ce 129 uint8_t Envt_Shield_API::UV_ReadID(void)
Deepti 0:9e645e6ed2ce 130 {
Deepti 0:9e645e6ed2ce 131 uint8_t id = BSP_UV_ReadID();
Deepti 0:9e645e6ed2ce 132 return id;
Deepti 0:9e645e6ed2ce 133 }
Deepti 0:9e645e6ed2ce 134
Deepti 0:9e645e6ed2ce 135 /**
Deepti 0:9e645e6ed2ce 136 * @brief Reboot memory content of UV
Deepti 0:9e645e6ed2ce 137 * @param None
Deepti 0:9e645e6ed2ce 138 * @retval None
Deepti 0:9e645e6ed2ce 139 */
Deepti 0:9e645e6ed2ce 140 void Envt_Shield_API::UV_Reset(void)
Deepti 0:9e645e6ed2ce 141 {
Deepti 0:9e645e6ed2ce 142 BSP_UV_Reset();
Deepti 0:9e645e6ed2ce 143 }
Deepti 0:9e645e6ed2ce 144
Deepti 0:9e645e6ed2ce 145
Deepti 0:9e645e6ed2ce 146 /**
Deepti 0:9e645e6ed2ce 147 * @brief Configure INT1 interrupt
Deepti 0:9e645e6ed2ce 148 * @param pIntConfig: pointer to a UVIS3_InterruptConfig_TypeDef
Deepti 0:9e645e6ed2ce 149 * structure that contains the configuration setting for the UVIS3 Interrupt.
Deepti 0:9e645e6ed2ce 150 * @retval None
Deepti 0:9e645e6ed2ce 151 */
Deepti 0:9e645e6ed2ce 152 void Envt_Shield_API::UV_ITConfig(void/*UV_InterruptConfigTypeDef *pIntConfig*/)
Deepti 0:9e645e6ed2ce 153 {
Deepti 0:9e645e6ed2ce 154 BSP_UV_ITConfig();
Deepti 0:9e645e6ed2ce 155 }
Deepti 0:9e645e6ed2ce 156
Deepti 0:9e645e6ed2ce 157 /**
Deepti 0:9e645e6ed2ce 158 * @brief Enable INT1 or INT2 interrupt
Deepti 0:9e645e6ed2ce 159 * @param IntPin: Interrupt pin
Deepti 0:9e645e6ed2ce 160 * This parameter can be:
Deepti 0:9e645e6ed2ce 161 * @arg UVIS3_INT1
Deepti 0:9e645e6ed2ce 162 * @arg UVIS3_INT2
Deepti 0:9e645e6ed2ce 163 * @retval None
Deepti 0:9e645e6ed2ce 164 */
Deepti 0:9e645e6ed2ce 165 void Envt_Shield_API::UV_EnableIT(uint8_t IntPin)
Deepti 0:9e645e6ed2ce 166 {
Deepti 0:9e645e6ed2ce 167 BSP_UV_EnableIT(IntPin);
Deepti 0:9e645e6ed2ce 168 }
Deepti 0:9e645e6ed2ce 169
Deepti 0:9e645e6ed2ce 170 /**
Deepti 0:9e645e6ed2ce 171 * @brief Disable INT1 or INT2 interrupt
Deepti 0:9e645e6ed2ce 172 * @param IntPin: Interrupt pin
Deepti 0:9e645e6ed2ce 173 * This parameter can be:
Deepti 0:9e645e6ed2ce 174 * @arg UVIS3_INT1
Deepti 0:9e645e6ed2ce 175 * @arg UVIS3_INT2
Deepti 0:9e645e6ed2ce 176 * @retval None
Deepti 0:9e645e6ed2ce 177 */
Deepti 0:9e645e6ed2ce 178 void Envt_Shield_API::UV_DisableIT(uint8_t IntPin)
Deepti 0:9e645e6ed2ce 179 {
Deepti 0:9e645e6ed2ce 180 BSP_UV_DisableIT(IntPin);
Deepti 0:9e645e6ed2ce 181 }
Deepti 0:9e645e6ed2ce 182
Deepti 0:9e645e6ed2ce 183 /**
Deepti 0:9e645e6ed2ce 184 * @brief Get Index UV
Deepti 0:9e645e6ed2ce 185 * @param pfData: pointer on floating data
Deepti 0:9e645e6ed2ce 186 * @retval None
Deepti 0:9e645e6ed2ce 187 */
Deepti 0:9e645e6ed2ce 188 void Envt_Shield_API::UV_GetIndex(float* pfData)
Deepti 0:9e645e6ed2ce 189 {
Deepti 0:9e645e6ed2ce 190 BSP_UV_GetIndex(pfData);
Deepti 0:9e645e6ed2ce 191 }