pub use tm4c_hal::gpio::*;
use crate::{
bb,
hal::digital::{InputPin, OutputPin, StatefulOutputPin},
sysctl,
};
use core::marker::PhantomData;
use tm4c_hal::gpio_macro;
pub trait GpioExt {
type Parts;
fn split(self, power_control: &sysctl::PowerControl) -> Self::Parts;
}
gpio_macro!(tm4c129x, GPIO_PORTA_AHB, gpioa, GpioA, PAx, [
PA0: (pa0, 0, Tristate),
PA1: (pa1, 1, Tristate),
PA2: (pa2, 2, Tristate),
PA3: (pa3, 3, Tristate),
PA4: (pa4, 4, Tristate),
PA5: (pa5, 5, Tristate),
PA6: (pa6, 6, Tristate),
PA7: (pa7, 7, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTB_AHB, gpiob, GpioB, PBx, [
PB0: (pb0, 0, Tristate),
PB1: (pb1, 1, Tristate),
PB2: (pb2, 2, Tristate),
PB3: (pb3, 3, Tristate),
PB4: (pb4, 4, Tristate),
PB5: (pb5, 5, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTC_AHB, gpioc, GpioC, PCx, [
PC0: (pc0, 0, Locked), PC1: (pc1, 1, Locked), PC2: (pc2, 2, Locked), PC3: (pc3, 3, Locked), PC4: (pc4, 4, Tristate),
PC5: (pc5, 5, Tristate),
PC6: (pc6, 6, Tristate),
PC7: (pc7, 7, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTD_AHB, gpiod, GpioD, PDx, [
PD0: (pd0, 0, Tristate),
PD1: (pd1, 1, Tristate),
PD2: (pd2, 2, Tristate),
PD3: (pd3, 3, Tristate),
PD4: (pd4, 4, Tristate),
PD5: (pd5, 5, Tristate),
PD6: (pd6, 6, Tristate),
PD7: (pd7, 7, Locked), ]);
gpio_macro!(tm4c129x, GPIO_PORTE_AHB, gpioe, GpioE, PEx, [
PE0: (pe0, 0, Tristate),
PE1: (pe1, 1, Tristate),
PE2: (pe2, 2, Tristate),
PE3: (pe3, 3, Tristate),
PE4: (pe4, 4, Tristate),
PE5: (pe5, 5, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTF_AHB, gpiof, GpioF, PFx, [
PF0: (pf0, 0, Tristate),
PF1: (pf1, 1, Tristate),
PF2: (pf2, 2, Tristate),
PF3: (pf3, 3, Tristate),
PF4: (pf4, 4, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTG_AHB, gpiog, GpioG, PGx, [
PG0: (pg0, 0, Tristate),
PG1: (pg1, 1, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTH_AHB, gpioh, GpioH, PHx, [
PH0: (ph0, 0, Tristate),
PH1: (ph1, 1, Tristate),
PH2: (ph2, 2, Tristate),
PH3: (ph3, 3, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTJ_AHB, gpioj, GpioJ, PJx, [
PJ0: (pj0, 0, Tristate),
PJ1: (pj1, 1, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTK, gpiok, GpioK, PKx, [
PK0: (pk0, 0, Tristate),
PK1: (pk1, 1, Tristate),
PK2: (pk2, 2, Tristate),
PK3: (pk3, 3, Tristate),
PK4: (pk4, 4, Tristate),
PK5: (pk5, 5, Tristate),
PK6: (pk6, 6, Tristate),
PK7: (pk7, 7, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTL, gpiol, GpioL, PNL, [
PL0: (pl0, 0, Tristate),
PL1: (pl1, 1, Tristate),
PL2: (pl2, 2, Tristate),
PL3: (pl3, 3, Tristate),
PL4: (pl4, 4, Tristate),
PL5: (pl5, 5, Tristate),
PL6: (pl6, 6, Tristate),
PL7: (pl7, 7, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTM, gpiom, GpioM, PMx, [
PM0: (pm0, 0, Tristate),
PM1: (pm1, 1, Tristate),
PM2: (pm2, 2, Tristate),
PM3: (pm3, 3, Tristate),
PM4: (pm4, 4, Tristate),
PM5: (pm5, 5, Tristate),
PM6: (pm6, 6, Tristate),
PM7: (pm7, 7, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTN, gpion, GpioN, PNx, [
PN0: (pn0, 0, Tristate),
PN1: (pn1, 1, Tristate),
PN2: (pn2, 2, Tristate),
PN3: (pn3, 3, Tristate),
PN4: (pn4, 4, Tristate),
PN5: (pn5, 5, Tristate),
PN6: (pn6, 6, Tristate),
PN7: (pn7, 7, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTP, gpiop, GpioP, PPx, [
PP0: (pp0, 0, Tristate),
PP1: (pp1, 1, Tristate),
PP2: (pp2, 2, Tristate),
PP3: (pp3, 3, Tristate),
PP4: (pp4, 4, Tristate),
PP5: (pp5, 5, Tristate),
]);
gpio_macro!(tm4c129x, GPIO_PORTQ, gpioq, GpioQ, PQx, [
PQ0: (pq0, 0, Tristate),
PQ1: (pq1, 1, Tristate),
PQ2: (pq2, 2, Tristate),
PQ3: (pq3, 3, Tristate),
PQ4: (pq4, 4, Tristate),
]);