added function to enable power saving mode for es_wifi driver (Inventek Systems ISM43362-M3G-L44 )
Fork of DISCO_L475VG_IOT01A_wifi by
es_wifi_io.h@2:9bbbcd0eff1c, 2018-01-13 (annotated)
- Committer:
- jaafaryn
- Date:
- Sat Jan 13 23:37:46 2018 +0000
- Revision:
- 2:9bbbcd0eff1c
- Parent:
- 0:c61a93635433
added function to enable power saving mode
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adustm | 0:c61a93635433 | 1 | /** |
adustm | 0:c61a93635433 | 2 | ****************************************************************************** |
adustm | 0:c61a93635433 | 3 | * @file es_wifi_io.h |
adustm | 0:c61a93635433 | 4 | * @author MCD Application Team |
adustm | 0:c61a93635433 | 5 | * @version V1.8.0 |
adustm | 0:c61a93635433 | 6 | * @date 21-April-2017 |
adustm | 0:c61a93635433 | 7 | * @brief This file contains the functions prototypes for es_wifi IO operations. |
adustm | 0:c61a93635433 | 8 | ****************************************************************************** |
adustm | 0:c61a93635433 | 9 | * @attention |
adustm | 0:c61a93635433 | 10 | * |
adustm | 0:c61a93635433 | 11 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
adustm | 0:c61a93635433 | 12 | * |
adustm | 0:c61a93635433 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
adustm | 0:c61a93635433 | 14 | * are permitted provided that the following conditions are met: |
adustm | 0:c61a93635433 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
adustm | 0:c61a93635433 | 16 | * this list of conditions and the following disclaimer. |
adustm | 0:c61a93635433 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
adustm | 0:c61a93635433 | 18 | * this list of conditions and the following disclaimer in the documentation |
adustm | 0:c61a93635433 | 19 | * and/or other materials provided with the distribution. |
adustm | 0:c61a93635433 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
adustm | 0:c61a93635433 | 21 | * may be used to endorse or promote products derived from this software |
adustm | 0:c61a93635433 | 22 | * without specific prior written permission. |
adustm | 0:c61a93635433 | 23 | * |
adustm | 0:c61a93635433 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
adustm | 0:c61a93635433 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
adustm | 0:c61a93635433 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
adustm | 0:c61a93635433 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
adustm | 0:c61a93635433 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
adustm | 0:c61a93635433 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
adustm | 0:c61a93635433 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
adustm | 0:c61a93635433 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
adustm | 0:c61a93635433 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
adustm | 0:c61a93635433 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
adustm | 0:c61a93635433 | 34 | * |
adustm | 0:c61a93635433 | 35 | ****************************************************************************** |
adustm | 0:c61a93635433 | 36 | */ |
adustm | 0:c61a93635433 | 37 | #ifndef __WIFI_IO__ |
adustm | 0:c61a93635433 | 38 | #define __WIFI_IO__ |
adustm | 0:c61a93635433 | 39 | |
adustm | 0:c61a93635433 | 40 | #ifdef __cplusplus |
adustm | 0:c61a93635433 | 41 | extern "C" { |
adustm | 0:c61a93635433 | 42 | #endif |
adustm | 0:c61a93635433 | 43 | |
adustm | 0:c61a93635433 | 44 | /* Includes ------------------------------------------------------------------*/ |
adustm | 0:c61a93635433 | 45 | #include "stm32l4xx_hal.h" |
adustm | 0:c61a93635433 | 46 | |
adustm | 0:c61a93635433 | 47 | /* Exported constants --------------------------------------------------------*/ |
adustm | 0:c61a93635433 | 48 | |
adustm | 0:c61a93635433 | 49 | /* Exported macro ------------------------------------------------------------*/ |
adustm | 0:c61a93635433 | 50 | #define WIFI_RESET_MODULE() do{\ |
adustm | 0:c61a93635433 | 51 | HAL_GPIO_WritePin(GPIOE, GPIO_PIN_8, GPIO_PIN_RESET );\ |
adustm | 0:c61a93635433 | 52 | HAL_Delay(10);\ |
adustm | 0:c61a93635433 | 53 | HAL_GPIO_WritePin( GPIOE, GPIO_PIN_8, GPIO_PIN_SET );\ |
adustm | 0:c61a93635433 | 54 | HAL_Delay(500);\ |
adustm | 0:c61a93635433 | 55 | }while(0); |
adustm | 0:c61a93635433 | 56 | |
adustm | 0:c61a93635433 | 57 | |
adustm | 0:c61a93635433 | 58 | #define WIFI_ENABLE_NSS() do{ \ |
adustm | 0:c61a93635433 | 59 | HAL_GPIO_WritePin( GPIOE, GPIO_PIN_0, GPIO_PIN_RESET );\ |
adustm | 0:c61a93635433 | 60 | HAL_Delay(10);\ |
adustm | 0:c61a93635433 | 61 | }while(0); |
adustm | 0:c61a93635433 | 62 | |
adustm | 0:c61a93635433 | 63 | #define WIFI_DISABLE_NSS() do{ \ |
adustm | 0:c61a93635433 | 64 | HAL_GPIO_WritePin( GPIOE, GPIO_PIN_0, GPIO_PIN_SET );\ |
adustm | 0:c61a93635433 | 65 | HAL_Delay(10);\ |
adustm | 0:c61a93635433 | 66 | }while(0); |
adustm | 0:c61a93635433 | 67 | |
adustm | 0:c61a93635433 | 68 | #define WIFI_IS_CMDDATA_READY() (HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_1) == GPIO_PIN_SET) |
adustm | 0:c61a93635433 | 69 | |
adustm | 0:c61a93635433 | 70 | |
adustm | 0:c61a93635433 | 71 | |
adustm | 0:c61a93635433 | 72 | /* Exported functions ------------------------------------------------------- */ |
adustm | 0:c61a93635433 | 73 | void SPI_WIFI_MspInit(SPI_HandleTypeDef* hspi); |
adustm | 0:c61a93635433 | 74 | int8_t SPI_WIFI_DeInit(void); |
adustm | 0:c61a93635433 | 75 | int8_t SPI_WIFI_Init(void); |
adustm | 0:c61a93635433 | 76 | int16_t SPI_WIFI_ReceiveData(uint8_t *pData, uint16_t len, uint32_t timeout); |
adustm | 0:c61a93635433 | 77 | int16_t SPI_WIFI_SendData( uint8_t *pData, uint16_t len, uint32_t timeout); |
adustm | 0:c61a93635433 | 78 | void SPI_WIFI_Delay(uint32_t Delay); |
adustm | 0:c61a93635433 | 79 | |
adustm | 0:c61a93635433 | 80 | #ifdef __cplusplus |
adustm | 0:c61a93635433 | 81 | } |
adustm | 0:c61a93635433 | 82 | #endif |
adustm | 0:c61a93635433 | 83 | |
adustm | 0:c61a93635433 | 84 | #endif /* __WIFI_IO__ */ |
adustm | 0:c61a93635433 | 85 | |
adustm | 0:c61a93635433 | 86 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |