Go to the documentation of this file.
39 #ifdef PREINIT_SUPPORTED
43 #ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
51 #include "drv_spi_master.h"
74 #define BRUSHLESS30_REG_OPSEL1 0x00
75 #define BRUSHLESS30_REG_OPSEL2 0x04
76 #define BRUSHLESS30_REG_STAT1 0x08
77 #define BRUSHLESS30_REG_STAT2 0x0C
78 #define BRUSHLESS30_REG_CP_RLY_CTRL 0x14
79 #define BRUSHLESS30_REG_PL_CTRL 0x18
80 #define BRUSHLESS30_REG_T_ILIM 0x1C
81 #define BRUSHLESS30_REG_FET_OPSEL 0x24
82 #define BRUSHLESS30_REG_HS_VDS_SEL 0x28
83 #define BRUSHLESS30_REG_LS_VDS_SEL 0x2C
84 #define BRUSHLESS30_REG_FET_DET_SEL 0x30
85 #define BRUSHLESS30_REG_AMP_CTRL 0x40
86 #define BRUSHLESS30_REG_AMP_STAT 0x44
87 #define BRUSHLESS30_REG_ALM_CTRL 0x48
88 #define BRUSHLESS30_REG_QA_CTRL 0x4C
89 #define BRUSHLESS30_REG_ANSWER 0x50
90 #define BRUSHLESS30_REG_BIST_DIAG 0x54
91 #define BRUSHLESS30_REG_BIST_STAT 0x58
92 #define BRUSHLESS30_REG_FET_TEST_CNT1 0x5C
93 #define BRUSHLESS30_REG_FET_TEST_CNT2 0x60
94 #define BRUSHLESS30_REG_FET_TEST_STAT 0x64
95 #define BRUSHLESS30_REG_VDS_COMP_STAT 0x68
96 #define BRUSHLESS30_REG_DUMMY 0x7C
114 #define BRUSHLESS30_HS_VDS_SEL 0x2444
115 #define BRUSHLESS30_LS_VDS_SEL 0x2444
116 #define BRUSHLESS30_AMP_CTRL 0x0333
117 #define BRUSHLESS30_CP_RLY_CTRL 0x1111
127 #define BRUSHLESS30_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
128 #define BRUSHLESS30_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
146 #define BRUSHLESS30_MAP_MIKROBUS( cfg, mikrobus ) \
147 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
148 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
149 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
150 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
151 cfg.alarm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
152 cfg.diag = MIKROBUS( mikrobus, MIKROBUS_INT )
317 #endif // BRUSHLESS30_H
spi_master_mode_t spi_mode
Definition: brushless30.h:194
brushless30_return_value_t
Brushless 30 Click return value data.
Definition: brushless30.h:204
pin_name_t miso
Definition: brushless30.h:183
Brushless 30 Click configuration object.
Definition: brushless30.h:181
err_t brushless30_write_reg(brushless30_t *ctx, uint8_t reg, uint16_t data_in)
Brushless 30 write reg function.
@ BRUSHLESS30_ERROR
Definition: brushless30.h:206
digital_in_t diag
Definition: brushless30.h:167
pin_name_t mosi
Definition: brushless30.h:184
This file contains SPI specific macros, functions, etc.
pin_name_t cs
Definition: brushless30.h:186
err_t brushless30_init(brushless30_t *ctx, brushless30_cfg_t *cfg)
Brushless 30 initialization function.
pin_name_t alarm
Definition: brushless30.h:189
uint8_t brushless30_get_diag_pin(brushless30_t *ctx)
Brushless 30 get diag pin function.
err_t brushless30_default_cfg(brushless30_t *ctx)
Brushless 30 default configuration function.
pin_name_t sck
Definition: brushless30.h:185
uint32_t spi_speed
Definition: brushless30.h:193
void brushless30_cfg_setup(brushless30_cfg_t *cfg)
Brushless 30 configuration object setup function.
spi_master_t spi
Definition: brushless30.h:170
@ BRUSHLESS30_OK
Definition: brushless30.h:205
digital_out_t alarm
Definition: brushless30.h:164
Brushless 30 Click context object.
Definition: brushless30.h:162
void brushless30_enable_driver(brushless30_t *ctx)
Brushless 30 enable driver function.
void brushless30_disable_driver(brushless30_t *ctx)
Brushless 30 disable driver function.
err_t brushless30_read_reg(brushless30_t *ctx, uint8_t reg, uint16_t *data_out)
Brushless 30 read reg function.
pin_name_t chip_select
Definition: brushless30.h:172
spi_master_chip_select_polarity_t cs_polarity
Definition: brushless30.h:195
pin_name_t diag
Definition: brushless30.h:190