Refactoring menu code to be non-blocking

Added macros for GPIO read/write
This commit is contained in:
2025-05-16 07:56:18 -05:00
parent a3ef12e24a
commit da0dd55b20
11 changed files with 316 additions and 41 deletions

30
source/io.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef IO_H_
#define IO_H_
#include "fsl_gpio.h"
#define LOW 0
#define HIGH 1
#define PORT0 0
#define PORT1 1
#define PIN_VBUS (PORT1, 6)
#define PIN_POT_CS (PORT1, 7)
#define PIN_SIG_CS (PORT1, 9)
#define PIN_SD_CS (PORT1, 10)
#define PIN_RAMP_CS (PORT1, 11)
#define PIN_SIG_RESET (PORT1, 12)
#define PIN_SD_RESET (PORT1, 13)
#define PIN_RAMP_RST (PORT1, 14)
#define PIN_POWER_CTL (PORT1, 16)
#define PIN_ESTOP (PORT1, 17)
#define _P1(p1, p2) p1
#define _P2(p1, p2) p2
#define GPIO_WRITE(port_pin, value) GPIO_PinWrite(GPIO, _P1 port_pin, _P2 port_pin, value )
#define GPIO_READ(port_pin) GPIO_PinRead (GPIO, _P1 port_pin, _P2 port_pin)
#endif