Skip to content

Instantly share code, notes, and snippets.

View zekageri's full-sized avatar

DrRandom zekageri

  • Hitec
  • Hungary
View GitHub Profile
@zekageri
zekageri / Interrupts.c
Last active November 26, 2019 12:23
Modbus C implementation for EFM8UB2
#include <SI_EFM8UB2_Register_Enums.h>
#define UART_BUFFERSIZE 64
/* Supported function codes */
#define _READ_SINGLE_REGISTER 0x04
#define _SET_SINGLE_REGISTER 0x06
/** TIMER INTERRUPT INIT **/
#define SYSCLK 12000000/8 // SYSCLK in Hz (12 MHz internal oscillator / 8) the internal oscillator has a tolerance of +/- 2%