Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
00a659f3
Commit
00a659f3
authored
May 02, 2018
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/dac: Implement printing of a DAC object.
parent
dcfd2de5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
ports/stm32/dac.c
ports/stm32/dac.c
+8
-0
No files found.
ports/stm32/dac.c
View file @
00a659f3
...
...
@@ -152,6 +152,13 @@ typedef struct _pyb_dac_obj_t {
uint8_t
outbuf_waveform
;
}
pyb_dac_obj_t
;
STATIC
void
pyb_dac_print
(
const
mp_print_t
*
print
,
mp_obj_t
self_in
,
mp_print_kind_t
kind
)
{
pyb_dac_obj_t
*
self
=
MP_OBJ_TO_PTR
(
self_in
);
mp_printf
(
print
,
"DAC(%u, bits=%u)"
,
self
->
dac_channel
==
DAC_CHANNEL_1
?
1
:
2
,
self
->
bits
);
}
STATIC
mp_obj_t
pyb_dac_init_helper
(
pyb_dac_obj_t
*
self
,
size_t
n_args
,
const
mp_obj_t
*
pos_args
,
mp_map_t
*
kw_args
)
{
static
const
mp_arg_t
allowed_args
[]
=
{
{
MP_QSTR_bits
,
MP_ARG_INT
,
{.
u_int
=
8
}
},
...
...
@@ -529,6 +536,7 @@ STATIC MP_DEFINE_CONST_DICT(pyb_dac_locals_dict, pyb_dac_locals_dict_table);
const
mp_obj_type_t
pyb_dac_type
=
{
{
&
mp_type_type
},
.
name
=
MP_QSTR_DAC
,
.
print
=
pyb_dac_print
,
.
make_new
=
pyb_dac_make_new
,
.
locals_dict
=
(
mp_obj_dict_t
*
)
&
pyb_dac_locals_dict
,
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment