|
bm78
2.1.0.0
|
API for configuring and manipulating BM78 Click driver. More...
Modules | |
| BM78 Device Settings | |
| Settings for registers of BM78 Click driver. | |
| BM78 MikroBUS Map | |
| MikroBUS pin mapping of BM78 Click driver. | |
Functions | |
| void | bm78_cfg_setup (bm78_cfg_t *cfg) |
| BM78 configuration object setup function. More... | |
| err_t | bm78_init (bm78_t *ctx, bm78_cfg_t *cfg) |
| BM78 initialization function. More... | |
| err_t | bm78_generic_write (bm78_t *ctx, uint8_t *data_in, uint16_t len) |
| BM78 data writing function. More... | |
| err_t | bm78_generic_read (bm78_t *ctx, uint8_t *data_out, uint16_t len) |
| BM78 data reading function. More... | |
| void | bm78_set_rst_pin (bm78_t *ctx, uint8_t pin_state) |
| BM78 set RST pin function. More... | |
| void | bm78_set_cts_pin (bm78_t *ctx, uint8_t pin_state) |
| BM78 set CTS pin function. More... | |
| uint8_t | bm78_get_st1_pin (bm78_t *ctx) |
| BM78 get ST1 pin function. More... | |
| uint8_t | bm78_get_st2_pin (bm78_t *ctx) |
| BM78 get ST2 pin function. More... | |
| uint8_t | bm78_get_rts_pin (bm78_t *ctx) |
| BM78 get RTS pin function. More... | |
| void | bm78_hw_reset (bm78_t *ctx) |
| BM78 Hardware reset function. More... | |
| err_t | bm78_eeprom_send_cmd (bm78_t *ctx, uint16_t op_code, uint8_t *param, uint8_t len) |
| BM78 EEPROM send command function. More... | |
| err_t | bm78_eeprom_get_event (bm78_t *ctx, uint8_t *ev_type, uint8_t *len, uint8_t *data_rx) |
| BM78 EEPROM get event function. More... | |
| err_t | bm78_reset_cmd (bm78_t *ctx) |
| BM78 reset function. More... | |
| err_t | bm78_eeprom_write_number (bm78_t *ctx) |
| BM78 write EEPROM number function. More... | |
| err_t | bm78_eeprom_write (bm78_t *ctx, uint16_t address, uint8_t *data_in, uint8_t len) |
| BM78 EEPROM write function. More... | |
| err_t | bm78_eeprom_read (bm78_t *ctx, uint16_t address, uint8_t *data_out, uint8_t len) |
| BM78 EEPROM read function. More... | |
| err_t | bm78_flash_eeprom (bm78_t *ctx) |
| BM78 EEPROM flash function. More... | |
API for configuring and manipulating BM78 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void bm78_cfg_setup | ( | bm78_cfg_t * | cfg | ) |
BM78 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See bm78_cfg_t object definition for detailed explanation. |
| err_t bm78_eeprom_get_event | ( | bm78_t * | ctx, |
| uint8_t * | ev_type, | ||
| uint8_t * | len, | ||
| uint8_t * | data_rx | ||
| ) |
BM78 EEPROM get event function.
This function is used to get event data by using UART serial interface.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [out] | ev_type | : Event type. |
| [out] | len | : Number of bytes that are read. |
| [out] | data_rx | : Output read data. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t bm78_eeprom_read | ( | bm78_t * | ctx, |
| uint16_t | address, | ||
| uint8_t * | data_out, | ||
| uint8_t | len | ||
| ) |
BM78 EEPROM read function.
This function is used to read back the data from the EEPROM location specified by the address paramete.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [in] | address | : Start writing address. |
| [in] | data_out | : Read data. |
| [in] | len | : Number of bytes to be read. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t bm78_eeprom_send_cmd | ( | bm78_t * | ctx, |
| uint16_t | op_code, | ||
| uint8_t * | param, | ||
| uint8_t | len | ||
| ) |
BM78 EEPROM send command function.
This function is used to send specific EEPROM command by using UART serial interface.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [in] | op_code | : Specific 16-bit operation code. |
| [in] | param | : Data to be written. |
| [in] | len | : Number of bytes to be written. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t bm78_eeprom_write | ( | bm78_t * | ctx, |
| uint16_t | address, | ||
| uint8_t * | data_in, | ||
| uint8_t | len | ||
| ) |
BM78 EEPROM write function.
This function is used to write data into the EEPROM location specified by the address parameter.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [in] | address | : Start writing address. |
| [in] | data_in | : Data to be written. |
| [in] | len | : Number of bytes to be written. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t bm78_eeprom_write_number | ( | bm78_t * | ctx | ) |
BM78 write EEPROM number function.
This function is used to specify the size of the EEPROM write operation.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t bm78_flash_eeprom | ( | bm78_t * | ctx | ) |
BM78 EEPROM flash function.
This function is used write default configuration into the EEPROM.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t bm78_generic_read | ( | bm78_t * | ctx, |
| uint8_t * | data_out, | ||
| uint16_t | len | ||
| ) |
BM78 data reading function.
This function reads a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
>0 - Number of data bytes read, <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation. | err_t bm78_generic_write | ( | bm78_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | len | ||
| ) |
BM78 data writing function.
This function writes a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [in] | data_in | : Data buffer for sending. |
| [in] | len | : Number of bytes for sending. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | uint8_t bm78_get_rts_pin | ( | bm78_t * | ctx | ) |
BM78 get RTS pin function.
This function is used to get RTS pin state.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
1 - Pin state high, 0 - Pin state low. | uint8_t bm78_get_st1_pin | ( | bm78_t * | ctx | ) |
BM78 get ST1 pin function.
This function is used to get ST1 pin state.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
1 - Pin state high, 0 - Pin state low. | uint8_t bm78_get_st2_pin | ( | bm78_t * | ctx | ) |
BM78 get ST2 pin function.
This function is used to get ST2 pin state.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
1 - Pin state high, 0 - Pin state low. | void bm78_hw_reset | ( | bm78_t * | ctx | ) |
BM78 Hardware reset function.
This function is used to perform hardware reset.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| err_t bm78_init | ( | bm78_t * | ctx, |
| bm78_cfg_t * | cfg | ||
| ) |
BM78 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See bm78_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t bm78_reset_cmd | ( | bm78_t * | ctx | ) |
BM78 reset function.
This function is used to reset device to enable the EEPROM operation.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | void bm78_set_cts_pin | ( | bm78_t * | ctx, |
| uint8_t | pin_state | ||
| ) |
BM78 set CTS pin function.
This function is used to set CTS pin state.
| [in] | ctx | : Click context object. See bm78_t object definition for detailed explanation. |
| [in] | pin_state | : Selected pin state. |