spi_data_type platform_spi_send_recv( uint8_t id, uint8_t bitlen, spi_data_type data ) { if (bitlen > 32) return 0; spi_mast_set_mosi( id, 0, bitlen, data ); spi_mast_transaction( id, 0, 0, 0, 0, bitlen, 0, -1 ); return spi_mast_get_miso( id, 0, bitlen ); }
int platform_spi_set_mosi( uint8_t id, uint8_t offset, uint8_t bitlen, spi_data_type data ) { if (offset + bitlen > 512) return PLATFORM_ERR; spi_mast_set_mosi( id, offset, bitlen, data ); return PLATFORM_OK; }