BSP driver for DISCO_L496AG
Dependents: DISCO_L496AG-LCD-prova_1 DISCO_L496AG-LCD-prova_2 DISCO_L496AG-LCD-demo DISCO_L496AG-SRAM-demo
Drivers/BSP/Components/Common/io.h@2:106c7b82e064, 2019-11-20 (annotated)
- Committer:
- Jerome Coutant
- Date:
- Wed Nov 20 16:48:24 2019 +0100
- Revision:
- 2:106c7b82e064
- Parent:
- 0:d83f1c8ca282
Update BSP files with CubeL4 V1.14.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 0:d83f1c8ca282 | 1 | /** |
bcostm | 0:d83f1c8ca282 | 2 | ****************************************************************************** |
bcostm | 0:d83f1c8ca282 | 3 | * @file io.h |
bcostm | 0:d83f1c8ca282 | 4 | * @author MCD Application Team |
bcostm | 0:d83f1c8ca282 | 5 | * @brief This file contains all the functions prototypes for the IO driver. |
bcostm | 0:d83f1c8ca282 | 6 | ****************************************************************************** |
bcostm | 0:d83f1c8ca282 | 7 | * @attention |
bcostm | 0:d83f1c8ca282 | 8 | * |
Jerome Coutant
2:106c7b82e064
|
9
|
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
|
Jerome Coutant
2:106c7b82e064
|
10
|
* All rights reserved.</center></h2>
|
|
bcostm | 0:d83f1c8ca282 | 11 | * |
Jerome Coutant
2:106c7b82e064
|
12
|
* This software component is licensed by ST under BSD 3-Clause license,
|
|
Jerome Coutant
2:106c7b82e064
|
13
|
* the "License"; You may not use this file except in compliance with the
|
|
Jerome Coutant
2:106c7b82e064
|
14
|
* License. You may obtain a copy of the License at:
|
|
Jerome Coutant
2:106c7b82e064
|
15
|
* opensource.org/licenses/BSD-3-Clause
|
|
bcostm | 0:d83f1c8ca282 | 16 | * |
bcostm | 0:d83f1c8ca282 | 17 | ****************************************************************************** |
bcostm | 0:d83f1c8ca282 | 18 | */ |
bcostm | 0:d83f1c8ca282 | 19 | |
bcostm | 0:d83f1c8ca282 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bcostm | 0:d83f1c8ca282 | 21 | #ifndef __IO_H |
bcostm | 0:d83f1c8ca282 | 22 | #define __IO_H |
bcostm | 0:d83f1c8ca282 | 23 | |
bcostm | 0:d83f1c8ca282 | 24 | #ifdef __cplusplus |
bcostm | 0:d83f1c8ca282 | 25 | extern "C" { |
bcostm | 0:d83f1c8ca282 | 26 | #endif |
bcostm | 0:d83f1c8ca282 | 27 | |
bcostm | 0:d83f1c8ca282 | 28 | /* Includes ------------------------------------------------------------------*/ |
bcostm | 0:d83f1c8ca282 | 29 | #include <stdint.h> |
bcostm | 0:d83f1c8ca282 | 30 | |
bcostm | 0:d83f1c8ca282 | 31 | /** @addtogroup BSP |
bcostm | 0:d83f1c8ca282 | 32 | * @{ |
bcostm | 0:d83f1c8ca282 | 33 | */ |
bcostm | 0:d83f1c8ca282 | 34 | |
bcostm | 0:d83f1c8ca282 | 35 | /** @addtogroup Components |
bcostm | 0:d83f1c8ca282 | 36 | * @{ |
bcostm | 0:d83f1c8ca282 | 37 | */ |
bcostm | 0:d83f1c8ca282 | 38 | |
bcostm | 0:d83f1c8ca282 | 39 | /** @addtogroup IO |
bcostm | 0:d83f1c8ca282 | 40 | * @{ |
bcostm | 0:d83f1c8ca282 | 41 | */ |
bcostm | 0:d83f1c8ca282 | 42 | |
bcostm | 0:d83f1c8ca282 | 43 | /** @defgroup IO_Exported_Types |
bcostm | 0:d83f1c8ca282 | 44 | * @{ |
bcostm | 0:d83f1c8ca282 | 45 | */ |
bcostm | 0:d83f1c8ca282 | 46 | |
bcostm | 0:d83f1c8ca282 | 47 | /** |
bcostm | 0:d83f1c8ca282 | 48 | * @brief IO Bit SET and Bit RESET enumeration |
bcostm | 0:d83f1c8ca282 | 49 | */ |
bcostm | 0:d83f1c8ca282 | 50 | typedef enum |
bcostm | 0:d83f1c8ca282 | 51 | { |
bcostm | 0:d83f1c8ca282 | 52 | IO_PIN_RESET = 0, |
bcostm | 0:d83f1c8ca282 | 53 | IO_PIN_SET |
bcostm | 0:d83f1c8ca282 | 54 | }IO_PinState; |
bcostm | 0:d83f1c8ca282 | 55 | |
bcostm | 0:d83f1c8ca282 | 56 | typedef enum |
bcostm | 0:d83f1c8ca282 | 57 | { |
bcostm | 0:d83f1c8ca282 | 58 | IO_MODE_INPUT = 0, /* input floating */ |
bcostm | 0:d83f1c8ca282 | 59 | IO_MODE_OUTPUT, /* output Push Pull */ |
bcostm | 0:d83f1c8ca282 | 60 | IO_MODE_IT_RISING_EDGE, /* float input - irq detect on rising edge */ |
bcostm | 0:d83f1c8ca282 | 61 | IO_MODE_IT_FALLING_EDGE, /* float input - irq detect on falling edge */ |
bcostm | 0:d83f1c8ca282 | 62 | IO_MODE_IT_LOW_LEVEL, /* float input - irq detect on low level */ |
bcostm | 0:d83f1c8ca282 | 63 | IO_MODE_IT_HIGH_LEVEL, /* float input - irq detect on high level */ |
bcostm | 0:d83f1c8ca282 | 64 | /* following modes only available on MFX*/ |
bcostm | 0:d83f1c8ca282 | 65 | IO_MODE_ANALOG, /* analog mode */ |
bcostm | 0:d83f1c8ca282 | 66 | IO_MODE_OFF, /* when pin isn't used*/ |
bcostm | 0:d83f1c8ca282 | 67 | IO_MODE_INPUT_PU, /* input with internal pull up resistor */ |
bcostm | 0:d83f1c8ca282 | 68 | IO_MODE_INPUT_PD, /* input with internal pull down resistor */ |
bcostm | 0:d83f1c8ca282 | 69 | IO_MODE_OUTPUT_OD, /* Open Drain output without internal resistor */ |
bcostm | 0:d83f1c8ca282 | 70 | IO_MODE_OUTPUT_OD_PU, /* Open Drain output with internal pullup resistor */ |
bcostm | 0:d83f1c8ca282 | 71 | IO_MODE_OUTPUT_OD_PD, /* Open Drain output with internal pulldown resistor */ |
bcostm | 0:d83f1c8ca282 | 72 | IO_MODE_OUTPUT_PP, /* PushPull output without internal resistor */ |
bcostm | 0:d83f1c8ca282 | 73 | IO_MODE_OUTPUT_PP_PU, /* PushPull output with internal pullup resistor */ |
bcostm | 0:d83f1c8ca282 | 74 | IO_MODE_OUTPUT_PP_PD, /* PushPull output with internal pulldown resistor */ |
bcostm | 0:d83f1c8ca282 | 75 | IO_MODE_IT_RISING_EDGE_PU, /* push up resistor input - irq on rising edge */ |
bcostm | 0:d83f1c8ca282 | 76 | IO_MODE_IT_RISING_EDGE_PD, /* push dw resistor input - irq on rising edge */ |
bcostm | 0:d83f1c8ca282 | 77 | IO_MODE_IT_FALLING_EDGE_PU, /* push up resistor input - irq on falling edge */ |
bcostm | 0:d83f1c8ca282 | 78 | IO_MODE_IT_FALLING_EDGE_PD, /* push dw resistor input - irq on falling edge */ |
bcostm | 0:d83f1c8ca282 | 79 | IO_MODE_IT_LOW_LEVEL_PU, /* push up resistor input - irq detect on low level */ |
bcostm | 0:d83f1c8ca282 | 80 | IO_MODE_IT_LOW_LEVEL_PD, /* push dw resistor input - irq detect on low level */ |
bcostm | 0:d83f1c8ca282 | 81 | IO_MODE_IT_HIGH_LEVEL_PU, /* push up resistor input - irq detect on high level */ |
bcostm | 0:d83f1c8ca282 | 82 | IO_MODE_IT_HIGH_LEVEL_PD, /* push dw resistor input - irq detect on high level */ |
bcostm | 0:d83f1c8ca282 | 83 | |
bcostm | 0:d83f1c8ca282 | 84 | }IO_ModeTypedef; |
bcostm | 0:d83f1c8ca282 | 85 | |
bcostm | 0:d83f1c8ca282 | 86 | /** @defgroup IO_Driver_structure IO Driver structure |
bcostm | 0:d83f1c8ca282 | 87 | * @{ |
bcostm | 0:d83f1c8ca282 | 88 | */ |
bcostm | 0:d83f1c8ca282 | 89 | typedef struct |
bcostm | 0:d83f1c8ca282 | 90 | { |
bcostm | 0:d83f1c8ca282 | 91 | void (*Init)(uint16_t); |
bcostm | 0:d83f1c8ca282 | 92 | uint16_t (*ReadID)(uint16_t); |
bcostm | 0:d83f1c8ca282 | 93 | void (*Reset)(uint16_t); |
bcostm | 0:d83f1c8ca282 | 94 | |
bcostm | 0:d83f1c8ca282 | 95 | void (*Start)(uint16_t, uint32_t); |
bcostm | 0:d83f1c8ca282 | 96 | uint8_t (*Config)(uint16_t, uint32_t, IO_ModeTypedef); |
bcostm | 0:d83f1c8ca282 | 97 | void (*WritePin)(uint16_t, uint32_t, uint8_t); |
bcostm | 0:d83f1c8ca282 | 98 | uint32_t (*ReadPin)(uint16_t, uint32_t); |
bcostm | 0:d83f1c8ca282 | 99 | |
bcostm | 0:d83f1c8ca282 | 100 | void (*EnableIT)(uint16_t); |
bcostm | 0:d83f1c8ca282 | 101 | void (*DisableIT)(uint16_t); |
bcostm | 0:d83f1c8ca282 | 102 | uint32_t (*ITStatus)(uint16_t, uint32_t); |
bcostm | 0:d83f1c8ca282 | 103 | void (*ClearIT)(uint16_t, uint32_t); |
bcostm | 0:d83f1c8ca282 | 104 | |
bcostm | 0:d83f1c8ca282 | 105 | }IO_DrvTypeDef; |
bcostm | 0:d83f1c8ca282 | 106 | /** |
bcostm | 0:d83f1c8ca282 | 107 | * @} |
bcostm | 0:d83f1c8ca282 | 108 | */ |
bcostm | 0:d83f1c8ca282 | 109 | |
bcostm | 0:d83f1c8ca282 | 110 | /** |
bcostm | 0:d83f1c8ca282 | 111 | * @} |
bcostm | 0:d83f1c8ca282 | 112 | */ |
bcostm | 0:d83f1c8ca282 | 113 | |
bcostm | 0:d83f1c8ca282 | 114 | /** |
bcostm | 0:d83f1c8ca282 | 115 | * @} |
bcostm | 0:d83f1c8ca282 | 116 | */ |
bcostm | 0:d83f1c8ca282 | 117 | |
bcostm | 0:d83f1c8ca282 | 118 | /** |
bcostm | 0:d83f1c8ca282 | 119 | * @} |
bcostm | 0:d83f1c8ca282 | 120 | */ |
bcostm | 0:d83f1c8ca282 | 121 | |
bcostm | 0:d83f1c8ca282 | 122 | /** |
bcostm | 0:d83f1c8ca282 | 123 | * @} |
bcostm | 0:d83f1c8ca282 | 124 | */ |
bcostm | 0:d83f1c8ca282 | 125 | |
bcostm | 0:d83f1c8ca282 | 126 | #ifdef __cplusplus |
bcostm | 0:d83f1c8ca282 | 127 | } |
bcostm | 0:d83f1c8ca282 | 128 | #endif |
bcostm | 0:d83f1c8ca282 | 129 | |
bcostm | 0:d83f1c8ca282 | 130 | #endif /* __IO_H */ |
bcostm | 0:d83f1c8ca282 | 131 | |
bcostm | 0:d83f1c8ca282 | 132 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |