LibDriver MAX6675
Loading...
Searching...
No Matches
driver_max6675_basic.c
Go to the documentation of this file.
1
36
38
39static max6675_handle_t gs_handle;
40
48uint8_t max6675_basic_init(void)
49{
50 uint8_t res;
51
52 /* link functions */
59
60 /* max6675 init */
61 res = max6675_init(&gs_handle);
62 if (res != 0)
63 {
64 max6675_interface_debug_print("max6675: init failed.\n");
65
66 return 1;
67 }
68
69 return 0;
70}
71
80{
81 /* close max6675 */
82 if (max6675_deinit(&gs_handle) != 0)
83 {
84 return 1;
85 }
86 else
87 {
88 return 0;
89 }
90}
91
101uint8_t max6675_basic_read(uint16_t *raw, float *temp)
102{
103 /* read data */
104 if (max6675_read(&gs_handle, raw, temp) != 0)
105 {
106 return 1;
107 }
108 else
109 {
110 return 0;
111 }
112}
driver max6675 basic include file
uint8_t max6675_read(max6675_handle_t *handle, uint16_t *raw, float *temp)
read the temperature
uint8_t max6675_init(max6675_handle_t *handle)
initialize the chip
struct max6675_handle_s max6675_handle_t
max6675 handle structure definition
uint8_t max6675_deinit(max6675_handle_t *handle)
close the chip
uint8_t max6675_basic_read(uint16_t *raw, float *temp)
basic example read the temperature
uint8_t max6675_basic_deinit(void)
basic example deinit
uint8_t max6675_basic_init(void)
basic example init
void max6675_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t max6675_interface_spi_init(void)
interface spi bus init
uint8_t max6675_interface_spi_deinit(void)
interface spi bus deinit
uint8_t max6675_interface_spi_read_cmd(uint8_t *buf, uint16_t len)
interface spi bus read command
void max6675_interface_delay_ms(uint32_t ms)
interface delay ms