Esempio n. 1
0
void raspberrypiInit(void) {

	memset(pinModes, -1, NUM_PINS);

	platform_register(&raspberrypi, "raspberrypi");
	raspberrypi->setup=&setup;
	raspberrypi->pinMode=&raspberrypiPinMode;
	raspberrypi->digitalWrite=&raspberrypiDigitalWrite;
	raspberrypi->digitalRead=&raspberrypiDigitalRead;
	raspberrypi->identify=&piBoardRev;
	raspberrypi->isr=&raspberrypiISR;
	raspberrypi->waitForInterrupt=&raspberrypiWaitForInterrupt;
#ifndef __FreeBSD__
	raspberrypi->I2CRead=&raspberrypiI2CRead;
	raspberrypi->I2CReadReg8=&raspberrypiI2CReadReg8;
	raspberrypi->I2CReadReg16=&raspberrypiI2CReadReg16;
	raspberrypi->I2CWrite=&raspberrypiI2CWrite;
	raspberrypi->I2CWriteReg8=&raspberrypiI2CWriteReg8;
	raspberrypi->I2CWriteReg16=&raspberrypiI2CWriteReg16;
	raspberrypi->I2CSetup=&raspberrypiI2CSetup;
	raspberrypi->SPIGetFd=&raspberrypiSPIGetFd;
	raspberrypi->SPIDataRW=&raspberrypiSPIDataRW;
	raspberrypi->SPISetup=&raspberrypiSPISetup;
#endif
	raspberrypi->gc=&raspberrypiGC;
	raspberrypi->validGPIO=&raspberrypiValidGPIO;
}
Esempio n. 2
0
void bananapiM2Init(void) {
	platform_register(&bananapim2, "bananapim2");

	bananapim2->soc = soc_get("Allwinner", "A31s");

	bananapim2->digitalRead = bananapim2->soc->digitalRead;
	bananapim2->digitalWrite = &bananapiM2DigitalWrite;
	bananapim2->pinMode = &bananapiM2PinMode;
	bananapim2->setup = &bananapiM2Setup;

	bananapim2->selectableFd = bananapim2->soc->selectableFd;
	bananapim2->gc = bananapim2->soc->gc;

	bananapim2->validGPIO = &bananapiM2ValidGPIO;
}
Esempio n. 3
0
void orangepipc2Init(void) {
	platform_register(&orangepipc2, "orangepipc2");

	orangepipc2->soc = soc_get("Allwinner", "H5");

	orangepipc2->digitalRead = &orangepipc2DigitalRead;
	orangepipc2->digitalWrite = &orangepipc2DigitalWrite;
	orangepipc2->pinMode = &orangepipc2PinMode;
	orangepipc2->setup = &orangepipc2Setup;

	orangepipc2->isr = &orangepipc2ISR;
	orangepipc2->waitForInterrupt = orangepipc2->soc->waitForInterrupt;

	orangepipc2->selectableFd = orangepipc2->soc->selectableFd;
	orangepipc2->gc = orangepipc2->soc->gc;

	orangepipc2->validGPIO = &orangepipc2ValidGPIO;
}
Esempio n. 4
0
void odroidxu4Init(void) {
	platform_register(&odroidxu4, "odroidxu4");

	odroidxu4->soc = soc_get("Samsung", "Exynos5422");
	odroidxu4->soc->setMap(map, sizeof(map) / sizeof(map[0]));

	odroidxu4->digitalRead = odroidxu4->soc->digitalRead;
	odroidxu4->digitalWrite = odroidxu4->soc->digitalWrite;
	odroidxu4->pinMode = odroidxu4->soc->pinMode;
	odroidxu4->setup = odroidxu4Setup;

	odroidxu4->isr = odroidxu4->soc->isr;
	odroidxu4->waitForInterrupt = odroidxu4->soc->waitForInterrupt;

	odroidxu4->selectableFd = odroidxu4->soc->selectableFd;
	odroidxu4->gc = odroidxu4->soc->gc;

	odroidxu4->validGPIO = &odroidxu4ValidGPIO;
}