Регистры Allwinner H616

Сокращения  |  Дерево шин  |  Карта памяти


SPI_BATCR
9.3.5. SPI Bit-Aligned Transfer Configure Register - адрес: 0x5010040 0x5011040 (смещение: 0x0040)

Синхронный последовательный интерфейс: список регистров



31 ||||||||||||||||| 16
15 ||||||||||||||||| 00

  TCE

Bit 31
R/WAC
0x0

Transfer Control Enable
In master mode, it is used to start to transfer the serial bits frame, it is only
valid when Work Mode Select==0x10/0x11.
0: Idle
1: Initiates transfer
Writing \"1\" to this bit will start to transfer serial bits frame(the value comes
from the SPI TX Bit Register or SPI RX Bit Register), and will auto clear after
the bursts transfer completely. Writing '0' to this bit has no effect.


  MSMS

Bit 30
R/W
0x0

Master Sample Standard
0: Delay Sample Mode
1: Standard Sample Mode
In Standard Sample Mode, SPI master samples the data at the standard
rising edge of SCLK for each SPI mode;
In Delay Sample Mode, SPI master samples data at the edge that is half cycle
delayed by the standard rising edge of SCLK defined in respective SPI mode.


  Unused

Bits 29 : 26

  TBC

Bit 25
R/W1C
0x0

Transfer Bits Completed
When set, this bit indicates that the last bit of the serial data frame in SPI TX
Bit Register(or SPI RX Bit Register) has been transferred completely. Writing 1
to this bit clears it.
0: Busy
1: Transfer Completed
It is only valid when Work Mode Select==0x10/0x11.


  TBC_INT_EN

Bit 24
R/W
0x0

Transfer Bits Completed Interrupt Enable
0: Disable
1: Enable
It is only valid when Work Mode Select==0x10/0x11.


  Unused

Bits 23 : 22

  LEN_FRAME_RX

Bits 21 : 16
R/W
0x00

Configure the length of serial data frame(burst) of RX
000000: 0bit
000001: 1bit
***
100000: 32bits
Other values: reserved
It is only valid when Work Mode Select==0x10/0x11, and cannot be written when TCE=1.


  Unused

Bits 15 : 14

  LEN_FRAME_TX

Bits 13 : 8
R/W
0x00

Configure the length of serial data frame(burst) of TX
000000: 0bit
000001: 1bit
***
100000: 32bits
Other values: reserved
It is only valid when Work Mode Select==0x10/0x11, and cannot be written when TCE=1.


  SS_LEVEL

Bit 7
R/W
0x1

When control SS signal manually , set this bit to 1 or '0' to control the level of
SS signal.
0: Set SS to low
1: Set SS to high
It is only valid when Work Mode Select==0x10/0x11, and only work in Mode0, cannot be written when TCE=1.


  SS_OWNER

Bit 6
R/W
0x0

SS Output Owner Select
Usually, controller sends SS signal automatically with data together. When this
bit is set to 1, software must manually write SPI_CTL_REG.SS_LEVEL to 1 or 0
to control the level of SS signal.
0: SPI controller
1: Software
It is only valid when Work Mode Select==0x10/0x11, and only work in Mode0, cannot be written when TCE=1.


  SPOL

Bit 5
R/W
0x1

SPI Chip Select Signal Polarity Control
0: Active high polarity (0 = Idle)
1: Active low polarity (1 = Idle)
It is only valid when Work Mode Select==0x10/0x11, and only work in Mode0, cannot be written when TCE=1.


  Unused

Bit 4

  SS_SEL

Bits 3 : 2
R/W
0x0

SPI Chip Select
Select one of four external SPI Master/Slave Devices
00: SPI_SS0 will be asserted
01: SPI_SS1 will be asserted
10: SPI_SS2 will be asserted
11: SPI_SS3 will be asserted
It is only valid when Work Mode Select= =0x10/0x11, and only work in
Mode0, cannot be written when TCE=1.


  WM_SEL

Bits 1 : 0
R/W
0x0

Work Mode Select
00: Data frame is byte aligned in standard SPI, dual-output/dual input SPI, dual IO SPI and quad-output/quad-input SPI.
01: Reserved
10: Data frame is bit aligned in 3-wire SPI
11: Data frame is bit aligned in standard SPI



Команда U-Boot для чтения регистра

md 5010040 1
md 5011040 1



Bit fields structure

typedef union  spi_batcr
{
  struct
  {
   unsigned wm_sel : 2;
   unsigned ss_sel : 2;
   unsigned unused0 : 1;
   unsigned spol : 1;
   unsigned ss_owner : 1;
   unsigned ss_level : 1;
   unsigned len_frame_tx : 6;
   unsigned unused1 : 2;
   unsigned len_frame_rx : 6;
   unsigned unused2 : 2;
   unsigned tbc_int_en : 1;
   unsigned tbc : 1;
   unsigned unused3 : 4;
   unsigned msms : 1;
   unsigned tce : 1;
  } b;
   unsigned long w;
} SPI_BATCR
   

Allwinner H616 Manual