Page 1 of 1

No information about Hall-effect sensor

Posted: Wed May 24, 2017 1:09 pm
by GuiGeek
Hi,

I want to use Hall Effect sensor on my 1205P, but there is not enough information on doc and firmware sources.

I need especially the input and output bit / port to use the init function located in file "td_halleffect.c".

Thanks

Re: No information about Hall-effect sensor

Posted: Fri Jun 02, 2017 7:41 am
by mstempin
Please find attached 3 source files detailing how to use the Hall sensor in "low power" polling mode. They declare 3 functions:
  • TD_HALLEFFECT_Init: must be called in TD_SUER_Setup() with the 2 GPIOs used for the sensor
  • [*TD_HALLEFFECT_PollingEnable: enables/disable the polling]
  • TD_HALLEFFECT_Process: must be called from TD_User_Loop(). Fetch events and detection duration in order to perform differrent actions based on the duration the magnet is detected

The example td12xx_modem.c file is such an implementation in the standard modem firmware main file. The Hall sensor GPIOs are defined there as:
Code: Select all
#define HALL_COMMAND_PORT gpioPortC
#define HALL_COMMAND_BIT 13
#define HALL_OUT_PORT gpioPortC
#define HALL_OUT_BIT 12