SingingCat 0
application
sx1262.h
1#ifndef SX1262_H
2#define SX1262_H 1
3#include "main-header.h"
4#include "stdint.h"
5#include "sx126x.h"
6#include "networkif.h"
7#define SX1262_CSN 112
8// pa0
9#define SX1262_DIO1 000
10#define SX1262_BUSY 205
11#define SX1262_RESET 213
12
13#define MCULIB_ERR_RET(txt, err) if (err != 0) { printf("mculib error: (%s) %i\r\n", txt, err); return err; }
14int sx1262_probe(struct network_context *nc);
15int sx1262_init(struct network_context *nc);
16int sx1262_stop(struct network_context *nc);
17int sx1262_loop(struct network_context *nc);
18int sx1262_transmit(struct network_context *ctx, const uint8_t *buf, uint16_t size);
19void sx1262_irq(int pin, void *opaque);
20int sx1262_busy(struct network_context *nctx);
21void sx1262_clear_rx_mode();
22struct networkif *sx1262_get_netdev();
23void sx1262_set_lora_parameters(void *ctx);
24void sx1262_set_packet_params(void *ctx, int payload_size);
25void sx1262_set_lora_packet_type(void *ctx);
26void sx1262_switch_to_rx();
27int print_chip_status(void *ctx, int include_mode);
28
29char *chip_status_name(sx126x_chip_modes_t status);
30char *chip_com_name(sx126x_cmd_status_t status);
31int writeRegister(uint8_t reg, uint8_t value);
32int sx1262_init_or_reinit(struct network_context *nctx, byte reinit);
33void transmit_complete_irq();
34int sx1262_is_transmitting();
35void sx1262_done_transmit();
36#endif
SX126x radio driver definition.
enum sx126x_cmd_status_e sx126x_cmd_status_t
SX126X command status enumeration definition.
enum sx126x_chip_modes_e sx126x_chip_modes_t
SX126X chip mode enumeration definition.