Регистры Allwinner H616

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

Двухпроводной интерфейс ( Руководство )

Имя модуля: TWI0 , базовый адрес: 0x05002000

Имя модуля: TWI1 , базовый адрес: 0x05002400

Имя модуля: TWI2 , базовый адрес: 0x05002800

Имя модуля: TWI3 , базовый адрес: 0x05002C00

Имя модуля: TWI4 , базовый адрес: 0x05003000

Имя модуля: R-TWI0 , базовый адрес: 0x07081400

Руководство п. 9.1.5


Регистров: 19

Имя регистра | Смещение


  • 1) TWI_ADDR | 0x0000

    typedef union  twi_addr
    {
      struct
      {
       unsigned gce : 1;
       unsigned sla : 7;
       unsigned unused0 : 24;
      } b;
       unsigned long w;
    } TWI_ADDR
       

  • 2) TWI_XADDR | 0x0004

    typedef union  twi_xaddr
    {
      struct
      {
       unsigned slax : 8;
       unsigned unused0 : 24;
      } b;
       unsigned long w;
    } TWI_XADDR
       

  • 3) TWI_DATA | 0x0008

    typedef union  twi_data
    {
      struct
      {
       unsigned twi_data : 8;
       unsigned unused0 : 24;
      } b;
       unsigned long w;
    } TWI_DATA
       

  • 4) TWI_CNTR | 0x000C

    typedef union  twi_cntr
    {
      struct
      {
       unsigned clk_count_mode : 1;
       unsigned unused0 : 1;
       unsigned a_ack : 1;
       unsigned int_flag : 1;
       unsigned m_stp : 1;
       unsigned m_sta : 1;
       unsigned bus_en : 1;
       unsigned int_en : 1;
       unsigned unused1 : 24;
      } b;
       unsigned long w;
    } TWI_CNTR
       

  • 5) TWI_STAT | 0x0010

    typedef union  twi_stat
    {
      struct
      {
       unsigned sta : 8;
       unsigned unused0 : 24;
      } b;
       unsigned long w;
    } TWI_STAT
       

  • 6) TWI_CCR | 0x0014

    typedef union  twi_ccr
    {
      struct
      {
       unsigned clk_n : 3;
       unsigned clk_m : 4;
       unsigned clk_duty : 1;
       unsigned unused0 : 24;
      } b;
       unsigned long w;
    } TWI_CCR
       

  • 7) TWI_SRST | 0x0018

    typedef union  twi_srst
    {
      struct
      {
       unsigned soft_rst : 1;
       unsigned unused0 : 31;
      } b;
       unsigned long w;
    } TWI_SRST
       

  • 8) TWI_EFR | 0x001C

    typedef union  twi_efr
    {
      struct
      {
       unsigned dbn : 2;
       unsigned unused0 : 30;
      } b;
       unsigned long w;
    } TWI_EFR
       

  • 9) TWI_LCR | 0x0020

    typedef union  twi_lcr
    {
      struct
      {
       unsigned sda_ctl_en : 1;
       unsigned sda_ctl : 1;
       unsigned scl_ctl_en : 1;
       unsigned scl_ctl : 1;
       unsigned sda_state : 1;
       unsigned scl_state : 1;
       unsigned unused0 : 26;
      } b;
       unsigned long w;
    } TWI_LCR
       

  • 10) TWI_DRV_CTRL | 0x0200

    typedef union  twi_drv_ctrl
    {
      struct
      {
       unsigned twi_drv_en : 1;
       unsigned soft_reset : 1;
       unsigned unused0 : 6;
       unsigned timeout_n : 8;
       unsigned twi_sta : 8;
       unsigned tran_result : 4;
       unsigned read_tran_mode : 1;
       unsigned restart_mode : 1;
       unsigned unused1 : 1;
       unsigned start_tran : 1;
      } b;
       unsigned long w;
    } TWI_DRV_CTRL
       

  • 11) TWI_DRV_CFG | 0x0204

    typedef union  twi_drv_cfg
    {
      struct
      {
       unsigned packet_cnt : 16;
       unsigned pkt_interval : 16;
      } b;
       unsigned long w;
    } TWI_DRV_CFG
       

  • 12) TWI_DRV_SLV | 0x0208

    typedef union  twi_drv_slv
    {
      struct
      {
       unsigned slv_id_x : 8;
       unsigned cmd : 1;
       unsigned slv_id : 7;
       unsigned unused0 : 16;
      } b;
       unsigned long w;
    } TWI_DRV_SLV
       

  • 13) TWI_DRV_FMT | 0x020C

    typedef union  twi_drv_fmt
    {
      struct
      {
       unsigned data_byte : 16;
       unsigned addr_byte : 8;
       unsigned unused0 : 8;
      } b;
       unsigned long w;
    } TWI_DRV_FMT
       

  • 14) TWI_DRV_BUS_CTRL | 0x0210

    typedef union  twi_drv_bus_ctrl
    {
      struct
      {
       unsigned sda_moe : 1;
       unsigned scl_moe : 1;
       unsigned sda_mov : 1;
       unsigned scl_mov : 1;
       unsigned unused0 : 2;
       unsigned sda_sta : 1;
       unsigned scl_sta : 1;
       unsigned clk_m : 4;
       unsigned clk_n : 3;
       unsigned clk_duty : 1;
       unsigned clk_count_mode : 1;
       unsigned unused1 : 15;
      } b;
       unsigned long w;
    } TWI_DRV_BUS_CTRL
       

  • 15) TWI_DRV_INT_CTRL | 0x0214

    typedef union  twi_drv_int_ctrl
    {
      struct
      {
       unsigned tran_com_pd : 1;
       unsigned tran_err_pd : 1;
       unsigned tx_req_pd : 1;
       unsigned rx_req_pd : 1;
       unsigned unused0 : 12;
       unsigned tran_com_int_en : 1;
       unsigned tran_err_int_en : 1;
       unsigned tx_req_int_en : 1;
       unsigned rx_req_int_en : 1;
       unsigned unused1 : 12;
      } b;
       unsigned long w;
    } TWI_DRV_INT_CTRL
       

  • 16) TWI_DRV_DMA_CFG | 0x0218

    typedef union  twi_drv_dma_cfg
    {
      struct
      {
       unsigned tx_trig : 6;
       unsigned unused0 : 2;
       unsigned dma_tx_en : 1;
       unsigned unused1 : 7;
       unsigned rx_trig : 6;
       unsigned unused2 : 2;
       unsigned dma_rx_en : 1;
       unsigned unused3 : 7;
      } b;
       unsigned long w;
    } TWI_DRV_DMA_CFG
       

  • 17) TWI_DRV_FIFO_CON | 0x021C

    typedef union  twi_drv_fifo_con
    {
      struct
      {
       unsigned send_fifo_content : 6;
       unsigned send_fifo_clear : 1;
       unsigned unused0 : 9;
       unsigned recv_fifo_content : 6;
       unsigned recv_fifo_clear : 1;
       unsigned unused1 : 9;
      } b;
       unsigned long w;
    } TWI_DRV_FIFO_CON
       

  • 18) TWI_DRV_SEND_FIFO_ACC | 0x0300

    typedef union  twi_drv_send_fifo_acc
    {
      struct
      {
       unsigned send_data_fifo : 8;
       unsigned unused0 : 24;
      } b;
       unsigned long w;
    } TWI_DRV_SEND_FIFO_ACC
       

  • 19) TWI_DRV_RECV_FIFO_ACC | 0x0304

    typedef union  twi_drv_recv_fifo_acc
    {
      struct
      {
       unsigned recv_data_fifo : 8;
       unsigned unused0 : 24;
      } b;
       unsigned long w;
    } TWI_DRV_RECV_FIFO_ACC
       


  • Allwinner H616 Manual