migrate
This commit is contained in:
27
fw/stm8s/common/inc/max6675.h
Normal file
27
fw/stm8s/common/inc/max6675.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef MAX6675_H
|
||||
#define MAX6675_H
|
||||
|
||||
#include <stdint.h>
|
||||
//#include "spi.h"
|
||||
|
||||
/**
|
||||
* Initialize MAX6675.
|
||||
*
|
||||
* Pinout:
|
||||
* CS -> PA1
|
||||
* SCK -> PC5 [spi]
|
||||
* MISO -> PC7 [spi]
|
||||
*
|
||||
*/
|
||||
|
||||
#define MAX6675_TRANSACTION_START \
|
||||
PC_ODR |= PIN5; \
|
||||
PA_ODR &= ~PIN1;
|
||||
#define MAX6675_TRANSACTION_END \
|
||||
PA_ODR |= PIN1;
|
||||
|
||||
void max6675_init();
|
||||
|
||||
uint16_t max6675_read();
|
||||
|
||||
#endif /* MAX6675_H */
|
||||
Reference in New Issue
Block a user