This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cosar Dindar | |
// to use 192 bits curve compile with -DUSE_192 | |
// or -DUSE_256 for 256 bits curve | |
// to use predefined points use -DUSE_PREDEFINED_POINTS or draft curve params will be used | |
// to create new private and public key use -DGENERATE_KEY otherwise embedded keys will be used | |
// link with -lssl -lcrypto | |
// -- ex. gcc ecc_sample.c -g -o ecc_sample -lssl -lcrypto -DUSE_256 -DUSE_PREDEFINED_POINTS -DGENERATE_KEY | |
#include <string.h> | |
#include <openssl/ec.h> // for EC_GROUP_new_by_curve_name, EC_GROUP_free, EC_KEY_new, EC_KEY_set_group, EC_KEY_generate_key, EC_KEY_free |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "app_init.h" | |
#include <stdio.h> | |
void pwm_init(void) | |
{ | |
// OC2 sol motor | |
TCCR2 |= _BV(WGM21) | _BV(WGM20); // OC2 fast pwm mode | |
TCCR2 &= ~_BV(COM21) & ~_BV(COM20); // disable | |
//TCCR2 |= _BV(COM21); // Clear OC2 on compare match, set OC2 at BOTTOM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "uart.h" | |
#include "rtc.c" | |
// Baud rate setting | |
#define BAUD 9600 | |
void main(void) { | |
// Serial channel (9600, N,8,1) | |
uart_init((UART_BAUD_SELECT((BAUD),F_OSC))); | |
sei(); // interrupt enable |