<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                我們一般見的結構體初始化有兩種: ~~~ typedef struct { uint32_t I2C_ClockSpeed; /*!< Specifies the clock frequency. This parameter must be set to a value lower than 400kHz */ uint16_t I2C_Mode; /*!< Specifies the I2C mode. This parameter can be a value of @ref I2C_mode */ uint16_t I2C_DutyCycle; /*!< Specifies the I2C fast mode duty cycle. This parameter can be a value of @ref I2C_duty_cycle_in_fast_mode */ uint16_t I2C_OwnAddress1; /*!< Specifies the first device own address. This parameter can be a 7-bit or 10-bit address. */ uint16_t I2C_Ack; /*!< Enables or disables the acknowledgement. This parameter can be a value of @ref I2C_acknowledgement */ uint16_t I2C_AcknowledgedAddress; /*!< Specifies if 7-bit or 10-bit address is acknowledged. This parameter can be a value of @ref I2C_acknowledged_address */ }I2C_InitTypeDef; ~~~ 比如這個結構體,我們一般這樣初始化: ~~~ I2C_InitTypeDef i2c; i2c.I2C_Ack = I2C_Ack_Enable; i2c.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit; i2c.I2C_ClockSpeed = clock*1000; i2c.I2C_DutyCycle = I2C_DutyCycle_2; i2c.I2C_Mode = I2C_Mode_I2C; i2c.I2C_OwnAddress1 = addr; ~~~ ~~~ I2C_InitTypeDef i2c = { I2C_Ack_Enable, I2C_AcknowledgedAddress_7bit, clock*1000, I2C_DutyCycle_2, I2C_Mode_I2C, addr}; ~~~ 希望大家不要糾結我這個結構體變量的順序,肯定錯了,我只是說下有這種方法! 但是在linux內核里面有這樣一種初始化方法: ~~~ I2C_InitTypeDef i2c = { .I2C_Ack = I2C_Ack_Enable , .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit, .I2C_ClockSpeed = 40000, .I2C_DutyCycle = I2C_DutyCycle_2, .I2C_Mode = I2C_Mode_I2C , .I2C_OwnAddress1 = 0x0a }; ~~~ 但是在keil里面默認是不可以用這種方法初始化的,他屬于C99的標準,但是keil默認是C90的標準! 如果需要這樣用的話,或者你拿到的工程代碼里面有這樣定義的,我們可以這樣設置就可以了! ![](https://box.kancloud.cn/2016-06-21_576915baa90a7.jpg) 藍橋杯-嵌入式交流群 147520657
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看