Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: GPIO as SPI Chip Select

$
0
0

Hi Titus,


Thanks for the reply. Yes pin mux is ok for GPIO 138. Just check that. Also the McSPI2_CS1 is shared between three devices via GPIO CS pins which are GPIO 138, 136, 55

Am i correct in saying that if I define .controller_data as

struct select_device {

shared_devices device;

unsigned char cs_gpio;

}

enum shared_devices {

DEVICE1, // All are same IO Extender cards

DEVICE2,

DEVICE3

}

.controller_data = &select_device;

This way when I read and write to a device by checking which one needs to be spoken to and toggle the appropriate GPIO line or is there a better way to do it.


Viewing all articles
Browse latest Browse all 25965


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>