CARME-M4 BSP  V1.5
carme_io1.h
Go to the documentation of this file.
1 #ifndef __CARME_IO1_H__
2 #define __CARME_IO1_H__
3 
72 #ifdef __cplusplus
73 extern "C" {
74 #endif /* __cplusplus */
75 
76 /*----- Header-Files -------------------------------------------------------*/
77 #include <stm32f4xx.h> /* Processor STM32F407IG */
78 
79 /*----- Macros -------------------------------------------------------------*/
80 #define CARME_IO1_BUTTON0_PORT GPIOC
81 #define CARME_IO1_BUTTON1_PORT GPIOB
82 #define CARME_IO1_BUTTON2_PORT GPIOB
83 #define CARME_IO1_BUTTON3_PORT GPIOI
84 #define CARME_IO1_BUTTON0_PIN GPIO_Pin_7
85 #define CARME_IO1_BUTTON1_PIN GPIO_Pin_15
86 #define CARME_IO1_BUTTON2_PIN GPIO_Pin_14
87 #define CARME_IO1_BUTTON3_PIN GPIO_Pin_0
88 
89 /*----- Data types ---------------------------------------------------------*/
93 typedef enum _CARME_IO1_PIO_PORT {
95 // CARME_IO1_PORT_B,
100 
114 
115 /*----- Function prototypes ------------------------------------------------*/
116 extern void CARME_IO1_Init(void);
117 extern void CARME_IO1_LED_Set(uint8_t write, uint8_t mask);
118 extern void CARME_IO1_LED_Get(uint8_t *pStatus);
119 extern void CARME_IO1_SWITCH_Get(uint8_t *pStatus);
120 extern void CARME_IO1_BUTTON_Get(uint8_t *pStatus);
121 extern void CARME_IO1_BUTTON_Interrupt(FunctionalState NewState);
122 extern void CARME_IO1_PIO_Write(CARME_IO1_PIO_PORT port, uint8_t data);
123 extern void CARME_IO1_PIO_Read(CARME_IO1_PIO_PORT port, uint8_t *data);
124 extern void CARME_IO1_PIO_Set(CARME_IO1_PIO_PORT port, uint8_t pio);
125 extern void CARME_IO1_PIO_Clear(CARME_IO1_PIO_PORT port, uint8_t pio);
127 
128 /*----- Data ---------------------------------------------------------------*/
129 
130 #ifdef __cplusplus
131 }
132 #endif /* __cplusplus */
133 
139 #endif /* __CARME_IO1_H__ */
enum _CARME_IO1_PIO_PORT CARME_IO1_PIO_PORT
This enum contains all available Ports of the PIO device.
void CARME_IO1_BUTTON_Get(uint8_t *pStatus)
Get the CARME IO1 button status.
Definition: carme_io1.c:235
void CARME_IO1_PIO_Read(CARME_IO1_PIO_PORT port, uint8_t *data)
Read the PIO value.
Definition: carme_io1.c:354
void CARME_IO1_PIO_Clear(CARME_IO1_PIO_PORT port, uint8_t pio)
Clears the PIO on the position of the input value. For example the input value 0x4 clears the pin nu...
Definition: carme_io1.c:412
enum _CARME_IO1_PIO_CONTROL CARME_IO1_PIO_CONTROL
This contains all possible commands for the PIO device.
_CARME_IO1_PIO_PORT
This enum contains all available Ports of the PIO device.
Definition: carme_io1.h:93
void CARME_IO1_PIO_Write(CARME_IO1_PIO_PORT port, uint8_t data)
Sets the PIOs in order with the input-value.
Definition: carme_io1.c:323
void CARME_IO1_LED_Set(uint8_t write, uint8_t mask)
Set a byte to the CARME IO1 LEDs.
Definition: carme_io1.c:182
void CARME_IO1_SWITCH_Get(uint8_t *pStatus)
Get the CARME IO1 switch status.
Definition: carme_io1.c:222
void CARME_IO1_PIO_Set(CARME_IO1_PIO_PORT port, uint8_t pio)
Sets the PIO on the position of the input value. For example the input value 0x4 sets the pin number...
Definition: carme_io1.c:385
void CARME_IO1_BUTTON_Interrupt(FunctionalState NewState)
Set the CARME IO1 interrupt enable/disable.
Definition: carme_io1.c:256
void CARME_IO1_PIO_Control(CARME_IO1_PIO_CONTROL cmd)
Sets the PIO Control Register. This function must be called to change the Port direction.
Definition: carme_io1.c:439
_CARME_IO1_PIO_CONTROL
This contains all possible commands for the PIO device.
Definition: carme_io1.h:104
void CARME_IO1_Init(void)
CARME IO1 initialization.
Definition: carme_io1.c:163
void CARME_IO1_LED_Get(uint8_t *pStatus)
Get the CARME IO1 LED status.
Definition: carme_io1.c:209