28#ifndef CURRENTLIMIT6_H
29#define CURRENTLIMIT6_H
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"
78#define CURRENTLIMIT6_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
79#define CURRENTLIMIT6_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
97#define CURRENTLIMIT6_MAP_MIKROBUS( cfg, mikrobus ) \
98 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
99 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
100 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
101 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
102 cfg.er2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
103 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
104 cfg.er1 = MIKROBUS( mikrobus, MIKROBUS_INT )
currentlimit6_pwr_mode_value_t
Current Limit 6 Click power mode data.
Definition currentlimit6.h:169
@ CURRENTLIMIT6_PWR_OFF
Definition currentlimit6.h:170
@ CURRENTLIMIT6_PWR_ON
Definition currentlimit6.h:171
currentlimit6_return_value_t
Current Limit 6 Click return value data.
Definition currentlimit6.h:158
@ CURRENTLIMIT6_OK
Definition currentlimit6.h:159
@ CURRENTLIMIT6_ERROR
Definition currentlimit6.h:160
err_t currentlimit6_default_cfg(currentlimit6_t *ctx)
Current Limit 6 default configuration function.
void currentlimit6_cfg_setup(currentlimit6_cfg_t *cfg)
Current Limit 6 configuration object setup function.
err_t currentlimit6_power_mode(currentlimit6_t *ctx, currentlimit6_pwr_mode_value_t pwr_mode)
Current Limit 6 power mode function.
uint8_t currentlimit6_check_voltage_err(currentlimit6_t *ctx)
Current Limit 6 check voltage error function.
err_t currentlimit6_init(currentlimit6_t *ctx, currentlimit6_cfg_t *cfg)
Current Limit 6 initialization function.
err_t currentlimit6_set_current_limit(currentlimit6_t *ctx, float current_limit)
Current Limit 6 set current limit function.
err_t currentlimit6_generic_write(currentlimit6_t *ctx, uint8_t data_in)
Current Limit 6 data writing function.
uint8_t currentlimit6_check_limit_exceeded(currentlimit6_t *ctx)
Current Limit 6 check limit exceeded function.
This file contains SPI specific macros, functions, etc.
Current Limit 6 Click configuration object.
Definition currentlimit6.h:134
spi_master_chip_select_polarity_t cs_polarity
Definition currentlimit6.h:149
pin_name_t sck
Definition currentlimit6.h:138
spi_master_mode_t spi_mode
Definition currentlimit6.h:148
pin_name_t mosi
Definition currentlimit6.h:137
uint32_t spi_speed
Definition currentlimit6.h:147
pin_name_t er2
Definition currentlimit6.h:142
pin_name_t en
Definition currentlimit6.h:143
pin_name_t er1
Definition currentlimit6.h:144
pin_name_t miso
Definition currentlimit6.h:136
pin_name_t cs
Definition currentlimit6.h:139
Current Limit 6 Click context object.
Definition currentlimit6.h:114
spi_master_t spi
Definition currentlimit6.h:123
digital_out_t en
Definition currentlimit6.h:116
digital_in_t er1
Definition currentlimit6.h:120
pin_name_t chip_select
Definition currentlimit6.h:125
digital_in_t er2
Definition currentlimit6.h:119