Skip to content

Commit 677d4d5

Browse files
committed
Update radio module to implement new radio API.
Functions in the radio module are: - reset() - config(...) - on() - off() - send_bytes(b) - receive_bytes() - send(s) - receive() Using send/receive with the default configuration is compatible with the DAL.
1 parent 74aec6b commit 677d4d5

File tree

5 files changed

+304
-70
lines changed

5 files changed

+304
-70
lines changed

inc/genhdr/qstrdefs.generated.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,4 +689,17 @@ QDEF(MP_QSTR_listdir, (const byte*)"\x98\x07" "listdir")
689689
QDEF(MP_QSTR_machine, (const byte*)"\x60\x07" "machine")
690690
QDEF(MP_QSTR_size, (const byte*)"\x20\x04" "size")
691691
QDEF(MP_QSTR_radio, (const byte*)"\xd4\x05" "radio")
692-
QDEF(MP_QSTR_recv, (const byte*)"\xe7\x04" "recv")
692+
QDEF(MP_QSTR_config, (const byte*)"\x4f\x06" "config")
693+
QDEF(MP_QSTR_send_bytes, (const byte*)"\xbf\x0a" "send_bytes")
694+
QDEF(MP_QSTR_receive_bytes, (const byte*)"\x88\x0d" "receive_bytes")
695+
QDEF(MP_QSTR_receive, (const byte*)"\x4e\x07" "receive")
696+
QDEF(MP_QSTR_length, (const byte*)"\x59\x06" "length")
697+
QDEF(MP_QSTR_queue, (const byte*)"\x94\x05" "queue")
698+
QDEF(MP_QSTR_channel, (const byte*)"\x26\x07" "channel")
699+
QDEF(MP_QSTR_power, (const byte*)"\xda\x05" "power")
700+
QDEF(MP_QSTR_data_rate, (const byte*)"\xa8\x09" "data_rate")
701+
QDEF(MP_QSTR_address, (const byte*)"\x73\x07" "address")
702+
QDEF(MP_QSTR_group, (const byte*)"\xba\x05" "group")
703+
QDEF(MP_QSTR_RATE_250KBIT, (const byte*)"\x7b\x0c" "RATE_250KBIT")
704+
QDEF(MP_QSTR_RATE_1MBIT, (const byte*)"\xdb\x0a" "RATE_1MBIT")
705+
QDEF(MP_QSTR_RATE_2MBIT, (const byte*)"\x58\x0a" "RATE_2MBIT")

inc/microbit/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ extern const struct _mp_obj_module_t radio_module;
118118
mp_obj_t keyboard_interrupt_obj; \
119119
void *async_data[2]; \
120120
void *async_music_data; \
121+
uint8_t *radio_buf; \
121122

122123
// We need to provide a declaration/definition of alloca()
123124
#include <alloca.h>

inc/microbit/qstrdefsport.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,21 @@ Q(machine)
410410
Q(size)
411411

412412
Q(radio)
413-
Q(enable)
413+
Q(reset)
414+
Q(config)
415+
Q(on)
416+
Q(off)
417+
Q(send_bytes)
418+
Q(receive_bytes)
414419
Q(send)
415-
Q(recv)
420+
Q(receive)
421+
Q(length)
422+
Q(queue)
423+
Q(channel)
424+
Q(power)
425+
Q(data_rate)
426+
Q(address)
427+
Q(group)
428+
Q(RATE_250KBIT)
429+
Q(RATE_1MBIT)
430+
Q(RATE_2MBIT)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy