Newer
Older
/*
* periph.h
*
* Created on: 28 Jun 2018
* Author: nats
*/
#ifndef PERIPH_H_
#define PERIPH_H_
#include "stm32f10x_gpio.h"
#include "stm32f10x_i2c.h"
#define I2C_SPEED 50000
#define I2C_LMK_ADDR 0x59
/* PORT A */
#define SI_CS GPIO_Pin_4
#define SCK GPIO_Pin_5
#define MISO GPIO_Pin_6
#define MOSI GPIO_Pin_7
#define UTX GPIO_Pin_9
#define URX GPIO_Pin_10
/* PORT B */
#define SI_SHDN GPIO_Pin_1
#define PLL_EN GPIO_Pin_4
void initGPIO();
void initI2C();
uint8_t validPLL(uint8_t addr, uint8_t ref);
void writeTIPLL(uint8_t addr, uint8_t value);