Commit graph

24 commits

Author SHA1 Message Date
sam blenny
0063bdc27e fix broken example link in docs
The old way worked fine on my local server, but it gave me a 404
when I checked the production version on the RTD server. Hopefully
this will fix it?
2025-08-25 22:18:31 +00:00
sam blenny
bc20f0b3c0 more docs, mostly usage examples
Hopefully, this should make it clear how to use the API for setting
volume for speakers, headphones, or line-level output.
2025-08-25 19:17:03 +00:00
sam blenny
81c00085ec remove doc-comment backslash escapes
I added these several commits back because they seemed to resolve
a weird Sphinx code-block rendering bug in the html docs. But, now
I can't reproduce the bug, so there's no reason to keep the
escapes.
2025-08-25 15:04:27 +00:00
sam blenny
bd24ba5e46 fix speaker_volume & tune gain defaults
This fixes a bug that I found while testing the speaker output. I
also balanced the default speaker_volume and headphone_volume gain
levels so they sound about the same loudness (to me, with my
earbuds). That way you can use dac_volume for runtime volume
adjustments and it will hopefully work about the same for the
speaker or the headphones.

To set the board up for different headphones or speakers, you could
experiment with suitable values for speaker_volume and
headphone_volume to set in an initialization function, like a
trimpot. After that, you could use dac_volume to set volume.
2025-08-25 06:47:57 +00:00
sam blenny
12d09409be fix headphone route, dial in default gain
This fixes the headphone_output property setter to use the
DAC_ROUTE_MIXER option so the headphone_volume attenuation stage
doesn't get bypassed (as it did previously). This makes it a lot
easier to set non-ear-bleedy volume levels for headphones.
2025-08-25 04:44:02 +00:00
sam blenny
522f615ffe fix silly bugs from blind edits
This is what needed fixing when I actually started running some
Fruit Jam test code with the headphone output. Haven't tried the
speaker yet.
2025-08-25 03:34:03 +00:00
sam blenny
76d1cad3f4 fix Pylance problems
Mostly these were type annotations referring to non-existant types.
There was also a misspelled function name.
2025-08-25 00:21:28 +00:00
sam blenny
e1f10ab7df revise doc-comments to fix missing info
Thought I was done with doc-comments, but then I noticed that there
wasn't a clear indication in the html about which properties were
settable and which were read only. I also discovered that several
properties that could raise ValueError weren't marked as such.
(technically they were in the code, but Sphinx was ignoring that)

Changes:
1. Systematic :getter: and :setter: attributes for properties
2. Move `:raises: ...` from setter comments to getter comments so
   they show up in the html doc. This particularly applies to
   setters that use constants.
3. Change `:return: ...` to `:getter: ...` for getter functions
2025-08-25 00:04:06 +00:00
sam blenny
5e076772c1 fix failing pre-commit linter checks
This gets ruff to stop complaining. Haven't tested the code yet
though. That's next.
2025-08-24 22:37:20 +00:00
sam blenny
f694d14682 level up documentation comments
This fixes assorted Sphinx documentation stuff:
1. Add CSS workaround for horizontal stacking glitch in rtd theme
2. Convert plain comments for public constants to doc-comment style
   so they will get included in the html docs
3. Change Sphinx autodoc's default sort order from alphabetical to
   groupwise. Now the class methods come first, the properties come
   next, and the constants go at the end. It's much easier to read
   this way.
2025-08-24 21:44:10 +00:00
sam blenny
71294d0145 first pass at volume control overhaul
This commit makes several interrelated changes at once:
1. There's a new lookup table based dB to int7 conversion mechansim
   for the analog volume setting properties (based on Table 6-24)
2. Major docs comment revisions for properties involved in DAC
   volume, speaker volume, headphone volume, speaker gain, and
   headphone gain
3. Added "_" prefix to private helper classes to stop them from
   cluttering up the Sphinx html docs build
4. Merged setter & getter comments into the setter comment for
   the properties I modified. NOTE: Sphinx does not render docs
   comments on property setters!
4. Assorted small-ish revisions to exception handling and
   arguments (convert SPK_GAIN_* constants to dB) to resolve
   inconsistent or surprising behavior discovered while revising
   docs comments

Overall, the goals here are:
1. Make volume setting implementation work and be non-surprising
2. Document how it works
3. Make the TLV320 html docs more readable and complete. A lot of
   the docs comment info wasn't making it through into the html
   docs build because Sphinx ignores setter comments.

The comments build fine, but it's possible the code has errors.
Saving that testing for another day.
2025-08-24 09:44:50 +00:00
Liz
1c7a72dd05 create dac_volume 2025-05-05 12:15:33 -04:00
Liz
8d5541065e make speaker louder by default
Some checks failed
Build CI / test (push) Has been cancelled
2025-04-07 08:40:31 -04:00
Liz
759f7c2075
remove link text
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2025-03-31 16:06:29 -04:00
Liz
08a9a85b1c fix init order for speaker
tested with rev b fruit jam
2025-03-21 17:04:07 -04:00
Liz
2a2e91727f fix property comments 2025-03-19 13:42:42 -04:00
BlitzCityDIY
67cc08310d docs 2025-03-19 11:49:08 -04:00
BlitzCityDIY
15d5317a3d ruff 2025-03-19 11:40:56 -04:00
BlitzCityDIY
f5db1f6348 remove todos, tested with fruitjam rev b 2025-03-19 11:27:57 -04:00
Liz
f2f553390c typing and ruff 2025-03-18 17:14:45 -04:00
Liz
5af8082cfa propertized and simpletest 2025-03-18 11:32:51 -04:00
Liz
98eb909cfc full port, full test
needs cleaning up, but driver is working
2025-03-14 13:46:45 -04:00
Liz
a65bcdc3d4 sine tone and initial library 2025-03-12 16:55:16 -04:00
Liz
6c5dce4c1b cookiecutter 2025-03-12 14:58:45 -04:00