nvm_data.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: BSD-3-Clause
  2. // Copyright (c) 2016, Alex Taradov <alex@taradov.com>. All rights reserved.
  3. #ifndef _NVM_DATA_H_
  4. #define _NVM_DATA_H_
  5. /*- Definitions -------------------------------------------------------------*/
  6. #define NVM_ADC_LINEARITY_POS 27
  7. #define NVM_ADC_LINEARITY_SIZE 8
  8. #define NVM_ADC_BIASCAL_POS 35
  9. #define NVM_ADC_BIASCAL_SIZE 3
  10. #define NVM_OSC32K_CAL_POS 38
  11. #define NVM_OSC32K_CAL_SIZE 7
  12. #define NVM_USB_TRANSN_POS 45
  13. #define NVM_USB_TRANSN_SIZE 5
  14. #define NVM_USB_TRANSP_POS 50
  15. #define NVM_USB_TRANSP_SIZE 5
  16. #define NVM_USB_TRIM_POS 55
  17. #define NVM_USB_TRIM_SIZE 3
  18. #define NVM_DFLL48M_COARSE_CAL_POS 58
  19. #define NVM_DFLL48M_COARSE_CAL_SIZE 6
  20. #define NVM_DFLL48M_FINE_CAL_POS 64
  21. #define NVM_DFLL48M_FINE_CAL_SIZE 10
  22. #define NVM_READ_CAL(cal) \
  23. ((*((uint32_t *)NVMCTRL_OTP4 + cal##_POS / 32)) >> (cal##_POS % 32)) & ((1 << cal##_SIZE) - 1)
  24. #endif // _NVM_DATA_H_