Skip to content

Commit 1a8573e

Browse files
committed
stmhal: Update some inlined docs for network and CAN.
1 parent 47f349e commit 1a8573e

5 files changed

Lines changed: 28 additions & 22 deletions

File tree

stmhal/can.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,6 @@ STATIC const mp_map_elem_t pyb_can_locals_dict_table[] = {
414414
{ MP_OBJ_NEW_QSTR(MP_QSTR_recv), (mp_obj_t)&pyb_can_recv_obj },
415415

416416
// class constants
417-
/// \constant MASTER - for initialising the bus to master mode
418-
/// \constant SLAVE - for initialising the bus to slave mode
419-
/// \constant MSB - set the first bit to MSB
420-
/// \constant LSB - set the first bit to LSB
421417
// Note: we use the ST constants >> 4 so they fit in a small-int. The
422418
// right-shift is undone when the constants are used in the init function.
423419
{ MP_OBJ_NEW_QSTR(MP_QSTR_NORMAL), MP_OBJ_NEW_SMALL_INT(CAN_MODE_NORMAL >> 4) },

stmhal/modcc3k.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
#include "netapp.h"
6262
#include "patch_prog.h"
6363

64+
/// \moduleref network
65+
6466
int CC3000_EXPORT(errno); // for cc3000 driver
6567

6668
STATIC mp_obj_t cc3k_socket_new(mp_uint_t family, mp_uint_t type, mp_uint_t protocol, int *_errno);
@@ -140,6 +142,8 @@ STATIC int cc3k_gethostbyname(mp_obj_t nic, const char *name, mp_uint_t len, uin
140142
/******************************************************************************/
141143
// Micro Python bindings; CC3k class
142144

145+
/// \class CC3k - driver for CC3000 Wifi modules
146+
143147
typedef struct _cc3k_obj_t {
144148
mp_obj_base_t base;
145149
} cc3k_obj_t;

stmhal/modnetwork.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#include "runtime.h"
4141
#include "modnetwork.h"
4242

43+
/// \module network - network configuration
44+
///
45+
/// This module provides network drivers and routing configuration.
46+
4347
mp_obj_list_t mod_network_nic_list;
4448

4549
void mod_network_init(void) {

stmhal/modusocket.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
#include "runtime.h"
4242
#include "modnetwork.h"
4343

44-
/// \module usocket
44+
/// \module usocket - socket module
45+
///
46+
/// Socket functionality.
4547

46-
/// \method socket(family=AF_INET, type=SOCK_STREAM, fileno=-1)
48+
/// \function socket(family=AF_INET, type=SOCK_STREAM, fileno=-1)
4749
/// Create a socket.
4850
STATIC mp_obj_t mod_usocket_socket(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
4951
static const mp_arg_t allowed_args[] = {
@@ -75,7 +77,7 @@ STATIC mp_obj_t mod_usocket_socket(mp_uint_t n_args, const mp_obj_t *pos_args, m
7577
}
7678
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(mod_usocket_socket_obj, 0, mod_usocket_socket);
7779

78-
/// \method getaddrinfo(host, port)
80+
/// \function getaddrinfo(host, port)
7981
STATIC mp_obj_t mod_usocket_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) {
8082
mp_uint_t hlen;
8183
const char *host = mp_obj_str_get_data(host_in, &hlen);

stmhal/modwiznet5k.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,7 @@
4848
#include "ethernet/socket.h"
4949
#include "internet/dns/dns.h"
5050

51-
/// \module wiznet5k - control WIZnet5x00 Ethernet adaptors
52-
///
53-
/// This module allows you to control WIZnet5x00 Ethernet adaptors based on
54-
/// the W5200 and W5500 chipsets (only W5200 tested).
55-
///
56-
/// Example usage:
57-
///
58-
/// import wiznet5k
59-
/// w = wiznet5k.WIZnet5k()
60-
/// print(w.ipaddr())
61-
/// w.gethostbyname('micropython.org')
62-
/// s = w.socket()
63-
/// s.connect(('192.168.0.2', 8080))
64-
/// s.send('hello')
65-
/// print(s.recv(10))
51+
/// \moduleref network
6652

6753
#define IPADDR_BUF_SIZE (4)
6854

@@ -164,6 +150,20 @@ STATIC int wiznet5k_gethostbyname(mp_obj_t nic, const char *name, mp_uint_t len,
164150
// Micro Python bindings
165151

166152
/// \class WIZnet5k - driver for WIZnet5x00 Ethernet modules
153+
///
154+
/// This class allows you to control WIZnet5x00 Ethernet adaptors based on
155+
/// the W5200 and W5500 chipsets (only W5200 tested).
156+
///
157+
/// Example usage:
158+
///
159+
/// import wiznet5k
160+
/// w = wiznet5k.WIZnet5k()
161+
/// print(w.ipaddr())
162+
/// w.gethostbyname('micropython.org')
163+
/// s = w.socket()
164+
/// s.connect(('192.168.0.2', 8080))
165+
/// s.send('hello')
166+
/// print(s.recv(10))
167167

168168
STATIC void wiznet5k_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
169169
print(env, "WIZnet5k()");

0 commit comments

Comments
 (0)