Go to the documentation of this file.
38 #include "mikrosdk_version.h"
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
48 #include "drv_spi_master.h"
60 #define DIGIPOT5_RETVAL uint8_t
62 #define DIGIPOT5_OK 0x00
63 #define DIGIPOT5_INIT_ERROR 0xFF
70 #define DIGIPOT5_RES_ZEROSCALE 0x00
71 #define DIGIPOT5_RES_1KOHM 0x1A
72 #define DIGIPOT5_RES_2KOHM 0x34
73 #define DIGIPOT5_RES_3KOHM 0x4E
74 #define DIGIPOT5_RES_5KOHM_HALFSCALE 0x80
75 #define DIGIPOT5_RES_7KOHM 0xB6
76 #define DIGIPOT5_RES_8KOHM 0xD0
77 #define DIGIPOT5_RES_10KOHM_FULLSCALE 0x100
84 #define DIGIPOT5_MAP_MIKROBUS( cfg, mikrobus ) \
85 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
86 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
87 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
88 cfg.sdo = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
89 cfg.sdi = MIKROBUS( mikrobus, MIKROBUS_MOSI )
263 uint16_t *data_out );
298 #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:159
void digipot5_reset(digipot5_t *ctx)
Reset function.
@ DIGIPOT5_ERROR_REG_ADDR
Definition: digipot5.h:107
@ DIGIPOT5_REG_EEPROM2_NONVOL
Definition: digipot5.h:129
@ DIGIPOT5_REG_WIPER0_NONVOL
Definition: digipot5.h:118
pin_name_t sdi
Definition: digipot5.h:160
@ DIGIPOT5_ERROR_INIT_DRV
Definition: digipot5.h:106
@ DIGIPOT5_REG_WIPER1_NONVOL
Definition: digipot5.h:119
Click configuration structure definition.
Definition: digipot5.h:155
spi_master_chip_select_polarity_t cs_polarity
Definition: digipot5.h:168
@ DIGIPOT5_REG_EEPROM0_NONVOL
Definition: digipot5.h:127
@ DIGIPOT5_REG_WIPER0_VOL
Definition: digipot5.h:116
pin_name_t rst
Definition: digipot5.h:163
digital_out_t cs
Definition: digipot5.h:140
Click context object definition.
Definition: digipot5.h:139
digipot5_err_t
Click error code definition.
Definition: digipot5.h:103
@ DIGIPOT5_REG_EEPROM1_NONVOL
Definition: digipot5.h:128
@ DIGIPOT5_REG_WIPER1_VOL
Definition: digipot5.h:117
@ DIGIPOT5_REG_WIPER3_NONVOL
Definition: digipot5.h:125
spi_master_t spi
Definition: digipot5.h:146
void digipot5_cfg_setup(digipot5_cfg_t *cfg)
Configuration Object Setup function.
@ DIGIPOT5_REG_WIPER3_VOL
Definition: digipot5.h:123
@ DIGIPOT5_REG_EEPROM4_NONVOL
Definition: digipot5.h:131
@ DIGIPOT5_REG_TCON1_VOL
Definition: digipot5.h:126
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:124
@ DIGIPOT5_REG_EEPROM3_NONVOL
Definition: digipot5.h:130
pin_name_t chip_select
Definition: digipot5.h:147
@ DIGIPOT5_REG_STATUS_VOL
Definition: digipot5.h:121
@ DIGIPOT5_REG_TCON0_VOL
Definition: digipot5.h:120
digital_out_t rst
Definition: digipot5.h:143
spi_master_mode_t spi_mode
Definition: digipot5.h:167
void digipot5_default_cfg(digipot5_t *ctx)
Click Default Configuration function.
@ DIGIPOT5_STATUS_OK
Definition: digipot5.h:104
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:115
pin_name_t sck
Definition: digipot5.h:158
@ DIGIPOT5_ERROR_CMD
Definition: digipot5.h:105
@ DIGIPOT5_REG_WIPER2_VOL
Definition: digipot5.h:122
uint32_t spi_speed
Definition: digipot5.h:166
pin_name_t cs
Definition: digipot5.h:157