mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 15:21:32 +00:00
added endianness to natsemi.
This commit is contained in:
parent
0c324caecf
commit
c6d0ef3478
@ -96,18 +96,13 @@ static void spi_bit_transfer ( struct spi_bit_basher *spibit,
|
||||
|
||||
DBG ( "Transferring %d bits in mode %x\n", len, bus->mode );
|
||||
|
||||
<<<<<<< HEAD:src/drivers/bitbash/spi_bit.c
|
||||
for ( step = 0 ; step < ( len * 2 ) ; step++ ) {
|
||||
/* Calculate byte offset and byte mask */
|
||||
bit_offset = ( ( endianness == SPI_BIT_BIG_ENDIAN ) ?
|
||||
( len - ( step / 2 ) - 1 ) : ( step / 2 ) );
|
||||
byte_offset = ( bit_offset / 8 );
|
||||
byte_mask = ( 1 << ( bit_offset % 8 ) );
|
||||
=======
|
||||
>>>>>>> debugging natsemi.c:src/drivers/bitbash/spi_bit.c
|
||||
<<<<<<< HEAD:src/drivers/bitbash/spi_bit.c
|
||||
=======
|
||||
>>>>>>> debugging natsemi.c:src/drivers/bitbash/spi_bit.c
|
||||
|
||||
/* Shift data in or out */
|
||||
if ( sclk == cpha ) {
|
||||
const uint8_t *byte;
|
||||
|
@ -221,6 +221,7 @@ static struct nvo_fragment nat_nvo_fragments[] = {
|
||||
// Initialise three-wire bus
|
||||
nat->spibit.basher.op = &nat_basher_ops;
|
||||
nat->spibit.bus.mode = SPI_MODE_THREEWIRE;
|
||||
nat->spibit.endianness = SPI_BIT_LITTLE_ENDIAN;
|
||||
init_spi_bit_basher ( &nat->spibit );
|
||||
|
||||
DBG ( "EEPROM is an AT93C46\n" );
|
||||
|
Loading…
Reference in New Issue
Block a user