This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI Driver Function MSP430G2432

Other Parts Discussed in Thread: MSP430G2432

Hi together, 

I'm trying to write a driver function for the SPI interface of MSP430G2432 according to the following pseudo code:

void mcu_spi_read(uint8_t num_bytes, uint8_t addr, uint8_t * data);
void mcu_spi_write(uint8_t num_bytes, uint8_t addr, uint8_t * data);

However, the shift register USISR for the write only contains the USISRH and the USISHL register, so that I can only send the address and one byte data. The only possibility I can see to to use the DMA burst-block transfer function . Are there some finished driver functions available since I havent found them in the example codes?

Thanks a lot!

 

 

 

 

  • Yue Zhang said:
    the following pseudo code:

    void mcu_spi_read(uint8_t num_bytes, uint8_t addr, uint8_t * data);
    void mcu_spi_write(uint8_t num_bytes, uint8_t addr, uint8_t * data);

    That's not pseudo code - that's just a pair of function prototypes; ie, it tells you the interface you have to work with.

    Yue Zhang said:
    so that I can only send the address and one byte data

    So you write code to send the address, and then one byte, and then the next, and so on until you've compleded the specified length!

     

**Attention** This is a public forum