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 LEDDRIVER10_ENABLE_ALL_CH 0xFFFF
75#define LEDDRIVER10_DISABLE_ALL_CH 0x0000
76#define LEDDRIVER10_ENABLE_CH_0 0x0001
77#define LEDDRIVER10_ENABLE_CH_1 0x0002
78#define LEDDRIVER10_ENABLE_CH_2 0x0004
79#define LEDDRIVER10_ENABLE_CH_3 0x0008
80#define LEDDRIVER10_ENABLE_CH_4 0x0010
81#define LEDDRIVER10_ENABLE_CH_5 0x0020
82#define LEDDRIVER10_ENABLE_CH_6 0x0040
83#define LEDDRIVER10_ENABLE_CH_7 0x0080
84#define LEDDRIVER10_ENABLE_CH_8 0x0100
85#define LEDDRIVER10_ENABLE_CH_9 0x0200
86#define LEDDRIVER10_ENABLE_CH_10 0x0400
87#define LEDDRIVER10_ENABLE_CH_11 0x0800
88#define LEDDRIVER10_ENABLE_CH_12 0x1000
89#define LEDDRIVER10_ENABLE_CH_13 0x2000
90#define LEDDRIVER10_ENABLE_CH_14 0x4000
91#define LEDDRIVER10_ENABLE_CH_15 0x8000
97#define LEDDRIVER10_DEF_FREQ 10000
115#define LEDDRIVER10_MAP_MIKROBUS( cfg, mikrobus ) \
116 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
117 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
118 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
119 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
120 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM );
err_t leddriver10_pwm_start(leddriver10_t *ctx)
LED Driver 10 start PWM module.
err_t leddriver10_set_channels(leddriver10_t *ctx, uint16_t ch_mask)
LED Driver 10 set channels function.
err_t leddriver10_init(leddriver10_t *ctx, leddriver10_cfg_t *cfg)
LED Driver 10 initialization function.
void leddriver10_cfg_setup(leddriver10_cfg_t *cfg)
LED Driver 10 configuration object setup function.
err_t leddriver10_pwm_stop(leddriver10_t *ctx)
LED Driver 10 stop PWM module.
err_t leddriver10_set_duty_cycle(leddriver10_t *ctx, float duty_cycle)
LED Driver 10 sets PWM duty cycle.
err_t leddriver10_read_channels(leddriver10_t *ctx, uint16_t *ch_mask)
LED Driver 10 read channels function.
leddriver10_return_value_t
LED Driver 10 Click return value data.
Definition leddriver10.h:166
@ LEDDRIVER10_ERROR
Definition leddriver10.h:168
@ LEDDRIVER10_OK
Definition leddriver10.h:167
LED Driver 10 Click configuration object.
Definition leddriver10.h:145
spi_master_chip_select_polarity_t cs_polarity
Definition leddriver10.h:156
pin_name_t sck
Definition leddriver10.h:149
spi_master_mode_t spi_mode
Definition leddriver10.h:155
pin_name_t mosi
Definition leddriver10.h:148
uint32_t spi_speed
Definition leddriver10.h:154
uint32_t dev_pwm_freq
Definition leddriver10.h:157
pin_name_t pwm
Definition leddriver10.h:151
pin_name_t miso
Definition leddriver10.h:147
pin_name_t cs
Definition leddriver10.h:150
LED Driver 10 Click context object.
Definition leddriver10.h:130
spi_master_t spi
Definition leddriver10.h:132
uint32_t pwm_freq
Definition leddriver10.h:136
pin_name_t chip_select
Definition leddriver10.h:135
pwm_t pwm
Definition leddriver10.h:133