Mood_lamp
Macros | Functions
hal.h File Reference

This file consists hardware-depended calls interface. More...

#include <stm8s.h>

Go to the source code of this file.

Macros

#define HAL_GPIO_PINS_MASK   0x1C
 
#define HAL_CLK_HSI_DIV_1_OUTPUT   0x00
 
#define HAL_EEPROM_UNBLOCK_CODE_1   ((uint8_t) 0xAE)
 
#define HAL_EEPROM_UNBLOCK_CODE_2   ((uint8_t) 0x56)
 
#define HAL_EEPROM_BLOCK_CODE   ((uint8_t) 0x08)
 
#define HAL_EEPROM_START_ADDRESS   ((uint16_t) 0x4000)
 
#define HAL_EEPROM_END_ADDRESS   ((uint16_t) 0x427F)
 
#define HAL_EEPROM_READ_BYTE(ADDRESS)   (*(PointerAttr uint8_t *) ((MemoryAddressCast) (ADDRESS)))
 
#define HAL_EEPROM_WRITE_BYTE(ADDRESS, DATA)   do{*(PointerAttr uint8_t*) ((MemoryAddressCast) (ADDRESS)) = (uint8_t)(DATA);}while(0)
 
#define HAL_EEPROM_READ_WORD(ADDRESS)   ((((uint16_t) HAL_EEPROM_READ_BYTE(ADDRESS)) << 8) + HAL_EEPROM_READ_BYTE((ADDRESS) + 1))
 
#define HAL_EEPROM_WRITE_WORD(ADDRESS, DATA)   do{HAL_EEPROM_WRITE_BYTE((ADDRESS), (DATA) >> 8);HAL_EEPROM_WRITE_BYTE((ADDRESS) + 1, (DATA));}while(0)
 

Functions

void gpio_init ()
 GPIO initialization. More...
 
void clk_init ()
 MCU clock initialization. More...
 
void pwm_init ()
 PWM timer initialization. More...
 
void set_rgbw_output_value (uint8_t channel, uint16_t value)
 PWM level changing. More...
 
void eeprom_init ()
 EEPROM memory initialization. More...
 
uint16_t get_saved_xorshift_value ()
 Extracts random number generator initialization value from EEPROM memory. More...
 
void save_xorshift_value (uint16_t value)
 Saves random number generator initialization value into EEPROM memory. More...
 
void eeprom_deinit ()
 EEPROM memory deinitialization. More...
 

Detailed Description

This file consists hardware-depended calls interface.

Author
AntaresLab
Version
1.0.1
Date
12-January-2018