39 #include "drv_spi_master.h" 51 #define DIGIPOT5_RETVAL uint8_t 53 #define DIGIPOT5_OK 0x00 54 #define DIGIPOT5_INIT_ERROR 0xFF 61 #define DIGIPOT5_RES_ZEROSCALE 0x00 62 #define DIGIPOT5_RES_1KOHM 0x1A 63 #define DIGIPOT5_RES_2KOHM 0x34 64 #define DIGIPOT5_RES_3KOHM 0x4E 65 #define DIGIPOT5_RES_5KOHM_HALFSCALE 0x80 66 #define DIGIPOT5_RES_7KOHM 0xB6 67 #define DIGIPOT5_RES_8KOHM 0xD0 68 #define DIGIPOT5_RES_10KOHM_FULLSCALE 0x100 75 #define DIGIPOT5_MAP_MIKROBUS( cfg, mikrobus ) \ 76 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \ 77 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \ 78 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \ 79 cfg.sdo = MIKROBUS( mikrobus, MIKROBUS_MISO ); \ 80 cfg.sdi = MIKROBUS( mikrobus, MIKROBUS_MOSI ) 254 uint16_t *data_out );
289 #endif // _DIGIPOT5_H_ digital_out_t cs
Definition: digipot5.h:131
digipot5_reg_t digipot5_decrement_wiper(digipot5_t *ctx, digipot5_reg_t reg_addr)
Decrement Wiper function.
digipot5_reg_t digipot5_increment_wiper(digipot5_t *ctx, digipot5_reg_t reg_addr)
Increment Wiper function.
digipot5_reg_t
Click register address definition.
Definition: digipot5.h:105
Definition: digipot5.h:117
digipot5_err_t digipot5_generic_write(digipot5_t *ctx, digipot5_reg_t reg_addr, uint16_t data_in)
Generic Write function.
Definition: digipot5.h:121
Click context object definition.
Definition: digipot5.h:129
Definition: digipot5.h:115
Definition: digipot5.h:118
void digipot5_cfg_setup(digipot5_cfg_t *cfg)
Configuration Object Setup function.
pin_name_t sdo
Definition: digipot5.h:150
Definition: digipot5.h:107
Definition: digipot5.h:116
Definition: digipot5.h:119
pin_name_t sdi
Definition: digipot5.h:151
spi_master_t spi
Definition: digipot5.h:137
Definition: digipot5.h:98
Definition: digipot5.h:108
void digipot5_default_cfg(digipot5_t *ctx)
Click Default Configuration function.
spi_master_chip_select_polarity_t cs_polarity
Definition: digipot5.h:159
pin_name_t rst
Definition: digipot5.h:154
Definition: digipot5.h:120
Definition: digipot5.h:122
Definition: digipot5.h:95
Definition: digipot5.h:113
pin_name_t chip_select
Definition: digipot5.h:138
void digipot5_reset(digipot5_t *ctx)
Reset function.
Click configuration structure definition.
Definition: digipot5.h:145
digipot5_err_t digipot5_generic_read(digipot5_t *ctx, digipot5_reg_t reg_addr, uint16_t *data_out)
Generic Read function.
digipot5_err_t
Click error code definition.
Definition: digipot5.h:93
spi_master_mode_t spi_mode
Definition: digipot5.h:158
digital_out_t rst
Definition: digipot5.h:134
Definition: digipot5.h:114
Definition: digipot5.h:109
Definition: digipot5.h:96
uint32_t spi_speed
Definition: digipot5.h:157
Definition: digipot5.h:97
pin_name_t cs
Definition: digipot5.h:148
digipot5_err_t digipot5_init(digipot5_t *ctx, digipot5_cfg_t *cfg)
Click Initialization function.
Definition: digipot5.h:110
Definition: digipot5.h:112
Definition: digipot5.h:111
pin_name_t sck
Definition: digipot5.h:149