Advanced Distributed Systems module at HSLU
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
1.0 KiB

/*
* Copyright (c) 2022, Erich Styger
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SRC_GPIO_H_
#define SRC_GPIO_H_
#include <stdbool.h>
#include "platform.h"
/* Pins with the BCM/Broadcom numbers */
typedef enum {
#if PL_HAT_VERSION<=6
Gpio_Pins_LED_BLUE_PIN_BCM = 12, /* wPi 26 */
Gpio_Pins_LED_GREEN_PIN_BCM = 16, /* wPi 27 */
Gpio_Pins_LED_YELLOW_PIN_BCM = 20, /* wPi 28 */
Gpio_Pins_LED_RED_PIN_BCM = 21, /* wPi 29 */
#else
Gpio_Pins_LED_RED_PIN_BCM = 16, /* wPi 27 */
Gpio_Pins_LED_GREEN_PIN_BCM = 21, /* wPi 29 */
Gpio_Pins_LED_YELLOW_PIN_BCM = 20, /* wPi 28 */
#endif
Gpio_Pins_BTN_UP_BCM = 5, /* wPi 21 */
Gpio_Pins_BTN_DOWN_BCM = 6, /* wPi 22 */
Gpio_Pins_BTN_RIGHT_BCM = 13, /* wPi 23 */
Gpio_Pins_BTN_LEFT_BCM = 19, /* wPi 24 */
Gpio_Pins_BTN_CENTER_BCM = 26, /* wPi 25 */
} Gpio_Pins_e;
bool Gpio_ReadPin(Gpio_Pins_e pin);
void Gpio_WritePin(Gpio_Pins_e pin, bool val);
int Gpio_Init(void);
int Gpio_Deinit(void);
#endif /* SRC_GPIO_H_ */