IUNO-TDM / MotorShield

PCB schematic and layout for a raspberry pi shield, that can drive up to 8 dc motors .
https://iuno.axoom.cloud/
Creative Commons Attribution Share Alike 4.0 International
1 stars 2 forks source link

modify dotstar library to use correct CS #11

Closed bockha closed 6 years ago

bockha commented 7 years ago

Modify the dotstar.so to use spi0.1 with chip select according to #3.

bockha commented 6 years ago

dotstar.c

@@ -257,11 +257,11 @@ static int boardType(void) {
 // Initialize pins/SPI for output
 static PyObject *begin(DotStarObject *self) {
        if(self->dataPin == 0xFF) { // Use hardware SPI
-               if((self->fd = open("/dev/spidev0.0", O_RDWR)) < 0) {
-                       printf("Can't open /dev/spidev0.0 (try 'sudo')\n");
+               if((self->fd = open("/dev/spidev0.1", O_RDWR)) < 0) {
+                       printf("Can't open /dev/spidev0.1 (try 'sudo')\n");
                        return NULL;
                }
-               uint8_t mode = SPI_MODE_0 | SPI_NO_CS;
+               uint8_t mode = SPI_MODE_0 ; // | SPI_NO_CS;
                ioctl(self->fd, SPI_IOC_WR_MODE, &mode);
                // The actual data rate may be less than requested.
                // Hardware SPI speed is a function of the system core
bockha commented 6 years ago

This issue was moved to IUNO-TDM/MixerControl#101

bockha commented 6 years ago

SPI1 with CE1 (GPIO17) is used in future revision of motorshield

gpios

bockha commented 6 years ago

This issue was moved to IUNO-TDM/MixerControl#116