Flipper/Applications/Official/source-OLDER/xMasterX/wii_ec_anal/README.txt

68 lines
2.5 KiB
Plaintext

,-------.
---( Files )---
`-------'
README.md - User Manual : Body [github markdown]
_images/ - User Manual : Images
_images/GIMP/ - User Manual : GIMP image masters
LICENSE - Tech Docs : MIT Licence file
README.txt - Tech Docs : Dev notes
notes.txt - Tech Docs : Random dev notes
info.sh - Tech Docs : Retrieve info from source code
application.fam - FAP : Header file
WiiEC.png - FAP : Icon {10x10}
gfx/ - Analyser : Images [generated by bc_image_tool]
wii_anal.c|h - Analyser : Main application
wii_anal_ec.c|h - Analyser : Extension controller actions
wii_anal_keys.c|h - Analyser : Keyboard handling
wii_anal_lcd.c|h - Analyser : LCD handling
i2c_workaround.h - Temporary workaround for i2c bug in FZ code
err.h - Errors
bc_logging.h - Logging macros - especially LOG_LEVEL
wii_i2c.c|h - i2c functionality
wii_ec.c|h - Extension Controller basic functions
wii_ec_macros.h - Bespoke Extension Controller handy-dandy MACROs
wii_ec_classic.c|h - EC: Classic Controller Pro scene
wii_ec_nunchuck.c|h - EC: Nunchuck scene
wii_ec_udraw.c|h - EC: UDraw scene - not written
,----------------------------------.
---( Adding a new Extension Controller )---
`----------------------------------'
//! I'll finish this when I write the UDraw code
Create a new Extension Controller called "mydev"
Create wii_ec_mydev.c and wii_ec_mydev.h
In wii_ec_mydev.c|h
Create the functions [& prototypes]
bool mydev_init (wiiEC_t* const) ; // Additional initialisation code
void mydev_decode (wiiEC_t* const) ; // Decode controller input data
void mydev_msg (wiiEC_t* const, FuriMessageQueue* const) ; // Put event messages in the event queue
void mydev_calib (wiiEC_t* const, ecCalib_t) ; // Controller calibration function
void mydev_show (Canvas* const, state_t* const) ; // Scene LCD display
bool mydev_key (const eventMsg_t* const, state_t* const) ; // Scene key controls
In wii_ec.h
Include the new header
#include "wii_ec_mydev.h"
Add a perhipheral id to enum ecPid
PID_MYDEV
In wii_anal.h
As a scene name to enum scene
SCENE_MYDEV
In wii_ec.c
Add the device definition to the ecId[] array
[PID_MYDEV] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, "My Device", SCENE_MYDEV,
mydev_init, mydev_decode, mydev_msg, mydev_calib, mydev_show, mydev_key },