Go to the documentation of this file.
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_
digipot5_err_t digipot5_generic_read(digipot5_t *ctx, digipot5_reg_t reg_addr, uint16_t *data_out)
Generic Read function.
digipot5_err_t digipot5_init(digipot5_t *ctx, digipot5_cfg_t *cfg)
Click Initialization function.
digipot5_reg_t digipot5_increment_wiper(digipot5_t *ctx, digipot5_reg_t reg_addr)
Increment Wiper function.
pin_name_t sdo
Definition: digipot5.h:150
void digipot5_reset(digipot5_t *ctx)
Reset function.
@ DIGIPOT5_ERROR_REG_ADDR
Definition: digipot5.h:98
@ DIGIPOT5_REG_EEPROM2_NONVOL
Definition: digipot5.h:120
@ DIGIPOT5_REG_WIPER0_NONVOL
Definition: digipot5.h:109
pin_name_t sdi
Definition: digipot5.h:151
@ DIGIPOT5_ERROR_INIT_DRV
Definition: digipot5.h:97
@ DIGIPOT5_REG_WIPER1_NONVOL
Definition: digipot5.h:110
Click configuration structure definition.
Definition: digipot5.h:146
spi_master_chip_select_polarity_t cs_polarity
Definition: digipot5.h:159
@ DIGIPOT5_REG_EEPROM0_NONVOL
Definition: digipot5.h:118
@ DIGIPOT5_REG_WIPER0_VOL
Definition: digipot5.h:107
pin_name_t rst
Definition: digipot5.h:154
digital_out_t cs
Definition: digipot5.h:131
Click context object definition.
Definition: digipot5.h:130
digipot5_err_t
Click error code definition.
Definition: digipot5.h:94
@ DIGIPOT5_REG_EEPROM1_NONVOL
Definition: digipot5.h:119
@ DIGIPOT5_REG_WIPER1_VOL
Definition: digipot5.h:108
@ DIGIPOT5_REG_WIPER3_NONVOL
Definition: digipot5.h:116
spi_master_t spi
Definition: digipot5.h:137
void digipot5_cfg_setup(digipot5_cfg_t *cfg)
Configuration Object Setup function.
@ DIGIPOT5_REG_WIPER3_VOL
Definition: digipot5.h:114
@ DIGIPOT5_REG_EEPROM4_NONVOL
Definition: digipot5.h:122
@ DIGIPOT5_REG_TCON1_VOL
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.
@ DIGIPOT5_REG_WIPER2_NONVOL
Definition: digipot5.h:115
@ DIGIPOT5_REG_EEPROM3_NONVOL
Definition: digipot5.h:121
pin_name_t chip_select
Definition: digipot5.h:138
@ DIGIPOT5_REG_STATUS_VOL
Definition: digipot5.h:112
@ DIGIPOT5_REG_TCON0_VOL
Definition: digipot5.h:111
digital_out_t rst
Definition: digipot5.h:134
spi_master_mode_t spi_mode
Definition: digipot5.h:158
void digipot5_default_cfg(digipot5_t *ctx)
Click Default Configuration function.
@ DIGIPOT5_STATUS_OK
Definition: digipot5.h:95
digipot5_reg_t digipot5_decrement_wiper(digipot5_t *ctx, digipot5_reg_t reg_addr)
Decrement Wiper function.
digipot5_reg_t
Click register address definition.
Definition: digipot5.h:106
pin_name_t sck
Definition: digipot5.h:149
@ DIGIPOT5_ERROR_CMD
Definition: digipot5.h:96
@ DIGIPOT5_REG_WIPER2_VOL
Definition: digipot5.h:113
uint32_t spi_speed
Definition: digipot5.h:157
pin_name_t cs
Definition: digipot5.h:148