From 1273d2f88a0c86e875d980d63bd926abf1c89ba8 Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Thu, 16 Jul 2026 14:01:28 -0600 Subject: [PATCH] testing on cpu1 gpio22 --- gpio_driverlib_cpu1/gpio_driverlib_cpu1.c | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gpio_driverlib_cpu1/gpio_driverlib_cpu1.c b/gpio_driverlib_cpu1/gpio_driverlib_cpu1.c index e69de29..6484fcf 100644 --- a/gpio_driverlib_cpu1/gpio_driverlib_cpu1.c +++ b/gpio_driverlib_cpu1/gpio_driverlib_cpu1.c @@ -0,0 +1,46 @@ +/*Gerardo Marx +16th July 2026 +GPIOs management with dual CPUs +---------------- +CPU1: GPIO22 and GPIO97 using driverlib approach +CPU2: GPIO52 using bitfield approach + + |-----------| + | | + |GPIO22 | + | | + | ---- | + |GPIO97 | + | | + |GPIO52 | + |-----------| +*/ + +// Libraries and includes +#include "driverlib.h" +#include "device.h" + +void main(void){ + // 1: Initialize device clock and peripherals + Device_init(); + + // 2: Initialize GPIO and configure the GPIO pin as a push-pull output + Device_initGPIO(); + // gpio-22 + GPIO_setPadConfig(22, GPIO_PIN_TYPE_STD); + GPIO_setDirectionMode(22, GPIO_DIR_MODE_OUT); + GPIO_writePin(22, 1); + + //GPIO_setControllerCore(22, GPIO_CoreSelect core) + + + // gpio-97: + GPIO_setPadConfig(97, GPIO_PIN_TYPE_STD); + // gpio-52 + GPIO_setPadConfig(52, GPIO_PIN_TYPE_STD); + + + // 3: gpios state in infinite loop + for(;;) + {} +}