Please provide me the sample code for TWIM using the nrfx_twim.h

Please provide me the sample code for TWIM using the nrfx_twim.h

I want to create the TWI master using the nrfx_twim.h

Please provide the sample code for same.

Parents
  • I am facing the issue while creating the instance using 

    /**
    * @brief Structure for the TWI master driver instance.
    */
    typedef struct
    {
    NRF_TWIM_Type * p_twim; ///< Pointer to a structure with TWIM registers.
    uint8_t drv_inst_idx; ///< Driver instance index.
    } nrfx_twim_t;

    /**
    * @brief Macro for creating a TWI master driver instance.
    */
    #define NRFX_TWIM_INSTANCE(id) \
    { \
    .p_twim = NRFX_CONCAT_2(NRF_TWIM, id), \
    .drv_inst_idx = NRFX_CONCAT_3(NRFX_TWIM, id, _INST_IDX), \
    }

Reply
  • I am facing the issue while creating the instance using 

    /**
    * @brief Structure for the TWI master driver instance.
    */
    typedef struct
    {
    NRF_TWIM_Type * p_twim; ///< Pointer to a structure with TWIM registers.
    uint8_t drv_inst_idx; ///< Driver instance index.
    } nrfx_twim_t;

    /**
    * @brief Macro for creating a TWI master driver instance.
    */
    #define NRFX_TWIM_INSTANCE(id) \
    { \
    .p_twim = NRFX_CONCAT_2(NRF_TWIM, id), \
    .drv_inst_idx = NRFX_CONCAT_3(NRFX_TWIM, id, _INST_IDX), \
    }

Children
Related