42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
68#define LIGHT_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
79#define LIGHT_RETVAL uint8_t
82#define LIGHT_INIT_ERROR 0xFF
89#define LIGHT_COMMAND_REG 0x80
#define LIGHT_RETVAL
Definition light.h:79
uint8_t light_calculate_percent(light_t *ctx, uint16_t light_value)
Function calculate percent.
LIGHT_RETVAL light_init(light_t *ctx, light_cfg_t *cfg)
Initialization function.
uint16_t light_read_data(light_t *ctx)
Generic read data function.
void light_cfg_setup(light_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition light.h:121
uint8_t spi_mode
Definition light.h:135
spi_master_chip_select_polarity_t cs_polarity
Definition light.h:136
pin_name_t sck
Definition light.h:126
pin_name_t mosi
Definition light.h:125
uint32_t spi_speed
Definition light.h:134
pin_name_t miso
Definition light.h:124
pin_name_t cs
Definition light.h:127
Click ctx object definition.
Definition light.h:103
digital_out_t cs
Definition light.h:106
spi_master_t spi
Definition light.h:112
pin_name_t chip_select
Definition light.h:113