Skip to content
periph.h 738 B
Newer Older
natsfr's avatar
natsfr committed
/*
 * 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

natsfr's avatar
natsfr committed
#define 	NODMA			0
#define		WITHDMA			1

/* 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
natsfr's avatar
natsfr committed
#define		LED				GPIO_Pin_12

/* 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);
natsfr's avatar
natsfr committed
void initSPI(uint8_t withDMA);
void initUART();
natsfr's avatar
natsfr committed

#endif /* PERIPH_H_ */