testing on cpu1 gpio22

main
Gerardo Marx 1 week ago
parent 86328f9881
commit 1273d2f88a

@ -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(;;)
{}
}
Loading…
Cancel
Save